Example #1
0
        public ToolDescriptor(Guid id, IWarewolfType designer, IWarewolfType activity, string name, string icon, Version version, bool isSupported, string category, ToolType toolType, string iconUri, string filterTag, string toolTip, string helpText)
        {
            if (id == Guid.Empty)
            {
                throw new ArgumentNullException("id", "empty guids not allowed fo tools");
            }

            VerifyArgument.AreNotNull(new Dictionary <string, object> {
                { "id", id }, { "designer", designer }, { "activity", activity }, { "name", name }, { "icon", icon }, { "version", version }, { "category", category }, { iconUri, "iconUri" }, { filterTag, "filterTag" }
            });
            ToolType    = toolType;
            Category    = category;
            IsSupported = isSupported;

            Version          = version;
            Icon             = icon;
            Name             = name;
            Activity         = activity;
            IconUri          = iconUri;
            Designer         = designer;
            Id               = id;
            FilterTag        = filterTag;
            ResourceToolTip  = toolTip;
            ResourceHelpText = helpText;
        }
        public ScheduledResourceModel(IDev2TaskService taskService, string warewolfFolderId, string warewolfAgentPath,
                                      ITaskServiceConvertorFactory taskServiceFactory, string debugHistoryPath, ISecurityWrapper securityWrapper)
        {
            var nullables = new Dictionary <string, object>
            {
                { "taskService", taskService },
                { "warewolfFolderId", warewolfFolderId },
                { "warewolfAgentPath", warewolfAgentPath },
                { "taskServiceFactory", taskServiceFactory },
                { "debugHistoryPath", debugHistoryPath },
                { "securityWrapper", securityWrapper }
            };

            VerifyArgument.AreNotNull(nullables);

            _taskStates = new Dictionary <int, string>
            {
                { 102, "Task Completed" },
                { 100, "Task Started" },
                { 101, "Failed To Start" },
                { 103, "Job Failed" },
                { 104, "Logon Failed" }
            };
            _taskService        = taskService;
            _warewolfFolderPath = warewolfFolderId;
            _warewolfAgentPath  = warewolfAgentPath;

            _factory          = taskServiceFactory;
            _debugHistoryPath = debugHistoryPath;
            _securityWrapper  = securityWrapper;
        }
Example #3
0
 public ResourceUpgrade(Func <XElement, XElement> upgradeFunc)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "upgradeFunc", upgradeFunc }
     });
     UpgradeFunc = upgradeFunc;
 }
Example #4
0
 protected ProxyBase(ICommunicationControllerFactory communicationControllerFactory, IEnvironmentConnection connection)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "communicationControllerFactory", communicationControllerFactory }, { "connection", connection }
     });
     CommunicationControllerFactory = communicationControllerFactory;
     Connection = connection;
 }
 public UpgradePath(Version upgradesFrom, Version upgradesTo, IResourceUpgrade upgrade)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "upgradesFrom", upgradesFrom }, { "upgradesTo", upgradesTo }, { "upgrade", upgrade }
     });
     Upgrade      = upgrade;
     UpgradesTo   = upgradesTo;
     UpgradesFrom = upgradesFrom;
 }
 public ToolDescriptorViewModel(IToolDescriptor tool, bool isEnabled)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "tool", tool }
     });
     IsEnabled = isEnabled;
     UpdateToolActualType(tool);
     Tool = tool;
 }
Example #7
0
 public ToolboxModel(IServer server, IServer localServer, IPluginProxy pluginProxy)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "server", server }, { "localServer", localServer }
     });
     _localServer = localServer;
     _pluginProxy = pluginProxy;
     Server       = server;
 }
Example #8
0
 public DropBoxSourceSourceCallbackHandler(IEnvironmentRepository environmentRepository, string token, string secret)
     : base(environmentRepository)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "environmentRepository", environmentRepository }, { "token", token }, { "secret", secret }
     });
     _token  = token;
     _secret = secret;
 }
