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