本文整理汇总了C#中NamespaceManager.GetProvider方法的典型用法代码示例。如果您正苦于以下问题:C# NamespaceManager.GetProvider方法的具体用法?C# NamespaceManager.GetProvider怎么用?C# NamespaceManager.GetProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NamespaceManager
的用法示例。
在下文中一共展示了NamespaceManager.GetProvider方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
MockWikiApplication application = new MockWikiApplication(new FederationConfiguration(),
new LinkMaker("test://FileSystemStoreTests/"), OutputFormat.HTML,
new MockTimeProvider(TimeSpan.FromSeconds(1)));
federation = new Federation(application);
_fileSystem = new MockFileSystem(
new MockDirectory(@"C:\",
new MockDirectory("flexwiki",
new MockDirectory("namespaces",
new MockDirectory("namespaceone",
new MockFile(@"TopicOne.wiki", new DateTime(2004, 10, 28), @"This is some content"),
new MockFile(@"TopicTwo.wiki", new DateTime(2004, 10, 29), @"This is some other content"),
new MockFile(@"MULTIcapsGoodTopic.wiki",
new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadOnly, true),
new MockFile(@"HomePage.wiki", new DateTime(2004, 10, 30), @"Home page."),
new MockFile(@"HomePage(2003-11-24-20-31-20-WINGROUP-davidorn).awiki",
new DateTime(2004, 10, 31), @"Old home page."),
new MockFile(@"CodeImprovementIdeas.wiki", new DateTime(2004, 11, 10), @"Latest"),
new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-03-127.0.0.1).awiki",
new DateTime(2004, 11, 09), @"Latest"),
new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-04.8890-127.0.0.1).awiki",
new DateTime(2004, 11, 08), @"Older"),
new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-05.1000-127.0.0.1).awiki",
new DateTime(2004, 11, 07), @"Still older"),
new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-06.1-127.0.0.1).awiki",
new DateTime(2004, 11, 06), @"Even older"),
new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-07-Name).awiki",
new DateTime(2004, 11, 05), @"Really old"),
new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-08.123-Name).awiki",
new DateTime(2004, 11, 04), @"Oldest"),
new MockFile(@"TestDeleteHistory.wiki", new DateTime(2004, 11, 10), @"Latest"),
new MockFile(@"TestDeleteHistory(2003-11-23-14-34-03-127.0.0.1).awiki",
new DateTime(2004, 11, 09), @"Latest"),
new MockFile(@"TestDeleteHistory(2003-11-23-14-34-04.8890-127.0.0.1).awiki",
new DateTime(2004, 11, 08), @"Older"),
new MockFile(@"TestDeleteHistory(2003-11-23-14-34-05.1000-127.0.0.1).awiki",
new DateTime(2004, 11, 07), @"Still older"),
new MockFile(@"TestDeleteHistory(2003-11-23-14-34-06.1-127.0.0.1).awiki",
new DateTime(2004, 11, 06), @"Even older"),
new MockFile(@"TestDeleteHistory(2003-11-23-14-34-07-Name).awiki",
new DateTime(2004, 11, 05), @"Really old"),
new MockFile(@"TestDeleteHistory(2003-11-23-14-34-08.123-Name).awiki",
new DateTime(2004, 11, 04), @"Oldest"),
new MockFile(@"ReadOnlyTopic.wiki",
new DateTime(2004, 11, 05), @"", MockTopicStorePermissions.ReadOnly),
new MockFile(@"ReadOnlyTopic(2004-11-05-00-00-00-Name).awiki",
new DateTime(2004, 11, 05), @""),
new MockFile(@"ReadOnlyTopic2.wiki",
new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadOnly, true),
new MockFile(@"ReadWriteTopic.wiki",
new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadWrite, false),
new MockFile(@"DeletedTopic(2004-11-11-00-00-00-Name).awiki",
new DateTime(2004, 11, 11), @"This topic was deleted.")
)
)
)
)
);
federation.RegisterNamespace(new FileSystemStore(_fileSystem), "NamespaceOne",
new NamespaceProviderParameterCollection(
new NamespaceProviderParameter("Root", Root)));
// Necessary to bypass security because a non-existent manager can't be
// retrieved directly from the federation
manager = WikiTestUtilities.GetNamespaceManagerBypassingSecurity(federation, "NamespaceOne");
_provider = (FileSystemStore)manager.GetProvider(typeof(FileSystemStore));
IMockWikiApplication setApp = (IMockWikiApplication)Federation.Application;
setApp.SetApplicationProperty("DisableNewParser", false);
setApp.SetApplicationProperty("EnableNewParser", true);
parser = new ParserEngine(federation);
//Necessary to init WikiInputDocument for all WomDocument tests
//inputDoc = parser.InitWikiDocument(Path.Combine(mockapp.WebPath, @"InputDocs/AstralisLux.wiki"));
}
示例2: GetSecurityProvider
private static AuthorizationProvider GetSecurityProvider(NamespaceManager manager)
{
return (AuthorizationProvider)manager.GetProvider(typeof(AuthorizationProvider));
}