Example #9
0
 public HelpWindowViewModel(IHelpDescriptorViewModel defaultViewModel, IHelpWindowModel model)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "defaultViewModel", defaultViewModel }, { "model", model }
     });
     _defaultViewModel         = defaultViewModel;
     CurrentHelpText           = _defaultViewModel;
     HelpModel                 = model;
     model.OnHelpTextReceived += OnHelpTextReceived;
 }
Example #10
0
 // ReSharper disable once TooManyDependencies
 public DropBoxHelper(DropBoxViewWindow dropBoxViewWindow, IEnvironmentModel activeEnvironment, string resourceType, string resourcePath)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "dropBoxViewWindow", dropBoxViewWindow }, { "activeEnvironment", activeEnvironment }, { "resourceType", resourceType }, { "resourcePath", resourcePath }
     });
     ActiveEnvironment = activeEnvironment;
     ResourceType      = resourceType;
     ResourcePath      = resourcePath;
     DropBoxViewWindow = dropBoxViewWindow;
 }
 public SharepointServerSourceCallbackHandler(IEnvironmentRepository environmentRepository, string server, string userName, string password, AuthenticationType authenticationType)
     : base(environmentRepository)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "environmentRepository", environmentRepository }
     });
     _server             = server;
     _userName           = userName;
     _password           = password;
     _authenticationType = authenticationType;
 }
Example #12
0
 public ToolboxViewModel(IToolboxModel localModel, IToolboxModel remoteModel)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "localModel", localModel }, { "remoteModel", remoteModel }
     });
     _localModel  = localModel;
     _remoteModel = remoteModel;
     _localModel.OnserverDisconnected  += _localModel_OnserverDisconnected;
     _remoteModel.OnserverDisconnected += _remoteModel_OnserverDisconnected;
     BuildToolsList();
     ClearFilterCommand = new DelegateCommand(() => SearchTerm = string.Empty);
 }
Example #13
0
 public void VerifyArgumentsTest_AreNotNull_DoesNotThrows()
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object>
     {
         { "a", new object() },
         { "b", "" },
         { "c", "" },
         { "d", "" },
         { "e", "" },
         { "f", "" }
     });
 }
 public ManageComPluginServiceModel(IStudioUpdateManager updateRepository, IQueryManager queryProxy, IShellViewModel shell, IServer server)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object>
     {
         { "updateRepository", updateRepository },
         { "queryProxy", queryProxy },
         { "shell", shell },
         { "server", server }
     });
     _updateRepository = updateRepository;
     _queryProxy       = queryProxy;
     _shell            = shell;
     shell.SetActiveServer(server.EnvironmentID);
 }
Example #15
0
        public ServerSchedulerFactory(IDev2TaskService service, ITaskServiceConvertorFactory factory, IDirectoryHelper directory)
        {
            var nullables = new Dictionary <string, object>
            {
                { "service", service },
                { "factory", factory },
                { "directory", directory },
            };

            VerifyArgument.AreNotNull(nullables);
            _service = service;
            _factory = factory;
            _dir     = directory;
            CreateDir();
        }
Example #16
0
 // ReSharper disable TooManyDependencies
 public DropBoxSourceViewModel(INetworkHelper network, IDropBoxHelper dropboxHelper, IDropboxFactory dropboxFactory, bool shouldAuthorise)
 // ReSharper restore TooManyDependencies
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "network", network }, { "dropboxHelper", dropboxHelper }, { "dropboxFactory", dropboxFactory }
     });
     _network        = network;
     _dropboxFactory = dropboxFactory;
     DropBoxHelper   = dropboxHelper;
     CookieHelper.Clear();
     if (shouldAuthorise)
     {
         Authorise();
     }
 }
 internal ServerExplorerRepository(IResourceCatalog resourceCatalog, IExplorerItemFactory explorerItemFactory, IDirectory directory, IExplorerRepositorySync sync, IServerVersionRepository versionRepository, IFile file)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object>
     {
         { "resourceCatalog", resourceCatalog },
         { "explorerItemFactory", explorerItemFactory },
         { "directory", directory }
     });
     _sync               = sync;
     _file               = file;
     VersionRepository   = versionRepository;
     ResourceCatalogue   = resourceCatalog;
     ExplorerItemFactory = explorerItemFactory;
     Directory           = directory;
 }
