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


C# IFileSystemProvider类代码示例

本文整理汇总了C#中IFileSystemProvider的典型用法代码示例。如果您正苦于以下问题:C# IFileSystemProvider类的具体用法?C# IFileSystemProvider怎么用?C# IFileSystemProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IFileSystemProvider类属于命名空间,在下文中一共展示了IFileSystemProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JsonLocalizerManager

 public JsonLocalizerManager(string paths, IFileSystemProvider fileProvider, IJsonSerializer serializer)
 {
     this.fileProvider = fileProvider;
     this.serializer = serializer;
     jsonResources = new List<JsonResource>();
     LoadResources(paths.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
 }
开发者ID:Caiqb-kooboo,项目名称:CBlog,代码行数:7,代码来源:JsonLocalizerManager.cs

示例2: VsSettings

        public VsSettings(ISolutionManager solutionManager, ISettings defaultSettings, IFileSystemProvider fileSystemProvider)
        {
            if (solutionManager == null)
            {
                throw new ArgumentNullException("solutionManager");
            }
            if (defaultSettings == null)
            {
                throw new ArgumentNullException("defaultSettings");
            }
            if (fileSystemProvider == null)
            {
                throw new ArgumentNullException("fileSystemProvider");
            }

            _solutionManager = solutionManager;
            _defaultSettings = defaultSettings;
            _fileSystemProvider = fileSystemProvider;

            EventHandler eventHandler = (src, eventArgs) =>
            {
                _solutionSettings = null;
            };
            _solutionManager.SolutionOpened += eventHandler;
            _solutionManager.SolutionClosed += eventHandler;
        }
开发者ID:monoman,项目名称:NugetCracker,代码行数:26,代码来源:VsSettings.cs

示例3: CreateProjectSystem

        public static IProjectSystem CreateProjectSystem(Project project, IFileSystemProvider fileSystemProvider)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            if (String.IsNullOrEmpty(project.FullName))
            {
                throw new InvalidOperationException(
                    String.Format(CultureInfo.CurrentCulture, VsResources.DTE_ProjectUnsupported, project.Name));
            }

            // Try to get a factory for the project type guid            
            foreach (var guid in project.GetProjectTypeGuids())
            {
                ProjectThunk factory;
                if (_factories.TryGetValue(guid, out factory))
                {
                    return factory(project, fileSystemProvider);
                }
            }

            // Fall back to the default if we have no special project types
            return new VsProjectSystem(project, fileSystemProvider);
        }
开发者ID:atheken,项目名称:nuget,代码行数:26,代码来源:VsProjectSystemFactory.cs

示例4: RepositorySettings

        public RepositorySettings(ISolutionManager solutionManager, IFileSystemProvider fileSystemProvider, IVsSourceControlTracker sourceControlTracker)
        {
            if (solutionManager == null)
            {
                throw new ArgumentNullException("solutionManager");
            }

            if (fileSystemProvider == null)
            {
                throw new ArgumentNullException("fileSystemProvider");
            }

            if (sourceControlTracker == null)
            {
                throw new ArgumentNullException("sourceControlTracker");
            }

            _solutionManager = solutionManager;
            _fileSystemProvider = fileSystemProvider;

            EventHandler resetConfiguration = (sender, e) =>
            {
                // Kill our configuration cache when someone closes the solution
                _configurationPath = null;
                _fileSystem = null;
            };

            _solutionManager.SolutionClosing += resetConfiguration;
            sourceControlTracker.SolutionBoundToSourceControl += resetConfiguration;
        }
开发者ID:xero-github,项目名称:Nuget,代码行数:30,代码来源:RepositorySettings.cs

示例5: RepositorySettings

 internal RepositorySettings(
     ISolutionManager solutionManager, 
     IFileSystemProvider fileSystemProvider, 
     IVsSourceControlTracker sourceControlTracker) : 
     this(solutionManager, fileSystemProvider, sourceControlTracker, machineWideSettings: null)
 {
 }
开发者ID:Newtopian,项目名称:nuget,代码行数:7,代码来源:RepositorySettings.cs

示例6: VsPackageManagerFactory

        public VsPackageManagerFactory(ISolutionManager solutionManager,
            IPackageRepositoryFactory repositoryFactory,
            IFileSystemProvider fileSystemProvider,
            IRepositorySettings repositorySettings,
            IRecentPackageRepository recentPackagesRepository)
        {
            if (solutionManager == null) {
                throw new ArgumentNullException("solutionManager");
            }
            if (repositoryFactory == null) {
                throw new ArgumentNullException("repositoryFactory");
            }
            if (fileSystemProvider == null) {
                throw new ArgumentNullException("fileSystemProvider");
            }
            if (repositorySettings == null) {
                throw new ArgumentNullException("repositorySettings");
            }

            _fileSystemProvider = fileSystemProvider;
            _repositorySettings = repositorySettings;
            _solutionManager = solutionManager;
            _repositoryFactory = repositoryFactory;
            _recentPackageRepository = recentPackagesRepository;

            _solutionManager.SolutionClosing += (sender, e) => {
                _repositoryInfo = null;
            };
        }
