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


C# IReflector类代码示例

本文整理汇总了C#中IReflector的典型用法代码示例。如果您正苦于以下问题:C# IReflector类的具体用法?C# IReflector怎么用?C# IReflector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ProcessArray

        private void ProcessArray(IReflector reflector, Type type, ISpecification holder) {
            FacetUtils.AddFacet(new ArrayFacet(holder));
            FacetUtils.AddFacet(new TypeOfFacetInferredFromArray(holder));

            var elementType = type.GetElementType();
            reflector.LoadSpecification(elementType);
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:CollectionFacetFactory.cs

示例2: Process

 public override void Process(IReflector reflector, MethodInfo method, IMethodRemover methodRemover, ISpecificationBuilder specification) {
     if ((method.ReturnType.IsPrimitive || TypeUtils.IsEnum(method.ReturnType)) && method.GetCustomAttribute<OptionallyAttribute>() != null) {
         Log.Warn("Ignoring Optionally annotation on primitive parameter on " + method.ReflectedType + "." + method.Name);
         return;
     }
     Process(method, specification);
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:7,代码来源:OptionalAnnotationFacetFactory.cs

示例3: Process

 public override void Process(IReflector reflector, PropertyInfo method, IMethodRemover methodRemover, ISpecificationBuilder specification) {
     if (method.PropertyType.IsAssignableFrom(typeof(ContactType))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(AddressType))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(ContactType))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(Culture))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(SalesReason))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(UnitMeasure))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(ScrapReason))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(ProductSubcategory))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
     if (method.PropertyType.IsAssignableFrom(typeof(ProductCategory))) {
         FacetUtils.AddFacet(new NotNavigableFacet(specification));
     }
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:29,代码来源:AWNotNavigableFacetFactory.cs