Example #18
0
        public ServerSchedulerFactory(IDev2TaskService service, ITaskServiceConvertorFactory factory, IDirectory directory, Func <IScheduledResource, string> pathResolve)
        {
            var nullables = new Dictionary <string, object>
            {
                { "service", service },
                { "factory", factory },
                { "directory", directory },
            };

            VerifyArgument.AreNotNull(nullables);
            _service     = service;
            _factory     = factory;
            _dir         = directory;
            _pathResolve = pathResolve;
            CreateDir();
        }
Example #19
0
        public SingleExplorerDeployViewModel(IDeployDestinationExplorerViewModel destination, IDeploySourceExplorerViewModel source, IEnumerable <IExplorerTreeItem> selectedItems, IDeployStatsViewerViewModel stats, IShellViewModel shell, IPopupController popupController, IAsyncWorker asyncWorker)
        {
            VerifyArgument.AreNotNull(new Dictionary <string, object> {
                { "destination", destination }, { "source", source }, { "selectedItems", selectedItems }, { "stats", stats }, { "popupController", popupController }
            });
            _destination = destination;

            PopupController = popupController;

            _source             = source;
            _errorMessage       = "";
            _source.Preselected = selectedItems;
            _stats = stats;
            _shell = shell;
            _stats.CalculateAction = () =>
            {
                IsDeployLoading        = true;
                ServicesCount          = _stats.Services.ToString();
                SourcesCount           = _stats.Sources.ToString();
                TestsCount             = _stats.Tests.ToString();
                TriggersCount          = _stats.Triggers.ToString();
                NewResourcesCount      = _stats.NewResources.ToString();
                NewTestsCount          = _stats.NewTests.ToString();
                NewTriggersCount       = _stats.NewTriggers.ToString();
                OverridesCount         = _stats.Overrides.ToString();
                OverridesTestsCount    = _stats.OverridesTests.ToString();
                OverridesTriggersCount = _stats.OverridesTriggers.ToString();
                ConflictItems          = _stats.Conflicts;
                NewItems      = _stats.New;
                ShowConflicts = false;
                ViewModelUtils.RaiseCanExecuteChanged(DeployCommand);
                IsDeployLoading = false;
            };
            SourceConnectControlViewModel      = _source.ConnectControlViewModel;
            DestinationConnectControlViewModel = _destination.ConnectControlViewModel;

            SourceConnectControlViewModel.SelectedEnvironmentChanged      += UpdateServerCompareChanged;
            DestinationConnectControlViewModel.SelectedEnvironmentChanged += UpdateServerCompareChanged;
            DeployCommand                   = new DelegateCommand(Deploy, () => CanDeploy);
            SelectDependenciesCommand       = new DelegateCommand(SelectDependencies, () => CanSelectDependencies);
            NewResourcesViewCommand         = new DelegateCommand(ViewNewResources);
            OverridesViewCommand            = new DelegateCommand(ViewOverrides);
            Destination.ServerStateChanged += DestinationServerStateChanged;
            Destination.PropertyChanged    += DestinationOnPropertyChanged;
            ShowConflicts                   = false;
        }
