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


C# IFacetHolder类代码示例

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


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

示例1: DecorateAllHoldersFacets

 public virtual void DecorateAllHoldersFacets(IFacetHolder holder) {
     if (!IsEmpty) {
         foreach (Type facetType in holder.FacetTypes) {
             DecoratedFacet(facetType, holder);
         }
     }
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:FacetDecoratorSet.cs

示例2: IsValid

 public static InteractionBuffer IsValid(IFacetHolder facetHolder, InteractionContext ic, InteractionBuffer buf) {
     IFacet[] facets = facetHolder.GetFacets(FacetFilters.IsA(typeof (IValidatingInteractionAdvisor)));
     foreach (IValidatingInteractionAdvisor advisor in facets) {
         buf.Append(advisor.Invalidates(ic));
     }
     return buf;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:InteractionUtils.cs

示例3: Process

        public override bool Process(Type type, IMethodRemover methodRemover, IFacetHolder holder) {
            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(holder);
                }
                else if (typeof (IViewModelSwitchable).IsAssignableFrom(type)) {
                    MethodInfo isEditViewMethod = type.GetMethod("IsEditView");
                    toRemove.Add(isEditViewMethod);
                    facet = new ViewModelSwitchableFacetConvention(holder);
                }
                else {
                    facet = new ViewModelFacetConvention(holder);
                }
                methodRemover.RemoveMethods(toRemove.ToArray());
            }

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

示例4: Process

 private static bool Process(MemberInfo member, IFacetHolder holder) {
     Attribute attribute = member.GetCustomAttribute<DescriptionAttribute>();
     if (attribute == null) {
         attribute = member.GetCustomAttribute<DescribedAsAttribute>();
     }
     return FacetUtils.AddFacet(Create(attribute, holder));
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:DescribedAsAnnotationFacetFactory.cs

示例5: RegExFacetAbstract

 protected RegExFacetAbstract(string validation, string format, bool caseSensitive, string failureMessage, IFacetHolder holder)
     : base(Type, holder) {
     validationPattern = validation;
     formatPattern = format;
     isCaseSensitive = caseSensitive;
     this.failureMessage = failureMessage;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:RegExFacetAbstract.cs

示例6: IsUsable

 private static InteractionBuffer IsUsable(IFacetHolder facetHolder, InteractionContext ic, InteractionBuffer buf) {
     IFacet[] facets = facetHolder.GetFacets(FacetFilters.IsA(typeof (IDisablingInteractionAdvisor)));
     foreach (IDisablingInteractionAdvisor advisor in facets) {
         buf.Append(advisor.Disables(ic));
     }
     return buf;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:InteractionUtils.cs

示例7: ActionInvocationFacetViaMethod

 public ActionInvocationFacetViaMethod(MethodInfo method, INakedObjectSpecification onType, INakedObjectSpecification returnType, IFacetHolder holder)
     : base(holder) {
     actionMethod = method;
     paramCount = method.GetParameters().Length;
     this.onType = onType;
     this.returnType = returnType;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:ActionInvocationFacetViaMethod.cs

示例8: Process

 public override bool Process(PropertyInfo property, IMethodRemover methodRemover, IFacetHolder holder) {
     if (CollectionUtils.IsCollectionButNotArray(property.PropertyType)) {
         holder.AddFacet(new CollectionResetFacet(property, holder));
         return true;
     }
     return base.Process(property, methodRemover, holder);
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:CollectionFacetFactory.cs

示例9: NakedObjectAssociationAbstract

 protected NakedObjectAssociationAbstract(string fieldId, INakedObjectSpecification specification, IFacetHolder facetHolder)
     : base(fieldId, facetHolder) {
     if (specification == null) {
         throw new ArgumentException(string.Format(Resources.NakedObjects.MissingFieldType, fieldId));
     }
     this.specification = specification;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:NakedObjectAssociationAbstract.cs

示例10: PropertyChoicesFacetViaMethod

        public PropertyChoicesFacetViaMethod(MethodInfo optionsMethod, IFacetHolder holder)
            : base(holder) {
            method = optionsMethod;

            parameterNamesAndTypes = optionsMethod.GetParameters().Select(p => new Tuple<string, INakedObjectSpecification>(p.Name.ToLower(), NakedObjectsContext.Reflector.LoadSpecification(p.ParameterType))).ToArray();
            parameterNames = parameterNamesAndTypes.Select(pnt => pnt.Item1).ToArray();
        }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:PropertyChoicesFacetViaMethod.cs

示例11: DescribedAsFacetDynamicWrapI18n

 public DescribedAsFacetDynamicWrapI18n(II18nManager manager, IFacetHolder holder, IIdentifier identifier, IDescribedAsFacet describedAsFacet, int index = -1)
     : base(Type, holder) {
     this.manager = manager;
     this.identifier = identifier;
     this.describedAsFacet = describedAsFacet;
     this.index = index;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:DescribedAsFacetDynamicWrapI18n.cs

示例12: Create

 /// <summary>
 ///     Returns a <see cref="IFacetsFacet" /> impl provided that at least one valid
 ///     factory <see cref="IFacetsFacet.FacetFactories" /> was specified.
 /// </summary>
 private static IFacetsFacet Create(FacetsAttribute attribute, IFacetHolder holder) {
     if (attribute == null) {
         return null;
     }
     var facetsFacetAnnotation = new FacetsFacetAnnotation(attribute, holder);
     return facetsFacetAnnotation.FacetFactories.Length > 0 ? facetsFacetAnnotation : null;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:11,代码来源:FacetsAnnotationFacetFactory.cs

示例13: SecurityHideForSessionFacet

 public SecurityHideForSessionFacet(IIdentifier identifier,
                                    SecurityFacetDecorator decorator,
                                    IFacetHolder holder)
     : base(holder) {
     this.identifier = identifier;
     this.decorator = decorator;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:SecurityFacetDecorator.cs

示例14: Create

        /// <summary>
        ///     Returns a <see cref="IValueFacet" /> implementation.
        /// </summary>
        private static IValueFacet Create(Type type, IFacetHolder holder) {
            // create from annotation, if present
            var annotation = type.GetCustomAttributeByReflection<ValueAttribute>();
            if (annotation != null) {
                if (annotation.SemanticsProviderClass != null || annotation.SemanticsProviderName.Length != 0) {
                    Type annotationType = annotation.SemanticsProviderClass;
                    if (annotationType == null && !string.IsNullOrEmpty(annotation.SemanticsProviderName)) {
                        annotationType = TypeUtils.GetType(annotation.SemanticsProviderName);
                    }
                    PropertyInfo method = annotationType.GetProperty("Parser");
                    Type propertyType = method.PropertyType.GetGenericArguments()[0];
                    if (!propertyType.IsAssignableFrom(type)) {
                        throw new ModelException(string.Format(Resources.NakedObjects.SemanticProviderMismatch, type, propertyType, holder.Identifier.ClassName));
                    }
                }

                var facet = TypeUtils.CreateGenericInstance<IValueFacet>(typeof (ValueFacetAnnotation<>),
                                                                         new[] {type},
                                                                         new object[] {type, holder});
                if (facet.IsValid) {
                    return facet;
                }
            }


            return null;
        }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:30,代码来源:ValueFacetFactory.cs

示例15: ActionChoicesFacetViaMethod

 public ActionChoicesFacetViaMethod(MethodInfo choicesMethod, Type choicesType, IFacetHolder holder, bool isMultiple = false)
     : base(holder) {
     this.choicesMethod = choicesMethod;
     this.choicesType = choicesType;
     this.isMultiple = isMultiple;
     parameterNamesAndTypes = choicesMethod.GetParameters().Select(p => new Tuple<string, INakedObjectSpecification>(p.Name.ToLower(), NakedObjectsContext.Reflector.LoadSpecification(p.ParameterType))).ToArray();
     parameterNames = parameterNamesAndTypes.Select(pnt => pnt.Item1).ToArray();
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:8,代码来源:ActionChoicesFacetViaMethod.cs


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