本文整理汇总了C#中SafeDictionary.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# SafeDictionary.AddRange方法的具体用法?C# SafeDictionary.AddRange怎么用?C# SafeDictionary.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SafeDictionary
的用法示例。
在下文中一共展示了SafeDictionary.AddRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public override Sitecore.Xml.Xsl.RenderFieldResult Render()
{
string str8;
SafeDictionary<string> dictionary = new SafeDictionary<string>();
dictionary.AddRange(this.Parameters);
if (MainUtil.GetBool(dictionary["endlink"], false))
{
return RenderFieldResult.EndLink;
}
Set<string> set = Set<string>.Create(new string[] { "field", "select", "text", "haschildren", "before", "after", "enclosingtag", "fieldname" });
Sitecore.Data.Fields.LinkField linkField = this.LinkField;
if (linkField != null)
{
dictionary["title"] = StringUtil.GetString(new string[] { dictionary["title"], linkField.Title });
dictionary["target"] = StringUtil.GetString(new string[] { dictionary["target"], linkField.Target });
if (_includeContentEditorCss)
{
_css += (string.IsNullOrWhiteSpace(_css) ? string.Empty : " ") + linkField.Class;
}
}
string str = string.Empty;
string rawParameters = this.RawParameters;
if (!string.IsNullOrEmpty(rawParameters) && (rawParameters.IndexOfAny(this._delimiter) < 0))
{
str = rawParameters;
}
if (string.IsNullOrEmpty(str))
{
Item targetItem = this.TargetItem;
string str3 = (targetItem != null) ? targetItem.DisplayName : string.Empty;
string str4 = (linkField != null) ? linkField.Text : string.Empty;
str = StringUtil.GetString(new string[] { str, dictionary["text"], str4, str3 });
}
string url = this.GetUrl(linkField);
if (((str8 = this.LinkType) != null) && (str8 == "javascript"))
{
dictionary["href"] = "#";
dictionary["onclick"] = StringUtil.GetString(new string[] { dictionary["onclick"], url });
}
else
{
dictionary["href"] = HttpUtility.HtmlEncode(StringUtil.GetString(new string[] { dictionary["href"], url }));
}
StringBuilder tag = new StringBuilder("<a", 0x2f);
foreach (KeyValuePair<string, string> pair in dictionary)
{
string key = pair.Key;
string str7 = pair.Value;
if (!set.Contains(key.ToLowerInvariant()))
{
FieldRendererBase.AddAttribute(tag, key, str7);
}
}
if (!string.IsNullOrWhiteSpace(_css))
{
FieldRendererBase.AddAttribute(tag, "class", _css);
}
tag.Append('>');
if (!MainUtil.GetBool(dictionary["haschildren"], false))
{
if (!string.IsNullOrEmpty(_innerHTML))
{
tag.Append(_innerHTML);
}
else if (!string.IsNullOrEmpty(str))
{
tag.Append(str);
}
else if (_displayHrefByDefault)
{
tag.Append(dictionary["href"]);
}
else
{
return RenderFieldResult.Empty;
}
}
return new RenderFieldResult { FirstPart = tag.ToString(), LastPart = "</a>" };
}