本文整理汇总了C#中FlexWiki.Federation.EnableCaching方法的典型用法代码示例。如果您正苦于以下问题:C# Federation.EnableCaching方法的具体用法?C# Federation.EnableCaching怎么用?C# Federation.EnableCaching使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlexWiki.Federation
的用法示例。
在下文中一共展示了Federation.EnableCaching方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
if (args.Length < 1)
{
Usage();
return;
}
string fsPath = args[0];
string topic = null;
if (args.Length > 1)
topic = args[1];
LinkMaker lm = new LinkMaker("http://dummy");
Federation fed = new Federation(fsPath, OutputFormat.HTML, lm);
fed.EnableCaching();
if (topic != null)
Print(fed, new AbsoluteTopicName(topic));
else
{
int max = 10;
foreach (AbsoluteTopicName top in fed.DefaultContentBase.AllTopics(false))
{
Print(fed, top);
if (max-- <= 0)
break;
}
}
}
示例2: EstablishFederation
void EstablishFederation()
{
if (TheFederation != null)
{
// If we have one, just make sure it's valid
TheFederation.Validate();
return;
}
// nope - need a new one
string federationNamespaceMap = FederationNamespaceMapPath;
if (federationNamespaceMap == null)
throw new Exception("No namespace map file defined. Please set the FederationNamespaceMapFile key in <appSettings> in web.config to point to a namespace map file.");
string fsPath = MapPath(federationNamespaceMap);
Federation fed = new Federation(fsPath, OutputFormat.HTML, TheLinkMaker);
fed.EnableCaching(CacheManager); // Give the federation a cache to work with
SetFederation(fed);
// Setup event monitoring
SetupUpdateMonitoring();
}