本文整理汇总了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));
}
示例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;
}
示例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);
}
示例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;
}
示例5: RepositorySettings
internal RepositorySettings(
ISolutionManager solutionManager,
IFileSystemProvider fileSystemProvider,
IVsSourceControlTracker sourceControlTracker) :
this(solutionManager, fileSystemProvider, sourceControlTracker, machineWideSettings: null)
{
}
示例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;
};
}
示例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();
}
}
示例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();
}
示例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;
}
示例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;
}
示例11: AddBindingRedirectCommand
public AddBindingRedirectCommand(
IFileSystemProvider fileSystemProvider,
IVsFrameworkMultiTargeting frameworkMultiTargeting)
: this()
{
_fileSystemProvider = fileSystemProvider;
_frameworkMultiTargeting = frameworkMultiTargeting;
}
示例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));
}
示例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;
}
示例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);
}
示例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)
{
}