• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IOidStrategy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Create

        public static MapRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, ContextFacade contextFacade, IList<ContextFacade> contexts, Format format, RestControlFlags flags, MediaTypeHeaderValue mt) {
            var memberValues = contexts.Select(c => new OptionalProperty(c.Id, GetMap(oidStrategy, req, c, flags))).ToList();
            IObjectFacade target = contexts.First().Target;
            MapRepresentation mapRepresentation;

            if (format == Format.Full) {
                var tempProperties = new List<OptionalProperty>();

                if (!string.IsNullOrEmpty(contextFacade?.Reason)) {
                    tempProperties.Add(new OptionalProperty(JsonPropertyNames.XRoInvalidReason, contextFacade.Reason));
                }

                var dt = new OptionalProperty(JsonPropertyNames.DomainType, target.Specification.DomainTypeName(oidStrategy));
                tempProperties.Add(dt);

                var members = new OptionalProperty(JsonPropertyNames.Members, Create(memberValues.ToArray()));
                tempProperties.Add(members);
                mapRepresentation = Create(tempProperties.ToArray());
            }
            else {
                mapRepresentation = Create(memberValues.ToArray());
            }

            mapRepresentation.SetContentType(mt);

            return mapRepresentation;
        }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:27,代码来源:ArgumentsRepresentation.cs


示例2: UriMtHelper

 public UriMtHelper(IOidStrategy oidStrategy, HttpRequestMessage req, IObjectFacade objectFacade) : this(oidStrategy ,req) {
     this.objectFacade = objectFacade;
     spec = objectFacade.Specification;
     IOidTranslation oid = oidStrategy.FrameworkFacade.OidTranslator.GetOidTranslation(objectFacade);
     cachedId = oid.InstanceId;
     CachedType = oid.DomainType;
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:UriMtHelper.cs


示例3: Create

        public static MapRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, IList<ContextFacade> contexts, Format format, RestControlFlags flags, MediaTypeHeaderValue mt) {
            OptionalProperty[] memberValues = contexts.Select(c => new OptionalProperty(c.Id, GetMap(oidStrategy ,req, c, flags))).ToArray();
            IObjectFacade target = contexts.First().Target;
            MapRepresentation mapRepresentation;

            if (format == Format.Full) {
                var tempProperties = new List<OptionalProperty>();

                if (flags.SimpleDomainModel) {
                    var dt = new OptionalProperty(JsonPropertyNames.DomainType, target.Specification.DomainTypeName(oidStrategy));
                    tempProperties.Add(dt);
                }

                if (flags.FormalDomainModel) {
                    var links = new OptionalProperty(JsonPropertyNames.Links, new[] {
                        Create(new OptionalProperty(JsonPropertyNames.Rel, RelValues.DescribedBy),
                            new OptionalProperty(JsonPropertyNames.Href, new UriMtHelper(oidStrategy, req, target.Specification).GetDomainTypeUri()))
                    });
                    tempProperties.Add(links);
                }

                var members = new OptionalProperty(JsonPropertyNames.Members, Create(memberValues));
                tempProperties.Add(members);
                mapRepresentation = Create(tempProperties.ToArray());
            }
            else {
                mapRepresentation = Create(memberValues);
            }

            mapRepresentation.SetContentType(mt);

            return mapRepresentation;
        }
开发者ID:priaonehaha,项目名称:NakedObjectsFramework,代码行数:33,代码来源:ArgumentsRepresentation.cs


