Ejemplo n.º 1
0
        public static void SetCustomGitTool(IExternalProcessExecutor processExecutor)
        {
            var secondCommand  = "config --global mergetool.DiffMerge.cmd \"'C:/Program Files (x86)/Warewolf/Studio/MergePowershellScript/customMerge.sh' $REMOTE";
            var secondCommand1 = "config --global difftool.DiffMerge.cmd \"'C:/Program Files (x86)/Warewolf/Studio/MergePowershellScript/customMerge.sh' $REMOTE";
            var orderedList1   = new[]
            {
                "config --global merge.tool DiffMerge"
                , secondCommand
                , "config --global mergetool.DiffMerge.trustExitCode false"

                , "config --global diff.tool DiffMerge"
                , secondCommand1
                , "config --global difftool.DiffMerge.trustExitCode false"
            };

            var gitExePath = GetGitExePath();

            if (string.IsNullOrEmpty(gitExePath))
            {
                gitExePath = "git.exe";
            }
            foreach (var item in orderedList1)
            {
                try
                {
                    var quotedExePath = "\"" + gitExePath + "\"";

                    ExecuteCommand(processExecutor, quotedExePath, item);
                }
                catch (Exception ex)
                {
                    Dev2Logger.Error(ex.Message, "Git Setup error");
                }
            }
        }
Ejemplo n.º 2
0
        public SplashViewModel(IServer server, IExternalProcessExecutor externalProcessExecutor)
        {
            if (server == null)
            {
                throw new ArgumentNullException(nameof(server));
            }
            if (externalProcessExecutor == null)
            {
                throw new ArgumentNullException(nameof(externalProcessExecutor));
            }
            Server = server;
            ExternalProcessExecutor = externalProcessExecutor;

            Uri conUri = new Uri(Resources.Languages.Core.ContributorsUrl);

            ContributorsUrl = conUri;
            Uri comUri = new Uri(Resources.Languages.Core.CommunityUrl);

            CommunityUrl = comUri;
            Uri expUri = new Uri(Resources.Languages.HelpText.ExpertHelpUrl);

            ExpertHelpUrl = expUri;
            Uri warewolfUri = new Uri(Resources.Languages.Core.WarewolfUrl);

            WarewolfUrl       = warewolfUri;
            WarewolfCopyright = Resources.Languages.Core.WarewolfCopyright;

            ContributorsCommand = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(ContributorsUrl));
            CommunityCommand    = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(CommunityUrl));
            ExpertHelpCommand   = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(ExpertHelpUrl));
            WarewolfUrlCommand  = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(WarewolfUrl));
        }
 public void RunAllTestsInBrowser(bool isDirty, string runAllTestUrl, IExternalProcessExecutor processExecutor)
 {
     if (isDirty)
     {
         ShowRunAllUnsavedError();
         return;
     }
     processExecutor?.OpenInBrowser(new Uri(runAllTestUrl));
 }
Ejemplo n.º 4
0
        public QueueEventsViewModel(IServer server, IExternalProcessExecutor externalProcessExecutor, IResourcePickerDialog resourcePickerDialog)
        {
            _server                  = server;
            _resourceRepository      = server.ResourceRepository;
            _externalProcessExecutor = externalProcessExecutor;

            AddWorkflowCommand = new DelegateCommand(OpenResourcePicker);

            _source = new EnvironmentViewModel(server, CustomContainer.Get <IShellViewModel>(), true);
            _currentResourcePicker = resourcePickerDialog ?? CreateResourcePickerDialog();
            InitializeHelp();
            PopupController = CustomContainer.Get <IPopupController>();

            PopulateQueues();
            AddDummyTriggerQueueView();
        }
Ejemplo n.º 5
0
 private static string ExecuteCommand(IExternalProcessExecutor processExecutor, string exe, string command)
 {
     try
     {
         var procStartInfo = new ProcessStartInfo(exe, command);
         procStartInfo.RedirectStandardOutput = true;
         procStartInfo.UseShellExecute        = false;
         procStartInfo.CreateNoWindow         = true;
         var proc   = processExecutor.Start(procStartInfo);
         var result = proc.StandardOutput.ReadToEnd();
         return(result);
     }
     catch (Exception)
     {
         return("");
     }
 }
