当前位置: 首页>>代码示例>>C#>>正文


C# FieldDescriptor.GetFieldName方法代码示例

本文整理汇总了C#中D3TypeDescriptor.FieldDescriptor.GetFieldName方法的典型用法代码示例。如果您正苦于以下问题:C# FieldDescriptor.GetFieldName方法的具体用法?C# FieldDescriptor.GetFieldName怎么用?C# FieldDescriptor.GetFieldName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在D3TypeDescriptor.FieldDescriptor的用法示例。


在下文中一共展示了FieldDescriptor.GetFieldName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateOptionalEncodeBitBuffer

 public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     if (f.HasMinMax)
         throw new NotImplementedException();
     if (f.Float16Encoding)
         throw new NotImplementedException();
     if (f.EncodedBits != 32)
         throw new NotImplementedException();
     var fieldName = f.GetFieldName();
     b.Append(' ', pad); b.AppendLine("if(" + fieldName + ".HasValue)");
     b.Append(' ', pad+4); b.AppendLine(bitBufferName + ".WriteFloat32(" + f.GetFieldName() + ".Value);");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:12,代码来源:DT_FLOAT.cs

示例2: GenerateEncodeBitBuffer

 public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     if (f.HasMinMax)
         throw new NotImplementedException();
     b.Append(' ', pad);
     b.AppendLine(bitBufferName + ".WriteInt64(" + f.EncodedBits + ", " + f.GetFieldName() + ");");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:7,代码来源:DT_INT64.cs

示例3: GenerateField

 public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f)
 {
     if (f.HasMinMax)
     {
         if (f.Min == 0 && f.Max == 1)
         {
             b.Append(' ', pad); b.AppendLine("public bool " + f.GetFieldName() + ";");
         }
         else
         {
             var name = f.GetFieldName();
             b.Append(' ', pad); b.AppendLine("int _" + name + ";");
             b.Append(' ', pad); b.AppendLine("public int " + name + " { get { return _" + name + "; } set { if(value < " + f.Min.ToMaybeHexString(1024) + " || value > " + f.Max.ToMaybeHexString(1024) + ") throw new ArgumentOutOfRangeException(); _" + name + " = value; } }");
         }
     }
     else
     {
         b.Append(' ', pad); b.AppendLine("public int " + f.GetFieldName() + ";");
     }
 }
开发者ID:starcasters,项目名称:type-extractor,代码行数:20,代码来源:DT_INT.cs

示例4: GenerateParseBitBuffer

 public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     if (f.HasMinMax)
         throw new NotImplementedException();
     if (f.Float16Encoding)
         throw new NotImplementedException();
     if (f.EncodedBits != 32)
         throw new NotImplementedException();
     b.Append(' ', pad);
     b.AppendLine(f.GetFieldName() + " = " + bitBufferName + ".ReadFloat32();");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:11,代码来源:DT_FLOAT.cs

示例5: GenerateParseBitBuffer

 public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     var fieldName = f.GetFieldName();
     b.Append(' ', pad); b.Append(fieldName + " = ");
     if (f.HasMinMax)
     {
         if (f.Min == 0 && f.Max == 1)
         {
             b.AppendLine(bitBufferName + ".ReadBool();");
         }
         else
         {
             if(f.Min != 0)
                 b.AppendLine(bitBufferName + ".ReadInt(" + f.EncodedBits + ") + (" + f.Min + ");");
             else
                 b.AppendLine(bitBufferName + ".ReadInt(" + f.EncodedBits + ");");
         }
     }
     else
     {
         b.AppendLine(bitBufferName + ".ReadInt(" + f.EncodedBits + ");");
     }
 }
开发者ID:wow4all,项目名称:mooege,代码行数:23,代码来源:DT_INT.cs

示例6: GenerateFixedArrayEncodeBitBuffer

        public override void GenerateFixedArrayEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
        {
            var fieldName = f.GetFieldName();

            if (f.HasArrayLengthOffset)
            {
                b.Append(' ', pad);
                b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits2 + ", _" + f.GetFieldName() + ".Length);");
            }

            b.Append(' ', pad); b.AppendLine("for(int i = 0;i < _" + fieldName + ".Length;i++) _" + fieldName + "[i].Encode(" + bitBufferName + ");");
        }
开发者ID:wow4all,项目名称:mooege,代码行数:12,代码来源:StructureTypeDescriptor.cs

