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


C# FieldInfo.ToString方法代码示例

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


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

示例1: OkToUse

 public bool OkToUse(FieldInfo f, out string message)
 {
     if (f == null) throw new ArgumentNullException("f");
     return OkToUseInternal(f.ToString(), this.require_fields, this.forbid_fields, out message);
 }
开发者ID:SJMakin,项目名称:Randoop.NET,代码行数:5,代码来源:ReflectionFilters.cs

示例2: ReadDateTime

        private static DateTime ReadDateTime(BinaryParser parser, FieldInfo field)
        {
            var attr = BinaryParser.GetAttribute<BinaryFieldAttribute>(field);

            if (attr != null)
            {
                if (attr.FieldType == BinaryFieldType.UnixTime)
                {
                    return UnixTime.ToDateTime(parser.ReadUInt32());
                }
            }

            PscxArgumentException.Throw("Don't know how to parse DateTime field " + field.ToString());
            return DateTime.MinValue;
        }
开发者ID:razaraz,项目名称:Pscx,代码行数:15,代码来源:RecordParser.cs

示例3: ReadVersion

        private static Object ReadVersion(BinaryParser parser, FieldInfo field)
        {
            var attr = BinaryParser.GetAttribute<VersionFieldAttribute>(field);

            if (attr != null)
            {
                var args = new Object[attr.ComponentCount];

                for (int i = 0; i < args.Length; i++)
                {
                    args[i] = ReadIntegral(parser, attr.ComponentType);
                }

                return Activator.CreateInstance(typeof(Version), args);
            }

            PscxArgumentException.Throw(field.Name, "Don't know how to parse field " + field.ToString());
            return null;
        }
开发者ID:razaraz,项目名称:Pscx,代码行数:19,代码来源:RecordParser.cs

示例4: ReadString

        private static String ReadString(BinaryParser parser, FieldInfo field)
        {
            var attr = BinaryParser.GetAttribute<BinaryFieldAttribute>(field);

            if (attr != null)
            {
                if (attr.FieldType == BinaryFieldType.StringAsciiZ)
                {
                    if (attr.FixedLength > 0)
                    {
                        return parser.ReadStringAsciiZ();
                    }

                    return parser.ReadStringAsciiZ();
                }
            }

            PscxArgumentException.Throw(field.Name, "Don't know how to parse field " + field.ToString());
            return null;
        }
开发者ID:razaraz,项目名称:Pscx,代码行数:20,代码来源:RecordParser.cs

示例5: Emit

 public void Emit(OpCode opCode, FieldInfo fi)
 {
     ProcessCommand(opCode, 0, fi.ToString());
     ilGenerator.Emit(opCode, fi);
 }
开发者ID:antonovicha,项目名称:EmitMapperRedux,代码行数:5,代码来源:CompilationContext.cs

示例6: Describe

 internal static string Describe(FieldInfo fieldInfo)
 {
     return "{0} {1}{2} {3}".FormatInvariant(
         Describe(fieldInfo.ReflectedType),
         DescribeVisibility(fieldInfo),
         fieldInfo.IsStatic ? " static" : String.Empty,
         fieldInfo.ToString()
     );
 }
开发者ID:olivierdagenais,项目名称:testoriented,代码行数:9,代码来源:PublicInterfaceScanner.cs

示例7: OkToUse

        /// <summary>
        /// Determines if the target field is ok to use.
        /// </summary>
        /// <param name="field">
        /// The field to test.
        /// </param>
        /// <param name="message">
        /// A message for the caller.
        /// </param>
        /// <returns>
        /// True if the field is ok to use, false otherwise.
        /// </returns>
        public bool OkToUse(FieldInfo field, out string message)
        {
            if (field != null)
            {
                foreach (ForbidExpression fExp in this.forbiddenFields)
                {
                    if (fExp.IsForbidden(field.ToString()))
                    {
                        message = string.Format("The Field {0} matches the ForbidExpression with pattern {1}. It will not be used.", field.ToString(), fExp.Pattern);
                        return false;
                    }
                }

                message = string.Format("The Field {0} will be used.", field.ToString());
                return true;
            }
            else
            {
                message = "The passed in type argument was null";
                throw new ArgumentNullException(message);
            }
        }
开发者ID:jduv,项目名称:WinBert,代码行数:34,代码来源:PermissiveReflectionFilter.cs


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