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


C# XUri.WithoutQuery方法代码示例

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


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

示例1: DreamCookie

        private DreamCookie(string name, string value, XUri uri, DateTime expires, int version, bool secure, bool discard, string comment, XUri commentUri, bool httpOnly, bool skipContextDiscovery)
        {
            if(string.IsNullOrEmpty(name)) {
                throw new ArgumentException("Name cannot be empty");
            }
            _name = name;
            _value = value;
            if(uri != null) {
                _uri = uri.WithoutQuery().WithoutCredentials().WithoutFragment().AsLocalUri();
                if(!skipContextDiscovery) {
                    DreamContext dc = DreamContext.CurrentOrNull;
                    if(dc != null) {
                        _publicUri = dc.PublicUri;
                        _localMachineUri = dc.Env.LocalMachineUri;
                    }
                }
            }

            // auto-convert very old expiration dates to max since they are most likely bogus
            if(expires.Year < 2000) {
                expires = DateTime.MaxValue;
            }
            if(expires != DateTime.MaxValue) {
                expires = expires.ToUniversalTime();

                // need to trim milliseconds of the passed in date
                expires = new DateTime(expires.Year, expires.Month, expires.Day, expires.Hour, expires.Minute, expires.Second, 0, DateTimeKind.Utc).ToUniversalTime();
            }

            // initialize cookie
            _expires = expires;
            _version = version;
            _secure = secure;
            _discard = discard;
            _comment = comment;
            _commentUri = commentUri;
            _httpOnly = httpOnly;
        }
开发者ID:sdether,项目名称:DReAM,代码行数:38,代码来源:DreamCookie.cs

示例2: Queue

        private void Queue(DateTime eventTime, XUri channel, XUri resource, string[] origin, XDoc doc) {
            doc.Attr("wikiid", _wikiid).Attr("event-time", eventTime);
            var data = new ChangeData();
            data.Channel = channel;
            data.Resource = resource == null ? null : resource.WithoutQuery().WithoutFragment();
            data.Origin = origin;
            data.Doc = doc;

            if(!_changeQueue.TryEnqueue(data)) {
                _log.WarnFormat("unable to enqueue change data into processing queue");
            }
        }
开发者ID:StackableRegiments,项目名称:metl2011,代码行数:12,代码来源:DekiChangeSink.cs


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