本文整理匯總了C#中System.Guid.session_TmUser方法的典型用法代碼示例。如果您正苦於以下問題:C# Guid.session_TmUser方法的具體用法?C# Guid.session_TmUser怎麽用?C# Guid.session_TmUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Guid
的用法示例。
在下文中一共展示了Guid.session_TmUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: getGuidanceItemHtml
public string getGuidanceItemHtml(Guid sessionId, Guid guidanceItemId)
{
if (Cached_GuidanceItems.hasKey(guidanceItemId).isFalse())
return null;
var article = Cached_GuidanceItems[guidanceItemId];
sessionId.session_TmUser().logUserActivity("View Article Html", article.Metadata.Title);
var articleContent = article.Content.Data.Value;
if (articleContent.inValid())
return "";
switch(article.Content.DataType.lower())
{
case "raw":
return articleContent;
case "html":
{
if (TMConfig.Current.TMSecurity.Sanitize_HtmlContent && article.Content.Sanitized.isFalse())
return articleContent.sanitizeHtmlContent();
return articleContent.fixXmlDoubleEncodingIssue();
}
case "safehtml":
{
return articleContent.sanitizeHtmlContent();
}
case "wikitext":
return "<div id ='tm_datatype_wikitext'>{0}</div>".format(articleContent);
default:
return articleContent;
}
}
示例2: login_Using_AuthToken
public static Guid login_Using_AuthToken(this TokenAuthentication tokenAuth , Guid token, Guid sessionID)
{
var tmUser = tokenAuth.tmUser_From_AuthToken(token);
if (tmUser.notNull())
{
if (sessionID.session_TmUser() == tmUser)
return sessionID; // the auth token matches the sssionId
return tmUser.login("AuthToken");
}
return Guid.Empty;
}
示例3: getGuidanceItemHtml
public static string getGuidanceItemHtml(this TM_Xml_Database tmDatabase, Guid sessionId, Guid guidanceItemId)
{
UserRole.ReadArticles.demand();
if (tmDatabase.Cached_GuidanceItems.hasKey(guidanceItemId).isFalse())
return null;
var article = tmDatabase.Cached_GuidanceItems[guidanceItemId];
sessionId.session_TmUser().logUserActivity("View Article Html", article.Metadata.Title);
var articleContent = article.Content.Data.Value;
if (articleContent.inValid())
return "";
switch (article.Content.DataType.lower())
{
case "raw":
return articleContent;
case "html":
{
if (TMConfig.Current.TMSecurity.Sanitize_HtmlContent && article.Content.Sanitized.isFalse())
return articleContent.sanitizeHtmlContent();
return articleContent.fixXmlDoubleEncodingIssue();
}
case "safehtml":
{
return articleContent.sanitizeHtmlContent();
}
case "wikitext":
return articleContent.wikiText_Transform();
//return "<div id ='tm_datatype_wikitext'>{0}</div>".format(articleContent.htmlEncode());
case "markdown":
return articleContent.markdown_Transform();
default:
return articleContent;
}
}