Ejemplo n.º 6
0
 public RedisSourceViewModel(IRedisSourceModel redisSourceModel, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
     : base("RedisSource")
 {
     VerifyArgument.IsNotNull(nameof(executor), executor);
     VerifyArgument.IsNotNull(nameof(asyncWorker), asyncWorker);
     VerifyArgument.IsNotNull(nameof(redisSourceModel), redisSourceModel);
     VerifyArgument.IsNotNull(nameof(aggregator), aggregator);
     AsyncWorker         = asyncWorker;
     Executor            = executor;
     _redisSourceModel   = redisSourceModel;
     _warewolfserverName = redisSourceModel.ServerName;
     _authenticationType = AuthenticationType.Anonymous;
     _hostName           = string.Empty;
     _port             = "6379";
     _password         = string.Empty;
     HeaderText        = Resources.Languages.Core.RedisNewHeaderLabel;
     Header            = Resources.Languages.Core.RedisNewHeaderLabel;
     TestCommand       = new DelegateCommand(TestConnection, CanTest);
     OkCommand         = new DelegateCommand(SaveConnection, CanSave);
     CancelTestCommand = new DelegateCommand(CancelTest, CanCancelTest);
 }
 public ElasticsearchSourceViewModel(IElasticsearchSourceModel elasticsearchSourceModel, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor, IServer currentEnvironment)
     : base("ElasticsearchSource")
 {
     VerifyArgument.IsNotNull(nameof(executor), executor);
     VerifyArgument.IsNotNull(nameof(asyncWorker), asyncWorker);
     VerifyArgument.IsNotNull(nameof(elasticsearchSourceModel), elasticsearchSourceModel);
     VerifyArgument.IsNotNull(nameof(aggregator), aggregator);
     CurrentEnvironment        = currentEnvironment ?? throw new ArgumentNullException(nameof(currentEnvironment));
     AsyncWorker               = asyncWorker;
     Executor                  = executor;
     _elasticsearchSourceModel = elasticsearchSourceModel;
     _authenticationType       = AuthenticationType.Anonymous;
     _hostName                 = string.Empty;
     _port             = "9200";
     _password         = string.Empty;
     _searchIndex      = string.Empty;
     _username         = string.Empty;
     HeaderText        = Resources.Languages.Core.ElasticsearchNewHeaderLabel;
     Header            = Resources.Languages.Core.ElasticsearchNewHeaderLabel;
     TestCommand       = new DelegateCommand(TestConnection, CanTest);
     OkCommand         = new DelegateCommand(SaveConnection, CanSave);
     CancelTestCommand = new DelegateCommand(CancelTest, CanCancelTest);
 }
 public ManageWebserviceSourceViewModel(IManageWebServiceSourceModel updateManager, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
     : base("WebSource")
 {
     VerifyArgument.IsNotNull("executor", executor);
     VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
     VerifyArgument.IsNotNull("updateManager", updateManager);
     VerifyArgument.IsNotNull("aggregator", aggregator);
     AsyncWorker         = asyncWorker;
     Executor            = executor;
     _updateManager      = updateManager;
     _warewolfserverName = updateManager.ServerName;
     _authenticationType = AuthenticationType.Anonymous;
     _hostName           = string.Empty;
     _defaultQuery       = string.Empty;
     _userName           = string.Empty;
     _password           = string.Empty;
     HeaderText          = Resources.Languages.Core.WebserviceNewHeaderLabel;
     Header               = Resources.Languages.Core.WebserviceNewHeaderLabel;
     TestCommand          = new DelegateCommand(TestConnection, CanTest);
     OkCommand            = new DelegateCommand(SaveConnection, CanSave);
     CancelTestCommand    = new DelegateCommand(CancelTest, CanCancelTest);
     ViewInBrowserCommand = new DelegateCommand(ViewInBrowser, CanViewInBrowser);
 }
Ejemplo n.º 9
0
        public SplashViewModel(IServer server, IExternalProcessExecutor externalProcessExecutor)
        {
            Server = server ?? throw new ArgumentNullException(nameof(server));
            ExternalProcessExecutor = externalProcessExecutor ?? throw new ArgumentNullException(nameof(externalProcessExecutor));

            var conUri = new Uri(Resources.Languages.Core.ContributorsUrl);

            ContributorsUrl = conUri;
            var comUri = new Uri(Resources.Languages.Core.CommunityUrl);

            CommunityUrl = comUri;
            var expUri = new Uri(Resources.Languages.HelpText.ExpertHelpUrl);

            ExpertHelpUrl = expUri;
            var warewolfUri = new Uri(Resources.Languages.Core.WarewolfUrl);

            WarewolfUrl       = warewolfUri;
            WarewolfCopyright = string.Format(Resources.Languages.Core.WarewolfCopyright, DateTime.Now.Year.ToString());

            ContributorsCommand = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(ContributorsUrl));
            CommunityCommand    = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(CommunityUrl));
            ExpertHelpCommand   = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(ExpertHelpUrl));
            WarewolfUrlCommand  = new DelegateCommand(() => externalProcessExecutor.OpenInBrowser(WarewolfUrl));
        }