Example #20
0
 public ServerVersionRepository(IVersionStrategy versionStrategy, IResourceCatalog catalogue, IDirectory directory, string rootPath, IFile file)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object>
     {
         { "versionStrategy", versionStrategy },
         { "catalogue", catalogue },
         { "directory", directory },
         { "rootPath", rootPath },
         { "file", file }
     }
                               );
     _versionStrategy = versionStrategy;
     _catalogue       = catalogue;
     _directory       = directory;
     _rootPath        = rootPath;
     _file            = file;
 }
 public ServerExplorerRepository(IResourceCatalog resourceCatalog, IExplorerItemFactory explorerItemFactory, IDirectory directory, IExplorerRepositorySync sync, IServerVersionRepository versionRepository, IFile file, ITestCatalog testCatalog)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object>
     {
         { "resourceCatalog", resourceCatalog },
         { "explorerItemFactory", explorerItemFactory },
         { "directory", directory },
         { nameof(testCatalog), testCatalog }
     });
     _sync               = sync;
     _file               = file;
     VersionRepository   = versionRepository;
     ResourceCatalogue   = resourceCatalog;
     ExplorerItemFactory = explorerItemFactory;
     Directory           = directory;
     TestCatalog         = testCatalog;
     IsDirty             = false;
 }
        public SingleExplorerDeployViewModel(IDeployDestinationExplorerViewModel destination, IDeploySourceExplorerViewModel source, IEnumerable <IExplorerTreeItem> selectedItems, IDeployStatsViewerViewModel stats, IShellViewModel shell, IPopupController popupController)
        {
            VerifyArgument.AreNotNull(new Dictionary <string, object> {
                { "destination", destination }, { "source", source }, { "selectedItems", selectedItems }, { "stats", stats }, { "popupController", popupController }
            });
            _destination = destination;
            // ReSharper disable once VirtualMemberCallInContructor
            PopupController = popupController;

            _source             = source;
            _errorMessage       = "";
            _source.Preselected = selectedItems;
            _stats = stats;
            _shell = shell;
            _stats.CalculateAction = () =>
            {
                ServicesCount     = _stats.Services.ToString();
                SourcesCount      = _stats.Sources.ToString();
                NewResourcesCount = _stats.NewResources.ToString();
                OverridesCount    = _stats.Overrides.ToString();
                ConflictItems     = _stats.Conflicts;
                NewItems          = _stats.New;
                ShowConflicts     = false;
                if (!string.IsNullOrEmpty(_stats.RenameErrors))
                {
                    PopupController.ShowDeployNameConflict(_stats.RenameErrors);
                }
                ViewModelUtils.RaiseCanExecuteChanged(DeployCommand);
            };
            SourceConnectControlViewModel      = _source.ConnectControlViewModel;
            DestinationConnectControlViewModel = _destination.ConnectControlViewModel;

            SourceConnectControlViewModel.SelectedEnvironmentChanged      += UpdateServerCompareChanged;
            DestinationConnectControlViewModel.SelectedEnvironmentChanged += UpdateServerCompareChanged;
            DeployCommand                   = new DelegateCommand(Deploy, () => CanDeploy);
            SelectDependenciesCommand       = new DelegateCommand(SelectDependencies, () => CanSelectDependencies);
            NewResourcesViewCommand         = new DelegateCommand(ViewNewResources);
            OverridesViewCommand            = new DelegateCommand(ViewOverrides);
            Destination.ServerStateChanged += DestinationServerStateChanged;
            Destination.PropertyChanged    += DestinationOnPropertyChanged;
            ShowConflicts                   = false;
        }
Example #23
0
        public void VerifyArgumentsTest_AreNotNull_Throws()
        {
            try
            {
                VerifyArgument.AreNotNull(new Dictionary <string, object>
                {
                    { "a", new object() },
                    { "b", "" },
                    { "c", null },
                    { "d", null },
                    { "e", "" },
                    { "f", "" }
                });
            }
            catch (Exception e)
            {
                Assert.AreEqual(@"The following arguments are not allowed to be null: c
d
", e.Message);
                throw;
            }
        }
Example #24
0
        public void VerifyArgumentsTest_AreNotNull_Throws()
        {
            try
            {
                VerifyArgument.AreNotNull(new Dictionary <string, object>
                {
                    { "a", new object() },
                    { "b", "" },
                    { "c", null },
                    { "d", null },
                    { "e", "" },
                    { "f", "" }
                });
            }
            catch (Exception e)
            {
                var message = e.Message;

                var expected = @"The following arguments are not allowed to be null: cd";
                FixBreaks(ref expected, ref message);
                Assert.AreEqual(expected, message);
                throw;
            }
        }