本文整理汇总了C#中ISpecification.GetFacet方法的典型用法代码示例。如果您正苦于以下问题:C# ISpecification.GetFacet方法的具体用法?C# ISpecification.GetFacet怎么用?C# ISpecification.GetFacet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISpecification
的用法示例。
在下文中一共展示了ISpecification.GetFacet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecorateFacet
private void DecorateFacet(Type facetType, ISpecification holder) {
if (facetDecorators.ContainsKey(facetType)) {
foreach (IFacetDecorator decorator in facetDecorators[facetType]) {
IFacet previousFacet = holder.GetFacet(facetType);
IFacet decoratedFacet = decorator.Decorate(previousFacet, holder);
if (decoratedFacet != null && decoratedFacet != previousFacet) {
FacetUtils.AddFacet(decoratedFacet);
}
}
}
}
示例2: IsAlwaysHidden
private static bool IsAlwaysHidden(ISpecification holder) {
var hiddenfacet = holder.GetFacet<IHiddenFacet>();
return hiddenfacet != null && hiddenfacet.Value == WhenTo.Always;
}
示例3: DefaultTypicalLength
private static void DefaultTypicalLength(ICollection<IFacet> facets, ISpecification specification, ISpecification holder) {
var typicalLengthFacet = specification.GetFacet<ITypicalLengthFacet>();
if (typicalLengthFacet == null) {
typicalLengthFacet = new TypicalLengthFacetZero(holder);
}
else {
typicalLengthFacet = new TypicalLengthFacetInferred(typicalLengthFacet.Value, holder);
}
facets.Add(typicalLengthFacet);
}
示例4: AddOrAddToExecutedWhereFacet
protected static void AddOrAddToExecutedWhereFacet(MethodInfo method, ISpecification holder) {
var attribute = method.GetCustomAttribute<ExecutedAttribute>();
if (attribute != null && !attribute.IsAjax) {
var executedFacet = holder.GetFacet<IExecutedControlMethodFacet>();
if (executedFacet == null) {
FacetUtils.AddFacet(new ExecutedControlMethodFacet(method, attribute.Value, holder));
}
else {
executedFacet.AddMethodExecutedWhere(method, attribute.Value);
}
}
}
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:12,代码来源:MethodPrefixBasedFacetFactoryAbstract.cs