Ejemplo n.º 10
0
        public ElasticsearchSourceViewModel(IElasticsearchSourceModel elasticsearchSourceModel, IEventAggregator aggregator, IElasticsearchSourceDefinition elasticsearchServiceSource, IAsyncWorker asyncWorker, IExternalProcessExecutor executor, IServer currentEnvironment)
            : this(elasticsearchSourceModel, aggregator, asyncWorker, executor, currentEnvironment)
        {
            VerifyArgument.IsNotNull(nameof(elasticsearchServiceSource), elasticsearchServiceSource);

            AsyncWorker.Start(() => elasticsearchSourceModel.FetchSource(elasticsearchServiceSource.Id), source =>
            {
                _elasticsearchServiceSource      = source;
                _elasticsearchServiceSource.Path = elasticsearchServiceSource.Path;

                FromModel(_elasticsearchServiceSource);
                Item = ToSource();
                SetupHeaderTextFromExisting();
            });
        }
Ejemplo n.º 11
0
 public ElasticsearchSourceViewModel(IElasticsearchSourceModel elasticsearchSourceModel, Task <IRequestServiceNameViewModel> requestServiceNameViewModel, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor, IServer currentEnvironment)
     : this(elasticsearchSourceModel, aggregator, asyncWorker, executor, currentEnvironment)
 {
     VerifyArgument.IsNotNull(nameof(requestServiceNameViewModel), requestServiceNameViewModel);
     RequestServiceNameViewModel = requestServiceNameViewModel;
 }
 public WorkflowDesignerViewModelMock(IContextualResourceModel resource, IWorkflowHelper workflowHelper, IPopupController popupController, IExternalProcessExecutor processExecutor, bool createDesigner = false)
     : base(
         new Mock <IEventAggregator>().Object,
         resource, workflowHelper,
         popupController, new SynchronousAsyncWorker(), createDesigner, false)
 {
     _wd = _moq.Object;
 }
 public ManageWebserviceSourceViewModel(IManageWebServiceSourceModel updateManager, Task <IRequestServiceNameViewModel> requestServiceNameViewModel, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
     : this(updateManager, aggregator, asyncWorker, executor)
 {
     VerifyArgument.IsNotNull("requestServiceNameViewModel", requestServiceNameViewModel);
     _requestServiceNameViewModel = requestServiceNameViewModel;
 }
Ejemplo n.º 14
0
 public ManageNewServerViewModel(IManageServerSourceModel updateManager, Task <IRequestServiceNameViewModel> requestServiceNameViewModel, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
     : this(updateManager, aggregator, asyncWorker, executor)
 {
     VerifyArgument.IsNotNull("requestServiceNameViewModel", requestServiceNameViewModel);
     RequestServiceNameViewModel = requestServiceNameViewModel;
     GetLoadComputerNamesTask(null);
 }
Ejemplo n.º 15
0
        public ManageNewServerViewModel(IManageServerSourceModel updateManager, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
            : base("ServerSource")
        {
            VerifyArgument.IsNotNull("executor", executor);
            VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
            VerifyArgument.IsNotNull("updateManager", updateManager);
            VerifyArgument.IsNotNull("aggregator", aggregator);

            AsyncWorker = asyncWorker;
            Protocols   = new[] { "https", "http" };
            Protocol    = Protocols[0];

            Ports = new ObservableCollection <string> {
                "3143", "3142"
            };
            SelectedPort   = Ports[0];
            _updateManager = updateManager;

            _warewolfserverName = updateManager.ServerName;
            Header     = Resources.Languages.Core.ServerSourceNewHeaderLabel;
            HeaderText = Resources.Languages.Core.ServerSourceNewHeaderLabel;

            TestCommand       = new DelegateCommand(CheckVersionConflict, CanTest);
            OkCommand         = new DelegateCommand(SaveConnection, CanSave);
            CancelTestCommand = new DelegateCommand(CancelTest, CanCancelTest);
        }
Ejemplo n.º 16
0
        public RedisSourceViewModel(IRedisSourceModel redisSourceModel, IEventAggregator aggregator, IRedisServiceSource redisServiceSource, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
            : this(redisSourceModel, aggregator, asyncWorker, executor)
        {
            VerifyArgument.IsNotNull(nameof(redisServiceSource), redisServiceSource);
            _warewolfserverName = redisSourceModel.ServerName;
            AsyncWorker.Start(() => redisSourceModel.FetchSource(redisServiceSource.Id), source =>
            {
                _redisServiceSource      = source;
                _redisServiceSource.Path = redisServiceSource.Path;

                FromModel(_redisServiceSource);
                Item = ToSource();
                SetupHeaderTextFromExisting();
            });
        }
Ejemplo n.º 17
0
 public RedisSourceViewModel(IRedisSourceModel redisSourceModel, Task <IRequestServiceNameViewModel> requestServiceNameViewModel, IEventAggregator aggregator, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
     : this(redisSourceModel, aggregator, asyncWorker, executor)
 {
     VerifyArgument.IsNotNull(nameof(requestServiceNameViewModel), requestServiceNameViewModel);
     _requestServiceNameViewModel = requestServiceNameViewModel;
 }
 public void RunSelectedTestInBrowser(string runSelectedTestUrl, IExternalProcessExecutor processExecutor)
 {
     processExecutor?.OpenInBrowser(new Uri(runSelectedTestUrl));
 }
Ejemplo n.º 19
0
        public ManageNewServerViewModel(IManageServerSourceModel updateManager, IEventAggregator aggregator, IServerSource serverSource, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
            : this(updateManager, aggregator, asyncWorker, executor)
        {
            VerifyArgument.IsNotNull("serverSource", serverSource);

            _warewolfserverName = updateManager.ServerName;
            AsyncWorker.Start(() => updateManager.FetchSource(serverSource.ID), source =>
            {
                _serverSource = source;
                _serverSource.ResourcePath = serverSource.ResourcePath;
                GetLoadComputerNamesTask(() =>
                {
                    FromModel(_serverSource);
                    Item = ToModel();
                    SetupHeaderTextFromExisting();
                }
                                         );
            });
        }
        public ManageWebserviceSourceViewModel(IManageWebServiceSourceModel updateManager, IEventAggregator aggregator, IWebServiceSource webServiceSource, IAsyncWorker asyncWorker, IExternalProcessExecutor executor)
            : this(updateManager, aggregator, asyncWorker, executor)
        {
            VerifyArgument.IsNotNull("webServiceSource", webServiceSource);
            _warewolfserverName = updateManager.ServerName;
            AsyncWorker.Start(() => updateManager.FetchSource(webServiceSource.Id), source =>
            {
                _webServiceSource      = source;
                _webServiceSource.Path = webServiceSource.Path;

                FromModel(_webServiceSource);
                Item = ToSource();
                SetupHeaderTextFromExisting();
            });
        }