本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: GetServiceLabel
public string GetServiceLabel(IObjectFacade objectFacade) {
INakedObjectAdapter nakedObject = objectFacade.WrappedAdapter();
return nakedObject.TitleString();
}
示例5: GetGenericActionId
public string GetGenericActionId(IObjectFacade objectFacade, string type) {
INakedObjectAdapter owner = objectFacade.WrappedAdapter();
return IdConstants.ActionName + Sep + owner.Spec.ShortName + Sep + type;
}
示例6: GetCollectionContainerId
public string GetCollectionContainerId(IObjectFacade collectionFacade) {
INakedObjectAdapter collection = collectionFacade.WrappedAdapter();
return IdConstants.CollContainerName + Sep + collection.Spec.ShortName;
}
示例7: GetSubMenuId
public string GetSubMenuId(IObjectFacade owner, IObjectFacade serviceFacade) {
INakedObjectAdapter service = serviceFacade.WrappedAdapter();
return EnsureEndsWithColon(GetObjectId(owner) + Sep + service.Spec.ShortName);
}
示例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;
}