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


C# INakedObject.GetDomainObject方法代码示例

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


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

示例1: Reset

 public void Reset(INakedObject inObject) {
     try {
         var collection = (IList) property.GetValue(inObject.GetDomainObject(), null);
         collection.Clear();
         property.SetValue(inObject.GetDomainObject(), collection, null);
     }
     catch (Exception e) {
         throw new ReflectionException(string.Format("Failed to get/set property {0} in {1}", property.Name, inObject.Specification.FullName), e);
     }
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:10,代码来源:CollectionResetFacet.cs

示例2: SetProperty

 public override void SetProperty(INakedObject nakedObject, INakedObject value) {
     try {
         property.SetValue(nakedObject.GetDomainObject(), value.GetDomainObject(), null);
     }
     catch (TargetInvocationException e) {
         InvokeUtils.InvocationException("Exception executing " + property, e);
     }
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:8,代码来源:PropertySetterFacetViaSetterMethod.cs

示例3: GetProperty

 public override object GetProperty(INakedObject nakedObject) {
     try {
         return propertyMethod.GetValue(nakedObject.GetDomainObject(), null);
     }
     catch (TargetInvocationException e) {
         InvokeUtils.InvocationException("Exception executing " + propertyMethod, e);
         return null;
     }
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:9,代码来源:PropertyAccessorFacetViaAccessor.cs

示例4: Init

        public override void Init(INakedObject collection, INakedObject[] initData) {
            Array newCollection = Array.CreateInstance(collection.GetDomainObject().GetType().GetElementType(), initData.Length);
            collection.ReplacePoco(newCollection);

            int i = 0;
            foreach (INakedObject nakedObject in initData) {
                AsCollection(collection)[i++] = nakedObject.Object;
            }
        }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:9,代码来源:DotNetArrayFacet.cs

示例5: IsEditView

        public override bool IsEditView(INakedObject nakedObject) {
            var target = nakedObject.GetDomainObject<IViewModelSwitchable>();

            if (target != null) {
                return target.IsEditView();
            }

            throw new NakedObjectSystemException(nakedObject.Object == null ? "Null domain object" : "Wrong type of domain object: " + nakedObject.Object.GetType().FullName);
        }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:9,代码来源:ViewModelSwitchableFacetConvention.cs

示例6: Invoke

        public void Invoke(INakedObject nakedObject, INakedObject[] parameters, bool queryOnly, IIdentifier identifier) {
            Init();
            IAuditor auditor = GetNamespaceAuthorizerFor(nakedObject) ?? defaultAuditor;

            if (nakedObject.Specification.IsService) {
                string serviceName = nakedObject.Specification.GetTitle(nakedObject);
                auditor.ActionInvoked(NakedObjectsContext.Session.Principal, identifier.MemberName, serviceName, queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
            }
            else {
                auditor.ActionInvoked(NakedObjectsContext.Session.Principal, identifier.MemberName, nakedObject.GetDomainObject(), queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
            }
        }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:12,代码来源:AuditManager.cs

示例7: GetCompletions

 public override object[] GetCompletions(INakedObject inObject, string autoCompleteParm) {
     try {
         object autoComplete = InvokeUtils.Invoke(method, inObject.GetDomainObject(), new object[] {autoCompleteParm});
         if (autoComplete is IQueryable) {
             return ((IQueryable) autoComplete).Take(PageSize).ToArray();
         }
         throw new NakedObjectDomainException("Must return IQueryable from autoComplete method: " + method.Name);
     }
     catch (ArgumentException ae) {
         string msg = string.Format("autoComplete exception: {0} has mismatched parameter type - must be string", method.Name);
         throw new InvokeException(msg, ae);
     }
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:13,代码来源:AutoCompleteFacetViaMethod.cs

示例8: UnwrapString

 /// <summary>
 ///     For convenience of subclass facets that implement
 ///     <see cref="IValidatingInteractionAdvisor" />, <see cref="IHidingInteractionAdvisor" /> or
 ///     <see cref="IDisablingInteractionAdvisor" />
 /// </summary>
 protected internal virtual string UnwrapString(INakedObject nakedObject) {
     object obj = nakedObject.GetDomainObject();
     if (obj == null) {
         return null;
     }
     if (!(obj is string)) {
         return null;
     }
     return (string) obj;
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:15,代码来源:FacetAbstract.cs

示例9: Invoke

 public static object Invoke(MethodInfo method, INakedObject nakedObject) {
     var parameters = new object[method.GetParameters().Length];
     return Invoke(method, nakedObject.GetDomainObject(), parameters);
 }
开发者ID:,项目名称:,代码行数:4,代码来源:

示例10: Persisted

 public void Persisted(INakedObject nakedObject) {
     Init();
     IAuditor auditor = GetNamespaceAuthorizerFor(nakedObject) ?? defaultAuditor;
     auditor.ObjectPersisted(NakedObjectsContext.Session.Principal, nakedObject.GetDomainObject());
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:5,代码来源:AuditManager.cs

示例11: GetBooleanFieldValue

        private static string GetBooleanFieldValue(this HtmlHelper html, INakedObject valueNakedObject) {
            var state = valueNakedObject.GetDomainObject<bool?>();
            string src = "Images/unset.png";
            string alt = MvcUi.TriState_NotSet;

            if (state.HasValue) {
                if (state.Value) {
                    src = "Images/checked.png";
                    alt = MvcUi.TriState_True;
                }
                else {
                    src = "Images/unchecked.png";
                    alt = MvcUi.TriState_False;
                }
            }

            var tag = new TagBuilder("img");
            tag.MergeAttribute("src", src);
            tag.MergeAttribute("alt", alt);

            return tag.ToString();
        }
开发者ID:,项目名称:,代码行数:22,代码来源:


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