开发者ID:jacksonh,项目名称:nuget,代码行数:29,代码来源:VsPackageManagerFactory.cs

示例7: VsSourceControlTracker

        public VsSourceControlTracker(
            ISolutionManager solutionManager, 
            IFileSystemProvider fileSystemProvider,
            IVsTrackProjectDocuments2 projectTracker,
            ISettings solutionSettings)
        {
            if (projectTracker == null)
            {
                throw new ArgumentNullException("projectTracker");
            }

            _solutionManager = solutionManager;
            _projectTracker = projectTracker;
            _fileSystemProvider = fileSystemProvider;
            _solutionSettings = solutionSettings;
            _projectDocumentListener = new TrackProjectDocumentEventListener(this);

            _solutionManager.SolutionOpened += OnSolutionOpened;
            _solutionManager.SolutionClosed += OnSolutionClosed;

            if (_solutionManager.IsSolutionOpen)
            {
                StartTracking();
            }
        }
开发者ID:xero-github,项目名称:Nuget,代码行数:25,代码来源:VsSourceControlTracker.cs

示例8: before_each_spec

        public override void before_each_spec()
        {
            var dependencyResolver = MockRepository.GenerateStub<IDependencyResolver>();
            metaDataSynchroniser = MockRepository.GenerateStub<IMetaDataSynchroniser>();
            fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>();
            packageBuilder = MockRepository.GenerateStub<IPackageCommand>();

            var configReader = new BooBuildConfigReader();

            dependencyResolver.Stub(x => x.Resolve<IBuildConfigReader>()).Return(configReader);

            dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(
                new SourceControlDouble("http://someurl.com/"));

            dependencyResolver.Stub(x => x.Resolve<IPackageCommand>("install")).Return(packageBuilder);

            fileSystemProvider.Stub(x => x.GetTemporaryBuildDirectory(Arg<DirectoryInfo>.Is.TypeOf)).Return(
                new DirectoryInfo(@"C:\temp\build"));

            IoC.InitializeWith(dependencyResolver);

            fileSystemProvider.Stub(x => x.GetHornRootDirectory(Arg<string>.Is.TypeOf)).Return(FileSystemHelper.GetFakeDummyHornDirectory());

            fileSystemProvider.Stub(x => x.CreateTemporaryHornDirectory(Arg<string>.Is.TypeOf)).Return(new DirectoryInfo(HornConfig.Settings.HornTempDirectory));

            fileSystemProvider.Stub(x => x.ZipFolder(Arg<DirectoryInfo>.Is.TypeOf, Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).Return(
                new FileInfo(@"C:\zip"));

            siteStructureBuilder = GetSiteBuilder();

            siteStructureBuilder.Initialise();

            siteStructureBuilder.Build();
        }
开发者ID:kkozmic,项目名称:horn_src,代码行数:34,代码来源:BuilderIniitialiseBase.cs

示例9: AddBindingRedirects

        private static IEnumerable<AssemblyBinding> AddBindingRedirects(
            Project project, 
            IFileSystemProvider fileSystemProvider, 
            AppDomain domain, 
            IDictionary<string, HashSet<string>> projectAssembliesCache, 
            IVsFrameworkMultiTargeting frameworkMultiTargeting)
        {
            var redirects = Enumerable.Empty<AssemblyBinding>();

            // Create a project system
            IFileSystem fileSystem = VsProjectSystemFactory.CreateProjectSystem(project, fileSystemProvider);

            // Run this on the UI thread since it enumerates all references
            IEnumerable<string> assemblies = ThreadHelper.Generic.Invoke(() => project.GetAssemblyClosure(fileSystemProvider, projectAssembliesCache));

            redirects = BindingRedirectResolver.GetBindingRedirects(assemblies, domain);

            if (frameworkMultiTargeting != null)
            {
                // filter out assemblies that already exist in the target framework (CodePlex issue #3072)
                FrameworkName targetFrameworkName = project.GetTargetFrameworkName();
                redirects = redirects.Where(p => !FrameworkAssemblyResolver.IsHigherAssemblyVersionInFramework(p.Name, p.AssemblyNewVersion, targetFrameworkName, fileSystemProvider));
            }

            // Create a binding redirect manager over the configuration
            var manager = new BindingRedirectManager(fileSystem, project.GetConfigurationFile());

            // Add the redirects
            manager.AddBindingRedirects(redirects);

            return redirects;
        }
开发者ID:Newtopian,项目名称:nuget,代码行数:32,代码来源:RuntimeHelpers.cs

示例10: PackageRestoreManager

 internal PackageRestoreManager(
     DTE dte,
     ISolutionManager solutionManager,
     IFileSystemProvider fileSystemProvider,
     IPackageRepositoryFactory packageRepositoryFactory,
     IVsPackageSourceProvider packageSourceProvider,
     IVsPackageManagerFactory packageManagerFactory,
     IVsPackageInstallerEvents packageInstallerEvents,
     IPackageRepository localCacheRepository,
     IVsThreadedWaitDialogFactory waitDialogFactory,
     ISettings settings)
 {
     Debug.Assert(solutionManager != null);
     _dte = dte;
     _fileSystemProvider = fileSystemProvider;
     _solutionManager = solutionManager;
     _packageRepositoryFactory = packageRepositoryFactory;
     _packageSourceProvider = packageSourceProvider;
     _waitDialogFactory = waitDialogFactory;
     _packageManagerFactory = packageManagerFactory;
     _localCacheRepository = localCacheRepository;
     _settings = settings;
     _solutionManager.ProjectAdded += OnProjectAdded;
     _solutionManager.SolutionOpened += OnSolutionOpenedOrClosed;
     _solutionManager.SolutionClosed += OnSolutionOpenedOrClosed;
     packageInstallerEvents.PackageReferenceAdded += OnPackageReferenceAdded;
 }
开发者ID:Mailaender,项目名称:xamarin-nuget,代码行数:27,代码来源:PackageRestoreManager.cs

示例11: AddBindingRedirectCommand

 public AddBindingRedirectCommand(
     IFileSystemProvider fileSystemProvider,
     IVsFrameworkMultiTargeting frameworkMultiTargeting)
     : this()
 {
     _fileSystemProvider = fileSystemProvider;
     _frameworkMultiTargeting = frameworkMultiTargeting;
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:8,代码来源:AddBindingRedirectCommand.cs

示例12: JsonLocalizer

 public JsonLocalizer(string paths, IFileSystemProvider fileProvider, IJsonSerializer jsonSerializer)
 {
     jsonResources = new List<JsonResource>();
     this.fileProvider = fileProvider;
     this.fileProvider.SetRootPath("~/".GetPhysicalPath());
     this.jsonSerializer = jsonSerializer;
     LoadResources(paths.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
 }
开发者ID:cairabbit,项目名称:daf,代码行数:8,代码来源:JsonLocalizer.cs

示例13: SetupFileSystemProvider

 private void SetupFileSystemProvider()
 {
     var mockFileSystemProvider = new Mock<IFileSystemProvider>();
     mockFileSystemProvider
         .Setup(x => x.EnumerateFiles(It.IsAny<SearchParameters>()))
         .Returns<IEnumerable<string>>(r => configurations.Keys);
     fileSystemProvider = mockFileSystemProvider.Object;
 }
开发者ID:patrickhuber,项目名称:BootstrapConfig,代码行数:8,代码来源:CrawlerTests.cs

示例14: SiteStructureBuilder

        public SiteStructureBuilder(IMetaDataSynchroniser metaDataSynchroniser, IFileSystemProvider fileSystemProvider, string dropDirectoryPath)
        {
            this.metaDataSynchroniser = metaDataSynchroniser;
            this.fileSystemProvider = fileSystemProvider;
            dropDirectory = new DirectoryInfo(dropDirectoryPath);
            Categories = new List<Category>();

            frequency = new TimeSpan(0, 0, HornConfig.Settings.BuildFrequency, 0);
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:9,代码来源:SiteStructureBuilder.cs

示例15: VsPackageManagerFactory

 public VsPackageManagerFactory(ISolutionManager solutionManager,
                                IPackageRepositoryFactory repositoryFactory,
                                IVsPackageSourceProvider packageSourceProvider,
                                IFileSystemProvider fileSystemProvider,
                                IRepositorySettings repositorySettings,
                                IRecentPackageRepository recentPackagesRepository,
                                VsPackageInstallerEvents packageEvents) :
     this(solutionManager, repositoryFactory, packageSourceProvider, fileSystemProvider, repositorySettings, recentPackagesRepository, packageEvents, MachineCache.Default)
 {
 }
开发者ID:monoman,项目名称:NugetCracker,代码行数:10,代码来源:VsPackageManagerFactory.cs


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