示例7: GenerateOptionalEncodeBitBuffer

 public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     b.Append(' ', pad); b.AppendLine("if(" + f.GetFieldName() + " != null)");
     b.Append(' ', pad); b.AppendLine(f.GetFieldName() + ".Encode(" + bitBufferName + ");");
 }
开发者ID:wow4all,项目名称:mooege,代码行数:5,代码来源:StructureTypeDescriptor.cs

示例8: GenerateFixedArrayParseBitBuffer

        public override void GenerateFixedArrayParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
        {
            var name = f.GetFieldName();
            b.Append(' ', pad);
            if (f.HasArrayLengthOffset)
                b.AppendLine(name + " = new " + Name + "[" + bitBufferName + ".ReadInt(" + f.EncodedBits2 + ")];");
            else
                b.AppendLine(name + " = new " + Name + "[" + f.ArrayLength + "];");

            b.Append(' ', pad); b.AppendLine("for(int i = 0;i < _" + name + ".Length;i++)");
            b.Append(' ', pad); b.AppendLine("{");
            b.Append(' ', pad + 4); b.AppendLine("_" + name + "[i] = new " + Name + "();");
            b.Append(' ', pad + 4); b.AppendLine("_" + name + "[i].Parse(" + bitBufferName + ");");
            b.Append(' ', pad); b.AppendLine("}");

        }
开发者ID:wow4all,项目名称:mooege,代码行数:16,代码来源:StructureTypeDescriptor.cs

示例9: GenerateParseBitBuffer

 public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     b.Append(' ', pad); b.AppendLine(f.GetFieldName() + " = new " + Name + "();");
     b.Append(' ', pad); b.AppendLine(f.GetFieldName() + ".Parse(" + bitBufferName + ");");
 }
开发者ID:wow4all,项目名称:mooege,代码行数:5,代码来源:StructureTypeDescriptor.cs

示例10: GenerateFixedArrayField

 public override void GenerateFixedArrayField(StringBuilder b, int pad, FieldDescriptor f)
 {
     b.Append(' ', pad); b.AppendLine(Name + "[] _" + f.GetFieldName() + ";");
     b.Append(' ', pad);
     b.AppendLine("public " + Name + "[] " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { if(value != null && value.Length " + (f.HasArrayLengthOffset ? "> " : "!= ") + f.ArrayLength + ") throw new ArgumentOutOfRangeException(); _" + f.GetFieldName() + " = value; } }");
 }
开发者ID:wow4all,项目名称:mooege,代码行数:6,代码来源:StructureTypeDescriptor.cs

示例11: GenerateField

 public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f)
 {
     b.Append(' ', pad); b.AppendLine("public " + Name + " " + f.GetFieldName() + ";");
 }
开发者ID:wow4all,项目名称:mooege,代码行数:4,代码来源:StructureTypeDescriptor.cs

示例12: GenerateParseBitBuffer

 public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     b.Append(' ', pad);
     b.AppendLine(f.GetFieldName() + " = " + bitBufferName + ".ReadCharArray(" + f.ArrayLength + ");");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:5,代码来源:DT_CHARARRAY.cs

示例13: GenerateField

 public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f)
 {
     b.Append(' ', pad); b.AppendLine("public string _" + f.GetFieldName() + ";");
     b.Append(' ', pad); b.AppendLine("public string " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { if(value != null && value.Length > " + f.ArrayLength + ") throw new ArgumentOutOfRangeException(); _" + f.GetFieldName() + " = value; } }");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:5,代码来源:DT_CHARARRAY.cs

示例14: GenerateOptionalEncodeBitBuffer

 public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
 {
     b.Append(' ', pad); b.AppendLine("if(" + f.GetFieldName() + " != null)");
     b.Append(' ', pad+4); b.AppendLine(bitBufferName + ".WriteCharArray(" + f.ArrayLength + ", " + f.GetFieldName() + ");");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:5,代码来源:DT_CHARARRAY.cs

示例15: GenerateOptionalField

 public override void GenerateOptionalField(StringBuilder b, int pad, FieldDescriptor f)
 {
     b.Append(' ', pad); b.AppendLine("public float? " + f.GetFieldName() + ";");
 }
开发者ID:rotacioskapa,项目名称:mooege,代码行数:4,代码来源:DT_FLOAT.cs


注:本文中的D3TypeDescriptor.FieldDescriptor.GetFieldName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。