當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。