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


C# BindingFlags.ToString方法代码示例

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


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

示例1: GetProperties

 public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
 {
     Console.WriteLine("Call to GetProperties: {0}", bindingAttr.ToString());
     return new PropertyInfo[] { };
 }
开发者ID:xenocons,项目名称:visualfsharp,代码行数:5,代码来源:TypeProviderInCSharp.cs

示例2: ShowFields

    private void ShowFields(string hierarchy, Type targetType, object container, BindingFlags bindingAttr)
    {
        EditorGUI.indentLevel++;

        {
            FieldInfo[] fields = targetType.GetFields(bindingAttr);
            if (fields.Length > 0)
            {
                EditorGUILayout.LabelField(bindingAttr.ToString());
                foreach (FieldInfo field in fields)
                {
                    if (field.DeclaringType == targetType)
                    {
                        bool editable = !field.IsLiteral && (editPrivate || field.IsPublic);
                        object value = field.GetValue(container);
                        object newValue = ShowKeyValue(hierarchy, field.Name, field.FieldType, value, editable);
                        if (editable && value != newValue)
                        {
                            field.SetValue(container, newValue);
                        }
                    }
                }
            }
        }

        if (showProperty)
        {
            PropertyInfo[] fields = targetType.GetProperties(bindingAttr);
            if (fields.Length > 0)
            {
                EditorGUILayout.LabelField(bindingAttr.ToString());
                foreach (PropertyInfo field in fields)
                {
                    if (field.DeclaringType == targetType)
                    {
                        if (field.CanRead)
                        {
                            MethodInfo getter = field.GetGetMethod();
                            if (getter != null && getter.GetParameters().Length == 0)
                            {
                                object value = getter.Invoke(container, null);
                                ShowKeyValue(hierarchy, field.Name, field.DeclaringType, value, false);
                            }
                        }
                    }
                }
            }
        }

        EditorGUI.indentLevel--;
    }
开发者ID:pb0,项目名称:ID0_Test,代码行数:51,代码来源:DeepInspector.cs

示例3: GetMethods

 public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
 {
     Console.WriteLine("Call to GetMethods: {0}", bindingAttr.ToString());
     return new MethodInfo[] {};
 }
开发者ID:xenocons,项目名称:visualfsharp,代码行数:5,代码来源:TypeProviderInCSharp.cs

示例4: GetEvents

 public override EventInfo[] GetEvents(BindingFlags bindingAttr)
 {
     Console.WriteLine("Call to GetEvents: {0}", bindingAttr.ToString());
     return new EventInfo[] {};
 }
开发者ID:xenocons,项目名称:visualfsharp,代码行数:5,代码来源:TypeProviderInCSharp.cs

示例5: GetEvent

 public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
 {
     Console.WriteLine("Call to GetEvent: {0}, {1}", name, bindingAttr.ToString());
     return null;
 }
开发者ID:xenocons,项目名称:visualfsharp,代码行数:5,代码来源:TypeProviderInCSharp.cs

示例6: GetConstructors

 public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
 {
     Console.WriteLine("Call to GetConstructors: {0}", bindingAttr.ToString());
     return new ConstructorInfo[] { };
 }
开发者ID:xenocons,项目名称:visualfsharp,代码行数:5,代码来源:TypeProviderInCSharp.cs

示例7: internalGetFieldOrProperty

 static object internalGetFieldOrProperty(Type t, string name, BindingFlags b, object obj_or_null)
 {
     var field = t.GetField(name, b);
     if (field == null) {
         var property = t.GetProperty (name, b);
         if (property == null)
             throw new ArgumentException (string.Format ("Field or property name '{0}' not found on object of type '{1}', for binding flags '{2}'", name, t.Name, b.ToString()));
         else
             return property.GetValue (obj_or_null, null);
     }
     else
         return field.GetValue (obj_or_null);
 }
开发者ID:kanwalpreet18,项目名称:rClr,代码行数:13,代码来源:ClrFacade.cs


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