示例4: ProcessParams

 public override void ProcessParams(IReflector reflector, MethodInfo method, int paramNum, ISpecificationBuilder holder) {
     ParameterInfo parameter = method.GetParameters()[paramNum];
     if (TypeUtils.IsString(parameter.ParameterType)) {
         var attribute = parameter.GetCustomAttribute<MultiLineAttribute>();
         FacetUtils.AddFacet(Create(attribute, holder));
     }
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:7,代码来源:MultiLineAnnotationFacetFactory.cs

示例5: Process

 public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder spec) {
     var attr = type.GetCustomAttribute<NakedObjectsTypeAttribute>();
     if (attr == null) {
         RemoveExplicitlyIgnoredMembers(type, methodRemover);
     } else {
         switch (attr.ReflectionScope) {
             case ReflectOver.All:
                 RemoveExplicitlyIgnoredMembers(type, methodRemover);
             break;
             case ReflectOver.TypeOnlyNoMembers:
                 foreach (MethodInfo method in type.GetMethods()) {
                     methodRemover.RemoveMethod(method);
                 }
                 break;
             case ReflectOver.ExplicitlyIncludedMembersOnly:
                 foreach (MethodInfo method in type.GetMethods()) {
                     if (method.GetCustomAttribute<NakedObjectsIncludeAttribute>() == null) {
                         methodRemover.RemoveMethod(method);
                     }
                 }
                 break;
             case ReflectOver.None:
                 throw new ReflectionException("Attempting to introspect a class that has been marked with NakedObjectsType with ReflectOver.None");
             default:
                 throw new ReflectionException(String.Format("Unhandled value for ReflectOver: {0}", attr.ReflectionScope));
         }
     }
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:28,代码来源:RemoveIgnoredMethodsFacetFactory.cs

示例6: ClassReflector

 public virtual IReflectClass ClassReflector(IReflector reflector, ClassMetadata classMetadata
     , bool isPrimitive)
 {
     return isPrimitive
         ? Handlers4.PrimitiveClassReflector(classMetadata, reflector)
         : classMetadata.ClassReflector();
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ArrayVersionHelper.cs

示例7: Process

        private void Process(IReflector reflector, MethodInfo member, ISpecification holder) {
            var allParams = member.GetParameters();
            var paramsWithAttribute = allParams.Where(p => p.GetCustomAttribute<ContributedActionAttribute>() != null).ToArray();
            if (!paramsWithAttribute.Any()) return; //Nothing to do
            var facet = new ContributedActionFacet(holder);
            foreach (ParameterInfo p in paramsWithAttribute) {
                var attribute = p.GetCustomAttribute<ContributedActionAttribute>();
                var type = reflector.LoadSpecification<IObjectSpecImmutable>(p.ParameterType);
                if (type != null) {
                    if (type.IsParseable) {
                        Log.WarnFormat("ContributedAction attribute added to a value parameter type: {0}", member.Name);
                    }
                    else if (type.IsCollection) {
                        var parent = reflector.LoadSpecification(member.DeclaringType);

                        if (parent is IObjectSpecBuilder) {
                            AddLocalCollectionContributedAction(reflector,  p, facet);
                        }
                        else {
                            AddCollectionContributedAction(reflector, member, type, p, facet, attribute);
                        }
                    }
                    else {
                        facet.AddObjectContributee(type, attribute.SubMenu, attribute.Id);
                    }
                }
            }
            FacetUtils.AddFacet(facet);
        }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:29,代码来源:ContributedActionAnnotationFacetFactory.cs

示例8: NetConstructor

 public NetConstructor(IReflector reflector, ConstructorInfo
     constructor)
 {
     this.reflector = reflector;
     this.constructor = constructor;
     Platform4.SetAccessible(constructor);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:NetConstructor.cs

示例9: Process

        public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification) {
            IFacet facet = null;

            if (!type.IsInterface && typeof (IViewModel).IsAssignableFrom(type)) {
                MethodInfo deriveMethod = type.GetMethod("DeriveKeys", new Type[] {});
                MethodInfo populateMethod = type.GetMethod("PopulateUsingKeys", new[] {typeof (string[])});

                var toRemove = new List<MethodInfo> {deriveMethod, populateMethod};

                if (typeof (IViewModelEdit).IsAssignableFrom(type)) {
                    facet = new ViewModelEditFacetConvention(specification);
                }
                else if (typeof (IViewModelSwitchable).IsAssignableFrom(type)) {
                    MethodInfo isEditViewMethod = type.GetMethod("IsEditView");
                    toRemove.Add(isEditViewMethod);
                    facet = new ViewModelSwitchableFacetConvention(specification);
                }
                else {
                    facet = new ViewModelFacetConvention(specification);
                }
                methodRemover.RemoveMethods(toRemove.ToArray());
            }

            FacetUtils.AddFacet(facet);
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:25,代码来源:ViewModelFacetFactory.cs

示例10: EnigmaMachine

 public EnigmaMachine(IAlphabet alphabet, IRotor leftRotor, IRotor centerRotor, IRotor righRotor, IReflector reflector)
 {
     _alphabet = alphabet;
     _leftRotor = leftRotor;
     _centerRotor = centerRotor;
     _rightRotor = righRotor;
     _reflector = reflector;
 }
开发者ID:samwessel,项目名称:sc2012.Enigma,代码行数:8,代码来源:EnigmaMachine.cs

示例11: Process

 public override void Process(IReflector reflector, PropertyInfo property, IMethodRemover methodRemover, ISpecificationBuilder specification) {
     if (CollectionUtils.IsCollectionButNotArray(property.PropertyType)) {
         specification.AddFacet(new CollectionResetFacet(property, specification));
     }
     else {
         base.Process(reflector, property, methodRemover, specification);
     }
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:CollectionFacetFactory.cs

示例12: ClassReflector

		public virtual IReflectClass ClassReflector(IReflector reflector)
		{
			if (_classReflector == null)
			{
				_classReflector = ((IBuiltinTypeHandler)GetHandler()).ClassReflector();
			}
			return _classReflector;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:VirtualFieldMetadata.cs

示例13: CommandMap

 //---------------------------------------------------------------------
 //  Constructor
 //---------------------------------------------------------------------
 /**
  * Creates a new <code>CommandMap</code> object
  *
  * @param eventDispatcher The <code>IEventDispatcher</code> to listen to
  * @param injector An <code>IInjector</code> to use for this context
  * @param reflector An <code>IReflector</code> to use for this context
  */
 public CommandMap( IEventDispatcher eventDispatcher, IInjector injector, IReflector reflector )
 {
     this.eventDispatcher = eventDispatcher;
     this.injector = injector;
     this.reflector = reflector;
     this.eventTypeMap = new Dictionary<string,Dictionary<Type, Dictionary<Type, Action<Event>>>>();
     this.verifiedCommandClasses = new Dictionary<Type,bool>();
 }
开发者ID:tekool,项目名称:silverlight-robotlegs-framework,代码行数:18,代码来源:CommandMap.cs

示例14: Process

 public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification) {
     if (typeof (IEnumerable).IsAssignableFrom(type) && !TypeUtils.IsSystem(type)) {
         MethodInfo method = FindMethod(reflector, type, MethodType.Object, RecognisedMethodsAndPrefixes.GetEnumeratorMethod, null, Type.EmptyTypes);
         if (method != null) {
             methodRemover.RemoveMethod(method);
         }
     }
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:IteratorFilteringFacetFactory.cs

示例15: Process

 public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification) {
     FacetUtils.AddFacets(
         new IFacet[] {
             new DescribedAsFacetNone(specification),
             new ImmutableFacetNever(specification),
             new TitleFacetNone(specification)
         });
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:FallbackFacetFactory.cs


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