本文整理汇总了C#中FlexWiki.AbsoluteTopicName.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AbsoluteTopicName.ToString方法的具体用法?C# AbsoluteTopicName.ToString怎么用?C# AbsoluteTopicName.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlexWiki.AbsoluteTopicName
的用法示例。
在下文中一共展示了AbsoluteTopicName.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RestorePreviousVersion
/// <summary>
/// Restores the passed in Topic version as the current version
/// </summary>
/// <param name="topic">Topic Version to Restore</param>
/// <returns></returns>
protected TopicName RestorePreviousVersion(AbsoluteTopicName topic)
{
LogEvent e = TheFederation.LogEventFactory.CreateAndStartEvent(Request.UserHostAddress, VisitorIdentityString, topic.ToString(), LogEvent.LogEventType.WriteTopic);
try
{
AbsoluteTopicName newVersionName = new AbsoluteTopicName(topic.Name, topic.Namespace);
newVersionName.Version = TopicName.NewVersionStringForUser(VisitorIdentityString);
ContentBase cb = TheFederation.ContentBaseForNamespace(topic.Namespace);
cb.WriteTopicAndNewVersion(newVersionName.LocalName, TheFederation.Read(topic));
}
finally
{
e.Record();
}
return new AbsoluteTopicName(topic.Name, topic.Namespace);
}
示例2: BorderText
/// <summary>
/// Answer a list of the wikitext components (IBELObjects) of the given border. If nothing specifies any border; answer the system default
/// </summary>
/// <param name="name"></param>
/// <param name="border"></param>
/// <param name="rule"></param>
/// <returns></returns>
private IEnumerable BorderText(AbsoluteTopicName name, Border border, CompositeCacheRule rule)
{
ArrayList answer = new ArrayList();
ContentBase cb;
string bordersTopicsProperty = "Borders";
ArrayList borderTopics = new ArrayList();
// Start with whatever the namespace defines
if (Borders != null)
{
foreach (string at in ParseListPropertyValue(Borders))
{
AbsoluteTopicName abs = new AbsoluteTopicName(at);
cb = ContentBaseForTopic(abs);
if (abs == null || cb == null)
{
throw new Exception("Unknown namespace listed in border topic (" + at +") listed in federation configuration Borders property.");
}
borderTopics.Add(at);
}
}
// If the namespace, specifies border topics, get them
cb = ContentBaseForTopic(name);
if (cb != null)
{
borderTopics.AddRange(GetTopicListPropertyValue(cb.DefinitionTopicName, bordersTopicsProperty));
rule.Add(cb.CacheRuleForAllPossibleInstancesOfTopic(cb.DefinitionTopicName));
}
// If there are no border topics specified for the federation or the namespace, add the default (_NormalBorders from the local namespace)
if (borderTopics.Count == 0)
{
borderTopics.Add("_NormalBorders");
}
// Finally, any border elements form the topic itself (skip the def topic so we don't get double borders!)
if (cb == null || cb.DefinitionTopicName.ToString() != name.ToString())
{
borderTopics.AddRange(GetTopicListPropertyValue(name, bordersTopicsProperty));
}
Set done = new Set();
foreach (string borderTopicName in borderTopics)
{
// Figure out what the absolute topic name is that we're going to get this topic from
RelativeTopicName rel = new RelativeTopicName(borderTopicName);
if (rel.Namespace == null)
{
rel.Namespace = name.Namespace;
}
AbsoluteTopicName abs = new AbsoluteTopicName(rel.Name, rel.Namespace);
if (done.Contains(abs))
{
continue;
}
done.Add(abs);
IBELObject s = BorderPropertyFromTopic(name, abs, border, rule);
if (s != null)
{
answer.Add(s);
}
}
return answer;
}