Esempio n. 1
0
 public SProcPublisherTest(PackageTestFilesFixture files)
 {
     _files       = files;
     _shell       = Substitute.For <ICoreShell>();
     _pss         = Substitute.For <IProjectSystemServices>();
     _dacServices = Substitute.For <IDacPackageServices>();
 }
Esempio n. 2
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) {
     _appShell = appShell;
     _pss = pss;
     _fs = fs;
     _dacServicesProvider = dacServicesProvider;
     _settings = settings;
 }
Esempio n. 3
0
 public SProcGeneratorTest(PackageTestFilesFixture files)
 {
     _files   = files;
     _pss     = Substitute.For <IProjectSystemServices>();
     _project = Substitute.For <EnvDTE.Project>();
     _project.FullName.Returns(Path.Combine(_files.DestinationPath, sqlProjectName));
 }
Esempio n. 4
0
 public CommandTest()
 {
     _shell            = TestCoreShell.CreateSubstitute();
     _pss              = Substitute.For <IProjectSystemServices>();
     _servicesProvider = Substitute.For <IDacPackageServicesProvider>();
     _storage          = Substitute.For <ISettingsStorage>();
 }
Esempio n. 5
0
 public RDebugLaunchProvider(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, IProjectSystemServices pss)
     : base(configuredProject)
 {
     _properties          = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>();
     _interactiveWorkflow = interactiveWorkflowProvider.GetOrCreate();
     _pss = pss;
 }
Esempio n. 6
0
 /// <summary>
 /// Retrieves list of files that represent stored procedures in R
 /// </summary>
 /// <returns></returns>
 public static IEnumerable<string> GetSProcFiles(this EnvDTE.Project project, IProjectSystemServices pss) {
     var rFiles = pss.GetProjectFiles(project).Where(x => Path.GetExtension(x).EqualsIgnoreCase(".R"));
     var sqlFiles = new HashSet<string>(pss.GetProjectFiles(project).Where(x => Path.GetExtension(x).EqualsIgnoreCase(".sql")));
     return rFiles.Where(x =>
                 sqlFiles.Contains(x.ToQueryFilePath(), StringComparer.OrdinalIgnoreCase) &&
                 sqlFiles.Contains(x.ToSProcFilePath(), StringComparer.OrdinalIgnoreCase));
 }
Esempio n. 7
0
 public SProcPublisher(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServices dacServices) {
     _appShell = appShell;
     _pss = pss;
     _fs = fs;
     _dacServices = dacServices;
     _outputWindow = new OutputWindowLogWriter(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, string.Empty);
 }
 public PublishOptionsDialogModelTest()
 {
     _coreShell = Substitute.For <ICoreShell>();
     _pss       = Substitute.For <IProjectSystemServices>();
     _pcsp      = Substitute.For <IProjectConfigurationSettingsProvider>();
     _storage   = Substitute.For <IWritableSettingsStorage>();
 }
Esempio n. 9
0
 public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider)
 {
     _appShell            = appShell;
     _pss                 = pss;
     _pcsp                = pcsp;
     _dacServicesProvider = dacServicesProvider;
 }
Esempio n. 10
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServicesProvider dacServicesProvider)
 {
     _appShell            = appShell;
     _pss                 = pss;
     _fs                  = fs;
     _dacServicesProvider = dacServicesProvider;
 }
Esempio n. 11
0
 public PublishSProcCommand(ICoreShell shell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings)
 {
     _shell = shell;
     _pss   = pss;
     _dacServicesProvider = dacServicesProvider;
     _settings            = settings;
 }
Esempio n. 12
0
 public SProcPublisher(IServiceContainer services, IProjectSystemServices pss, IDacPackageServices dacServices)
 {
     _services     = services;
     _pss          = pss;
     _dacServices  = dacServices;
     _outputWindow = new OutputWindowLogWriter(services, VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, string.Empty);
 }
