本文整理汇总了C#中IVirtualPathProvider.MapPath方法的典型用法代码示例。如果您正苦于以下问题:C# IVirtualPathProvider.MapPath方法的具体用法?C# IVirtualPathProvider.MapPath怎么用?C# IVirtualPathProvider.MapPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVirtualPathProvider
的用法示例。
在下文中一共展示了IVirtualPathProvider.MapPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoggingConfigurationResolve
public LoggingConfigurationResolve(ICacheManager cacheManager, IVirtualPathProvider virtualPathProvider)
{
_defaultConfigurationPath = virtualPathProvider.MapPath(@"~/Config/Logging/LoggingConfig.config");
_defaultLoggingConfigurationDocument = XDocument.Load(_defaultConfigurationPath);
_cacheManager = cacheManager;
}
示例2: ReadPackages
private void ReadPackages(IVirtualPathProvider vpp)
{
if (!ValidatePaths())
return;
lstPlugins.DisplayMember = "Name";
lstPlugins.ValueMember = "Path";
lstThemes.DisplayMember = "Name";
lstThemes.ValueMember = "Path";
lstPlugins.Items.Clear();
lstThemes.Items.Clear();
IEnumerable<string> dirs = Enumerable.Empty<string>();
if (vpp.DirectoryExists("~/Plugins") || vpp.DirectoryExists("~/Themes"))
{
if (vpp.DirectoryExists("~/Plugins"))
{
dirs = dirs.Concat(vpp.ListDirectories("~/Plugins"));
}
if (vpp.DirectoryExists("~/Themes"))
{
dirs = dirs.Concat(vpp.ListDirectories("~/Themes"));
}
}
else
{
dirs = vpp.ListDirectories("~/");
}
foreach (var dir in dirs)
{
bool isTheme = false;
// is it a plugin?
var filePath = vpp.Combine(dir, "Description.txt");
if (!vpp.FileExists(filePath))
{
// ...no! is it a theme?
filePath = vpp.Combine(dir, "theme.config");
if (!vpp.FileExists(filePath))
continue;
isTheme = true;
}
try
{
if (isTheme)
{
var manifest = ThemeManifest.Create(vpp.MapPath(dir));
lstThemes.Items.Add(new ExtensionInfo(dir, manifest.ThemeName));
}
else
{
var descriptor = PluginFileParser.ParsePluginDescriptionFile(vpp.MapPath(filePath));
if (descriptor != null)
{
lstPlugins.Items.Add(new ExtensionInfo(dir, descriptor.FolderName));
}
}
}
catch
{
continue;
}
}
if (lstPlugins.Items.Count > 0)
{
tabMain.SelectedIndex = 0;
}
else if (lstThemes.Items.Count > 0)
{
tabMain.SelectedIndex = 1;
}
}