本文整理汇总了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;
}
示例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");
}
}