Esempio n. 13
0
        private SqlPublshOptionsDialog(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp)
        {
            _appShell = appShell;
            _pss      = pss;
            _pcsp     = pcsp;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
Esempio n. 14
0
 public CommandTest()
 {
     _shell            = Substitute.For <ICoreShell>();
     _pss              = Substitute.For <IProjectSystemServices>();
     _servicesProvider = Substitute.For <IDacPackageServicesProvider>();
     _fs      = Substitute.For <IFileSystem>();
     _storage = Substitute.For <ISettingsStorage>();
 }
        private SqlPublshOptionsDialog(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
            _appShell = appShell;
            _pss = pss;
            _pcsp = pcsp;
            _settings = settings;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
        public static async Task <SqlPublshOptionsDialog> CreateAsync(
            ICoreShell shell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings)
        {
            var dialog = new SqlPublshOptionsDialog(shell, pss, shell.FileSystem(), pcsp, settings);
            await dialog.InitializeModelAsync();

            return(dialog);
        }
Esempio n. 17
0
        public static async Task <SqlPublshOptionsDialog> CreateAsync(
            IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp)
        {
            var dialog = new SqlPublshOptionsDialog(appShell, pss, fs, pcsp);
            await dialog.InitializeModelAsync();

            return(dialog);
        }
Esempio n. 18
0
 public SProcPublisher(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServices dacServices)
 {
     _appShell     = appShell;
     _pss          = pss;
     _fs           = fs;
     _dacServices  = dacServices;
     _outputWindow = new OutputWindowLogWriter(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, string.Empty);
 }
Esempio n. 19
0
        public SProcGeneratorTest(PackageTestFilesFixture files) {
            _files = files;
            _coreShell = Substitute.For<ICoreShell>();
            _pss = Substitute.For<IProjectSystemServices>();

            _project = Substitute.For<EnvDTE.Project>();
            _project.FullName.Returns(Path.Combine(_files.DestinationPath, sqlProjectName));
        }
        private SqlPublshOptionsDialog(ICoreShell shell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings)
        {
            _shell    = shell;
            _pss      = pss;
            _pcsp     = pcsp;
            _settings = settings;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
Esempio n. 21
0
 public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss, 
                                   IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider,
                                   ISettingsStorage settings) {
     _appShell = appShell;
     _pss = pss;
     _pcsp = pcsp;
     _dacServicesProvider = dacServicesProvider;
     _settings = settings;
 }
        public static async Task<SqlPublshOptionsDialog> CreateAsync(
            IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
            var dialog = await CreateAsync(appShell, pss, new FileSystem(), pcsp, settings);

            await appShell.SwitchToMainThreadAsync();
            dialog.InitializeComponent();
            dialog.InitializeUI();
            return dialog;
        }
Esempio n. 23
0
 public PublishSProcOptionsCommand(ICoreShell shell, IProjectSystemServices pss,
                                   IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider)
 {
     _shell = shell;
     _pss   = pss;
     _pcsp  = pcsp;
     _dacServicesProvider = dacServicesProvider;
     _settings            = shell.GetService <ISettingsStorage>();
 }
Esempio n. 24
0
 public AddItemCommand(UnconfiguredProject project, IProjectSystemServices pss, int id, string templateName, string fileName, string extension)
 {
     _unconfiguredProject = project;
     _pss          = pss;
     _commandId    = id;
     _templateName = templateName;
     _fileName     = fileName;
     _extension    = extension;
 }
        private SqlPublishOptionsDialogViewModel(SqlSProcPublishSettings settings,
                                                 ICoreShell coreShell, IProjectSystemServices pss,
                                                 IProjectConfigurationSettingsProvider pcsp)
        {
            _coreShell = coreShell;
            _pss       = pss;
            _pcsp      = pcsp;

            Settings = settings;
        }
        public static async Task <SqlPublishOptionsDialogViewModel> CreateAsync(
            SqlSProcPublishSettings settings,
            ICoreShell coreShell, IProjectSystemServices pss,
            IProjectConfigurationSettingsProvider pcsp)
        {
            var model = new SqlPublishOptionsDialogViewModel(settings, coreShell, pss, pcsp);
            await model.InitializeAsync();

            return(model);
        }
 public ConfigurationSettingCommand(
         int id, string settingNameTemplate,
         IProjectSystemServices pss,
         IProjectConfigurationSettingsProvider pcsp,
         IRInteractiveWorkflow workflow) : base(id, workflow) {
     _id = id;
     _settingNameTemplate = settingNameTemplate;
     _projectSystemServices = pss;
     _projectConfigurationSettingsProvider = pcsp;
 }
Esempio n. 28
0
 public ConfigurationSettingCommand(
     int id, string settingNameTemplate,
     IProjectSystemServices pss,
     IProjectConfigurationSettingsProvider pcsp,
     IRInteractiveWorkflow workflow) : base(id, workflow)
 {
     _id = id;
     _settingNameTemplate   = settingNameTemplate;
     _projectSystemServices = pss;
     _projectConfigurationSettingsProvider = pcsp;
 }
Esempio n. 29
0
        public SProcPublisherTest(PackageTestFilesFixture files)
        {
            _files = files;
            _shell = TestCoreShell.CreateSubstitute();

            _shell.ServiceManager.RemoveService(_shell.ServiceManager.GetService <IFileSystem>());
            _shell.ServiceManager.AddService(new WindowsFileSystem());

            _pss         = Substitute.For <IProjectSystemServices>();
            _dacServices = Substitute.For <IDacPackageServices>();
        }
Esempio n. 30
0
        public static async Task <SqlPublshOptionsDialog> CreateAsync(
            ICoreShell shell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings)
        {
            var dialog = await CreateAsync(shell, pss, new FileSystem(), pcsp, settings);

            await shell.SwitchToMainThreadAsync();

            dialog.InitializeComponent();
            dialog.InitializeUI();
            return(dialog);
        }
Esempio n. 31
0
        private static string MakeCsvFileName(ICoreShell shell, IProjectSystemServices pss, string variableName)
        {
            var project     = pss.GetActiveProject();
            var projectName = project?.FileName;

            var contentTypeService = shell.GetService <IContentTypeRegistryService>();
            var viewTracker        = shell.GetService <IActiveWpfTextViewTracker>();

            var activeView = viewTracker.GetLastActiveTextView(contentTypeService.GetContentType(RContentTypeDefinition.ContentType));
            var filePath   = activeView.GetFilePath();

            var csvFileName = string.Empty;

            if (!string.IsNullOrEmpty(projectName))
            {
                csvFileName += Path.GetFileNameWithoutExtension(projectName);
                csvFileName += "_";
            }

            if (!string.IsNullOrEmpty(filePath))
            {
                csvFileName += Path.GetFileNameWithoutExtension(filePath);
                csvFileName += "_";
            }

            if (variableName.StartsWith("$", StringComparison.Ordinal))
            {
                variableName = variableName.Substring(1);
            }

            int invalidCharIndex = variableName.IndexOfAny(Path.GetInvalidFileNameChars());

            variableName = MakeFileSystemCompatible(variableName);
            if (variableName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
            {
                variableName = _variableNameReplacement;
            }
            csvFileName += variableName;

            return(csvFileName);
        }
Esempio n. 32
0
 public RDebugLaunchProvider(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, IProjectSystemServices pss)
     : base(configuredProject) {
     _properties = configuredProject.Services.ExportProvider.GetExportedValue<ProjectProperties>();
     _interactiveWorkflow = interactiveWorkflowProvider.GetOrCreate();
     _pss = pss;
 }
Esempio n. 33
0
 public WorkspaceServices(IProjectSystemServices pss) {
     _pss = pss;
 }
Esempio n. 34
0
        private static string MakeCsvFileName(IApplicationShell appShell, IProjectSystemServices pss, string variableName) {
            var project = pss.GetActiveProject();
            var projectName = project?.FileName;

            var contentTypeService = appShell.ExportProvider.GetExportedValue<IContentTypeRegistryService>();
            var viewTracker = appShell.ExportProvider.GetExportedValue<IActiveWpfTextViewTracker>();

            var activeView = viewTracker.GetLastActiveTextView(contentTypeService.GetContentType(RContentTypeDefinition.ContentType));
            var filePath = activeView.GetFilePath();

            var csvFileName = string.Empty;

            if (!string.IsNullOrEmpty(projectName)) {
                csvFileName += Path.GetFileNameWithoutExtension(projectName);
                csvFileName += "_";
            }

            if (!string.IsNullOrEmpty(filePath)) {
                csvFileName += Path.GetFileNameWithoutExtension(filePath);
                csvFileName += "_";
            }

            if (variableName.StartsWith("$", StringComparison.Ordinal)) {
                variableName = variableName.Substring(1);
            }

            int invalidCharIndex = variableName.IndexOfAny(Path.GetInvalidFileNameChars());

            variableName = MakeFileSystemCompatible(variableName);
            if (variableName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) {
                variableName = _variableNameReplacement;
            }
            csvFileName += variableName;

            return csvFileName;
        }
 public SetDirectoryToProjectCommand(IRInteractiveWorkflow interactiveWorkflow, IProjectSystemServices pss) :
     base(RGuidList.RCmdSetGuid, (int)RPackageCommandId.icmdSetDirectoryToProjectCommand)
 {
     _interactiveWorkflow = interactiveWorkflow;
     _pss = pss;
 }
Esempio n. 36
0
 public AddRMarkdownCommand(UnconfiguredProject unconfiguredProject, IProjectSystemServices pss): 
     base(unconfiguredProject, pss, RPackageCommandId.icmdAddRMarkdown, "emptyrmd", "markdown", "rmd") {
 }
Esempio n. 37
0
 public PublishSProcCommand(ICoreShell shell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider) :
     this(shell, pss, dacServicesProvider, shell.GetService <ISettingsStorage>())
 {
 }
Esempio n. 38
0
 public AddDbConnectionCommand(IDbConnectionService dbcs, IProjectSystemServices pss,
         IProjectConfigurationSettingsProvider pcsp, IRInteractiveWorkflow workflow) :
     base(RPackageCommandId.icmdAddDatabaseConnection, "dbConnection", pss, pcsp, workflow) {
     _dbcs = dbcs;
 }
Esempio n. 39
0
 public CommandTest() {
     _appShell = Substitute.For<IApplicationShell>();
     _pss = Substitute.For<IProjectSystemServices>();
 }
Esempio n. 40
0
 public PublishSProcCommand(ICoreShell shell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) :
     this(shell, pss, shell.FileSystem(), dacServicesProvider, settings)
 {
 }
 public PublishOptionsDialogModelTest() {
     _coreShell = Substitute.For<ICoreShell>();
     _pss = Substitute.For<IProjectSystemServices>();
     _pcsp = Substitute.For<IProjectConfigurationSettingsProvider>();
     _storage = Substitute.For<ISettingsStorage>();
 }
Esempio n. 42
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) :
     this(appShell, pss, new FileSystem(), dacServicesProvider, settings)
 {
 }
 public static async Task<SqlPublishOptionsDialogViewModel> CreateAsync(
     SqlSProcPublishSettings settings,
     ICoreShell coreShell, IProjectSystemServices pss,
     IProjectConfigurationSettingsProvider pcsp) {
     var model = new SqlPublishOptionsDialogViewModel(settings, coreShell, pss, pcsp);
     await model.InitializeAsync();
     return model;
 }
        private SqlPublishOptionsDialogViewModel(SqlSProcPublishSettings settings,
            ICoreShell coreShell, IProjectSystemServices pss,
            IProjectConfigurationSettingsProvider pcsp) {
            _coreShell = coreShell;
            _pss = pss;
            _pcsp = pcsp;

            Settings = settings;
        }
 public static async Task<SqlPublshOptionsDialog> CreateAsync(
     IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
     var dialog = new SqlPublshOptionsDialog(appShell, pss, fs, pcsp, settings);
     await dialog.InitializeModelAsync();
     return dialog;
 }
Esempio n. 46
0
 public SProcProjectFilesGenerator(IProjectSystemServices pss, IFileSystem fs) {
     _pss = pss;
     _fs = fs;
 }
Esempio n. 47
0
 public CommandTest()
 {
     _appShell = Substitute.For <IApplicationShell>();
     _pss      = Substitute.For <IProjectSystemServices>();
 }
Esempio n. 48
0
 public SProcProjectFilesGenerator(IProjectSystemServices pss, IFileSystem fs)
 {
     _pss = pss;
     _fs  = fs;
 }
 public SetDirectoryToProjectCommand(IRInteractiveWorkflow interactiveWorkflow, IProjectSystemServices pss) :
     base(RGuidList.RCmdSetGuid, (int)RPackageCommandId.icmdSetDirectoryToProjectCommand) {
     _interactiveWorkflow = interactiveWorkflow;
     _pss = pss;
 }
Esempio n. 50
0
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) :
     this(appShell, pss, new FileSystem(), dacServicesProvider, settings) {
 }
Esempio n. 51
0
 public SProcPublisherTest(PackageTestFilesFixture files) {
     _files = files;
     _appShell = Substitute.For<IApplicationShell>();
     _pss = Substitute.For<IProjectSystemServices>();
     _dacServices = Substitute.For<IDacPackageServices>();
 }
Esempio n. 52
0
 public AddRScriptCommand(UnconfiguredProject unconfiguredProject, IProjectSystemServices pss) :
     base(unconfiguredProject, pss, RPackageCommandId.icmdAddRScript, "rscript", "script", "R")
 {
 }
Esempio n. 53
0
 public AddRScriptCommand(UnconfiguredProject unconfiguredProject, IProjectSystemServices pss) :
     base(unconfiguredProject, pss, RPackageCommandId.icmdAddRScript, "rscript", "script", "R") {
 }