示例4: RestSnapshot

 public RestSnapshot(IOidStrategy oidStrategy, MenuContextFacade menus, HttpRequestMessage req, RestControlFlags flags)
     : this(oidStrategy, req, true) {
     populator = () => {
         Representation = ListRepresentation.Create(oidStrategy, menus, req, flags);
         SetHeaders();
     };
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:7,代码来源:RestSnapshot.cs


示例5: ActionRepresentationStrategy

 public ActionRepresentationStrategy(IOidStrategy oidStrategy, HttpRequestMessage req, ActionContextFacade actionContext, RestControlFlags flags)
     : base(oidStrategy, flags) {
     this.req = req;
     this.actionContext = actionContext;
     self = new MemberRelType(RelValues.Self, new UriMtHelper(oidStrategy, req, actionContext));
     parameterList = GetParameterList();
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:ActionRepresentationStrategy.cs


示例6: AttachmentRepresentation

 public AttachmentRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyContextFacade propertyContext, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SetContentType(propertyContext);
     SetContentDisposition(propertyContext);
     SetStream(propertyContext);
     SetHeader(propertyContext.Target);
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:7,代码来源:AttachmentRepresentation.cs


示例7: ParameterRepresentation

 protected ParameterRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, IObjectFacade objectFacade, IActionParameterFacade parameter, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SetName(parameter);
     SetExtensions(req, objectFacade, parameter, flags);
     SetLinks(req, objectFacade, parameter);
     SetHeader(objectFacade);
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:ParameterRepresentation.cs


示例8: HomePageRepresentation

 protected HomePageRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SelfRelType = new HomePageRelType(RelValues.Self, new UriMtHelper(oidStrategy, req));
     SetLinks(req);
     SetExtensions();
     SetHeader();
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:7,代码来源:HomePageRepresentation.cs


示例9: Create

        public static InlineCollectionRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyContextFacade propertyContext, IList<OptionalProperty> optionals, RestControlFlags flags, bool asTableColumn) {
            var collectionRepresentationStrategy = AbstractCollectionRepresentationStrategy.GetStrategy(asTableColumn, true, oidStrategy, req, propertyContext, flags);

            int? size = collectionRepresentationStrategy.GetSize();

            if (size != null) {
                optionals.Add(new OptionalProperty(JsonPropertyNames.Size, size));
            }

            var value = collectionRepresentationStrategy.GetValue();

            if (value != null) {
                optionals.Add(new OptionalProperty(JsonPropertyNames.Value, value));
            }


            var actions = collectionRepresentationStrategy.GetActions();

            if (actions.Length > 0) {
                var members = RestUtils.CreateMap(actions.ToDictionary(m => m.Id, m => (object)m));
                optionals.Add(new OptionalProperty(JsonPropertyNames.Members, members));
            }


            if (optionals.Count == 0) {
                return new InlineCollectionRepresentation(oidStrategy, collectionRepresentationStrategy);
            }
            return CreateWithOptionals<InlineCollectionRepresentation>(new object[] {oidStrategy, collectionRepresentationStrategy}, optionals);
        }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:29,代码来源:InlineCollectionRepresentation.cs


示例10: MemberRepresentationStrategy

 protected MemberRepresentationStrategy(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyContextFacade propertyContext, RestControlFlags flags)
     : base(oidStrategy ,flags) {
     this.req = req;
     this.propertyContext = propertyContext;
     objectUri = new UriMtHelper(oidStrategy ,req, propertyContext);
     self = new MemberRelType(RelValues.Self, new UriMtHelper(oidStrategy , req, propertyContext));
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:MemberRepresentationStrategy.cs


示例11: Create

 public static InlinePropertyRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyContextFacade propertyContext, IList<OptionalProperty> optionals, RestControlFlags flags) {
     if (!RestUtils.IsBlobOrClob(propertyContext.Specification) && !RestUtils.IsAttachment(propertyContext.Specification)) {
         optionals.Add(new OptionalProperty(JsonPropertyNames.Value, GetPropertyValue(oidStrategy ,req, propertyContext.Property, propertyContext.Target, flags)));
     }
     RestUtils.AddChoices(oidStrategy , req, propertyContext, optionals, flags);
     return CreateWithOptionals<InlinePropertyRepresentation>(new object[] {oidStrategy, new PropertyRepresentationStrategy(oidStrategy ,req, propertyContext, flags)}, optionals);
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:InlinePropertyRepresentation.cs


示例12: MemberTypeRepresentation

 protected MemberTypeRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyTypeContextFacade propertyContext, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SetScalars(propertyContext);
     SelfRelType = new TypeMemberRelType(RelValues.Self, new UriMtHelper(oidStrategy, req, propertyContext));
     SetExtensions();
     SetHeader();
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:MemberTypeRepresentation.cs


示例13: Create

 public static InlineCollectionRepresentation Create(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyContextFacade propertyContext, IList<OptionalProperty> optionals, RestControlFlags flags) {
     var collectionRepresentationStrategy = new CollectionRepresentationStrategy(oidStrategy, req, propertyContext, flags);
     if (optionals.Count == 0) {
         return new InlineCollectionRepresentation(oidStrategy, collectionRepresentationStrategy);
     }
     return CreateWithOptionals<InlineCollectionRepresentation>(new object[] {oidStrategy, collectionRepresentationStrategy}, optionals);
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:InlineCollectionRepresentation.cs


示例14: TypeActionInvokeRepresentation

 protected TypeActionInvokeRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, TypeActionInvokeContext context, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SelfRelType = new TypeActionInvokeRelType(RelValues.Self, new UriMtHelper(oidStrategy, req, context));
     SetScalars(context);
     SetLinks(req, context);
     SetExtensions();
     SetHeader();
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:TypeActionInvokeRepresentation.cs


示例15: UserRepresentation

 private UserRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, IPrincipal user, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SelfRelType = new UserRelType(RelValues.Self, new UriMtHelper(oidStrategy, req));
     SetLinks(new HomePageRelType(RelValues.Up, new UriMtHelper(oidStrategy, req)));
     SetScalars(user);
     SetExtensions();
     SetHeader();
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:8,代码来源:UserRepresentation.cs


示例16: ListRepresentation

 protected ListRepresentation(IOidStrategy oidStrategy, IMenuFacade[] menus, HttpRequestMessage req, RestControlFlags flags)
     : base(oidStrategy, flags) {
     Value = menus.Select(c => CreateMenuLink(oidStrategy, req, c)).ToArray();
     SelfRelType = new ListRelType(RelValues.Self, SegmentValues.Services, new UriMtHelper(oidStrategy, req));
     SetLinks(req);
     SetExtensions();
     SetHeader(true);
 }
开发者ID:priaonehaha,项目名称:NakedObjectsFramework,代码行数:8,代码来源:ListRepresentation.cs


示例17: ActionResultRepresentation

 protected ActionResultRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, ActionResultContextFacade actionResult, RestControlFlags flags)
     : base(oidStrategy, flags) {
     SelfRelType = new ActionResultRelType(RelValues.Self, new UriMtHelper(OidStrategy, req, actionResult.ActionContext));
     SetResultType(actionResult);
     SetLinks(req, actionResult);
     SetExtensions();
     SetHeader();
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:ActionResultRepresentation.cs


示例18: MemberAbstractRepresentation

 protected MemberAbstractRepresentation(IOidStrategy oidStrategy, MemberRepresentationStrategy strategy)
     : base(oidStrategy ,strategy.GetFlags()) {
     SelfRelType = strategy.GetSelf();
     Id = strategy.GetId();
     Links = strategy.GetLinks(false);
     Extensions = strategy.GetExtensions();
     SetHeader(strategy.GetTarget());
 }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:MemberAbstractRepresentation.cs


示例19: InlinePropertyRepresentation

 protected InlinePropertyRepresentation(IOidStrategy oidStrategy, AbstractPropertyRepresentationStrategy strategy)
     : base(oidStrategy, strategy.GetFlags()) {
     MemberType = MemberTypes.Property;
     Id = strategy.GetId();
     Links = strategy.GetLinks();
     Extensions = strategy.GetExtensions();
     SetHeader(strategy.GetTarget());
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:8,代码来源:InlinePropertyRepresentation.cs


示例20: RestSnapshot

 public RestSnapshot(IOidStrategy oidStrategy, PropertyContextFacade propertyContext, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags)
     : this(oidStrategy,req, true) {
     logger.DebugFormat("RestSnapshot:propertyprompt");
     populator = () => {
         representation = PromptRepresentation.Create(oidStrategy ,propertyContext, listContext, req, flags);
         SetHeaders();
     };
 }
开发者ID:czcz1024,项目名称:NakedObjectsFramework,代码行数:8,代码来源:RestSnapshot.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IOjsData类代码示例发布时间:2022-05-24
下一篇:
C# IOffsetAttribute类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap