1 Star 0 Fork 0

John-Dong/Protobuf-net-il2cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ProtoEnumAttribute.cs 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
John-Dong 提交于 2022-12-03 12:13 . init
using System;
namespace ProtoBuf
{
/// <summary>
/// Used to define protocol-buffer specific behavior for
/// enumerated values.
/// </summary>
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class ProtoEnumAttribute : Attribute
{
/// <summary>
/// Gets or sets the specific value to use for this enum during serialization.
/// </summary>
public int Value
{
get { return enumValue; }
set { this.enumValue = value; hasValue = true; }
}
/// <summary>
/// Indicates whether this instance has a customised value mapping
/// </summary>
/// <returns>true if a specific value is set</returns>
public bool HasValue() => hasValue;
private bool hasValue;
private int enumValue;
/// <summary>
/// Gets or sets the defined name of the enum, as used in .proto
/// (this name is not used during serialization).
/// </summary>
public string Name { get; set; }
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/johndong/protobuf-net-il2cpp.git
git@gitee.com:johndong/protobuf-net-il2cpp.git
johndong
protobuf-net-il2cpp
Protobuf-net-il2cpp
master

搜索帮助