本文整理汇总了C#中IFileSystem.GetDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# IFileSystem.GetDirectory方法的具体用法?C# IFileSystem.GetDirectory怎么用?C# IFileSystem.GetDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem.GetDirectory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EpisodeProcessor
public EpisodeProcessor(EpisodeProcessorSettings settings, ITvService tvService, IFileSystem fileSystem, IAnalyticsService analyticsService)
{
_settings = settings;
_tvService = tvService;
_fileSystem = fileSystem;
_analyticsService = analyticsService;
_sourceFolder = _fileSystem.GetDirectory(_settings.DownloadFolder);
_destinationFolder = _fileSystem.GetDirectory(_settings.TvLibraryFolder);
}
示例2: AvatarService
public AvatarService(IPathResolver pathResolver, IFileSystem fileSystemProvider)
{
_pathResolver = pathResolver;
_fileSystemProvider = fileSystemProvider;
_avatarDirectoryInfo = _fileSystemProvider.GetDirectory("avatars");
if (!_avatarDirectoryInfo.Exists)
_avatarDirectoryInfo.Create();
}
示例3: ReSharperLoaderPlugin
public ReSharperLoaderPlugin(IFileSystem fileSystem)
{
_fileSystem = fileSystem;
_rootAssemblyCacheDir = _fileSystem.GetDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
.GetDirectory("openwrap")
.GetDirectory("VisualStudio")
.GetDirectory("AssemblyCache")
.MustExist();
var vsAppDomain = AppDomain.CurrentDomain.GetData("openwrap.vs.appdomain") as AppDomain;
_output = new OpenWrapOutput();
if (vsAppDomain == null) return;
DetectResharperLoading(vsAppDomain);
}
示例4: OnInit
protected override void OnInit(EventArgs e)
{
FS = Engine.Resolve<IFileSystem>();
Config = Engine.Resolve<ConfigurationManagerWrapper>().Sections.Management;
Register.JQueryUi(Page);
var selected = Selection.SelectedItem;
if (IsPostBack && !string.IsNullOrEmpty(inputFile.PostedFile.FileName))
{
string uploadFolder = Request["inputLocation"];
if(!IsAvailable(uploadFolder))
throw new N2Exception("Cannot upload to " + Server.HtmlEncode(uploadFolder));
string fileName = System.IO.Path.GetFileName(inputFile.PostedFile.FileName);
string filePath = Url.Combine(uploadFolder, fileName);
FS.WriteFile(filePath, inputFile.PostedFile.InputStream);
ClientScript.RegisterStartupScript(typeof(Tree), "select", "updateOpenerWithUrlAndClose('" + ResolveUrl(filePath) + "');", true);
}
else if (Request["location"] == "files" || Request["location"] == "filesselection")
{
IHost host = Engine.Resolve<IHost>();
HierarchyNode<ContentItem> root = new HierarchyNode<ContentItem>(Engine.Persister.Get(host.DefaultSite.RootItemID));
var selectionTrail = new List<ContentItem>();
if (selected is AbstractNode)
{
selectionTrail = new List<ContentItem>(Find.EnumerateParents(selected, null, true));
}
else
{
TrySelectingPrevious(ref selected, ref selectionTrail);
}
foreach (string uploadFolder in Engine.EditManager.UploadFolders)
{
var dd = FS.GetDirectory(uploadFolder);
var dir = Directory.New(dd, root.Current, FS, Engine.Resolve<ImageSizeCache>());
var node = CreateDirectoryNode(FS, dir, root, selectionTrail);
root.Children.Add(node);
}
AddSiteFilesNodes(root, host.DefaultSite, selectionTrail);
foreach (var site in host.Sites)
{
if (site.StartPageID == host.DefaultSite.StartPageID)
continue;
AddSiteFilesNodes(root, site, selectionTrail);
}
siteTreeView.Nodes = root;
siteTreeView.SelectedItem = selected;
}
else
{
var filter = Engine.EditManager.GetEditorFilter(Page.User);
siteTreeView.Filter = filter;
siteTreeView.RootNode = Engine.Resolve<Navigator>().Navigate(Request["root"] ?? "/");
siteTreeView.SelectedItem = selected;
}
siteTreeView.SelectableTypes = Request["selectableTypes"];
siteTreeView.SelectableExtensions = Request["selectableExtensions"];
siteTreeView.DataBind();
base.OnInit(e);
}
示例5: PostThumbnailService
public PostThumbnailService(IFileSystem fileSystem)
{
_thumbnailDirectory = fileSystem.GetDirectory("post-thumbs");
if (!_thumbnailDirectory.Exists)
_thumbnailDirectory.Create();
}