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


C# IObjectFacade.WrappedAdapter方法代码示例

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


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

示例1: GetObjectId

        public string GetObjectId(IObjectFacade objectFacade) {
            INakedObjectAdapter owner = objectFacade.WrappedAdapter();
            string postFix = "";

            if (owner.Spec.IsCollection) {
                var elementFacet = owner.Spec.GetFacet<ITypeOfFacet>();
                var elementType = elementFacet.GetValue(owner);

                postFix = Sep + elementType.Name;
            }

            return owner.Spec.ShortName + postFix;
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:13,代码来源:IdHelper.cs

示例2: GetActionId

        public string GetActionId(string propertyName, IActionFacade actionContextActionFacade, IObjectFacade actionObjectFacade, IObjectFacade targetObjectFacade, IActionFacade targetActionFacade) {
            IActionSpec actionContextAction = actionContextActionFacade == null ? null :  actionContextActionFacade.WrappedSpec();
            INakedObjectAdapter actionContextTarget = actionObjectFacade == null ? null : actionObjectFacade.WrappedAdapter();
            IActionSpec targetActionContextAction = targetActionFacade == null ? null : targetActionFacade.WrappedSpec();
            INakedObjectAdapter targetActionContextTarget = targetObjectFacade == null ? null : targetObjectFacade.WrappedAdapter();

            string contextActionName = actionContextAction == null ? "" : actionContextAction.Id + Sep;
            string contextNakedObjectId = actionContextTarget == null || actionContextTarget == targetActionContextTarget ? "" : GetObjectId(actionObjectFacade) + Sep;
            string propertyId = string.IsNullOrEmpty(propertyName) ? "" : NameUtils.CapitalizeName(propertyName) + Sep;
            return contextNakedObjectId + contextActionName + propertyId + GetObjectId(targetObjectFacade) + Sep + targetActionContextAction.Id;
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:11,代码来源:IdHelper.cs

示例3: GetAggregateFieldInputId

        public string GetAggregateFieldInputId(IObjectFacade objectFacade, IAssociationFacade propertyFacade) {
            string fieldId;
            INakedObjectAdapter nakedObject = objectFacade.WrappedAdapter();

            var aoid = nakedObject.Oid as IAggregateOid;
            if (aoid != null) {
                IAssociationSpec parent = ((IObjectSpec) aoid.ParentOid.Spec).Properties.SingleOrDefault(p => p.Id == aoid.FieldName);           
                fieldId = parent.Id + Sep + GetObjectId(objectFacade) + Sep + propertyFacade.Id + Sep + InputOrSelect(propertyFacade.WrappedSpec().ReturnSpec);
            }
            else {
                fieldId = GetFieldInputId(objectFacade, propertyFacade);
            }
            return fieldId;
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:14,代码来源:IdHelper.cs

示例4: GetServiceLabel

        public string GetServiceLabel(IObjectFacade objectFacade) {
            INakedObjectAdapter nakedObject = objectFacade.WrappedAdapter();

            return nakedObject.TitleString();
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:5,代码来源:IdHelper.cs

示例5: GetGenericActionId

        public string GetGenericActionId(IObjectFacade objectFacade, string type) {
            INakedObjectAdapter owner = objectFacade.WrappedAdapter();

            return IdConstants.ActionName + Sep + owner.Spec.ShortName + Sep + type;
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:5,代码来源:IdHelper.cs

示例6: GetCollectionContainerId

        public string GetCollectionContainerId(IObjectFacade collectionFacade) {
            INakedObjectAdapter collection = collectionFacade.WrappedAdapter();

            return IdConstants.CollContainerName + Sep + collection.Spec.ShortName;
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:5,代码来源:IdHelper.cs

示例7: GetSubMenuId

 public string GetSubMenuId(IObjectFacade owner, IObjectFacade serviceFacade) {
     INakedObjectAdapter service = serviceFacade.WrappedAdapter();
     return EnsureEndsWithColon(GetObjectId(owner) + Sep + service.Spec.ShortName);
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:4,代码来源:IdHelper.cs

示例8: IsSetToImplicitDefault

        public bool IsSetToImplicitDefault(IObjectFacade objectFacade) {
            // return true if it's scalar and and still set to its implicit default value (eg 0 for an int)
            if (!DefaultTypeIsExplicit(objectFacade) && WrappedSpec.ReturnSpec.IsParseable) {
                var dflt = WrappedSpec.GetDefault(objectFacade.WrappedAdapter());
                var currentValue = GetValue(objectFacade);

                return dflt?.Object == currentValue?.Object;

            }

            return false;
        }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:12,代码来源:AssociationFacade.cs


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