当前位置: 首页>>代码示例>>C#>>正文


C# IFileSystem.GetDirectory方法代码示例

本文整理汇总了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);
        }
开发者ID:wamplerj,项目名称:TVTamer,代码行数:10,代码来源:EpisodeProcessor.cs

示例2: AvatarService

        public AvatarService(IPathResolver pathResolver, IFileSystem fileSystemProvider)
        {
            _pathResolver = pathResolver;
            _fileSystemProvider = fileSystemProvider;

            _avatarDirectoryInfo = _fileSystemProvider.GetDirectory("avatars");
            if (!_avatarDirectoryInfo.Exists)
                _avatarDirectoryInfo.Create();
        }
开发者ID:skimur,项目名称:skimur,代码行数:9,代码来源:AvatarService.cs

示例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);
        }
开发者ID:modulexcite,项目名称:openwrap,代码行数:15,代码来源:ResharperLoaderPlugin.cs

示例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);
        }
开发者ID:sale42,项目名称:n2cms,代码行数:68,代码来源:Tree.aspx.cs

示例5: PostThumbnailService

 public PostThumbnailService(IFileSystem fileSystem)
 {
     _thumbnailDirectory = fileSystem.GetDirectory("post-thumbs");
     if (!_thumbnailDirectory.Exists)
         _thumbnailDirectory.Create();
 }
开发者ID:skimur,项目名称:skimur,代码行数:6,代码来源:PostThumbnailService.cs


注:本文中的IFileSystem.GetDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。