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; } } }
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(); }