Beispiel #1
0
        public SettingsViewModel(IEventAggregator eventPublisher, IPopupController popupController, IAsyncWorker asyncWorker, IWin32Window parentWindow, IConnectControlViewModel connectControlViewModel)
            : base(eventPublisher)
        {
            Settings = new Data.Settings.Settings();
            VerifyArgument.IsNotNull("popupController", popupController);
            _popupController = popupController;
            VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
            _asyncWorker = asyncWorker;
            VerifyArgument.IsNotNull("parentWindow", parentWindow);
            _parentWindow = parentWindow;

            SaveCommand = new RelayCommand(o => SaveSettings(), o => IsDirty);
            ServerChangedCommand = new DelegateCommand(OnServerChanged);

            ConnectControlViewModel = connectControlViewModel ?? new ConnectControlViewModel(OnServerChanged, "Server:", false);
        }
Beispiel #2
0
        public SchedulerViewModel(IEventAggregator eventPublisher, DirectoryObjectPickerDialog directoryObjectPicker, IPopupController popupController, IAsyncWorker asyncWorker, IConnectControlViewModel connectControlViewModel)
            : base(eventPublisher)
        {
            VerifyArgument.IsNotNull("directoryObjectPicker", directoryObjectPicker);
            DirectoryObjectPickerDialog directoryObjectPicker1 = directoryObjectPicker;

            VerifyArgument.IsNotNull("popupController", popupController);
            _popupController = popupController;

            VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
            _asyncWorker = asyncWorker;

            IsLoading = false;
            directoryObjectPicker1.AllowedObjectTypes = ObjectTypes.Users;
            directoryObjectPicker1.DefaultObjectTypes = ObjectTypes.Users;
            directoryObjectPicker1.AllowedLocations = Locations.All;
            directoryObjectPicker1.DefaultLocations = Locations.JoinedDomain;
            directoryObjectPicker1.MultiSelect = false;
            directoryObjectPicker1.TargetComputer = string.Empty;
            directoryObjectPicker1.ShowAdvancedView = false;

            InitializeHelp();

            var taskServiceConvertorFactory = new TaskServiceConvertorFactory();
            SchedulerFactory = new ClientSchedulerFactory(new Dev2TaskService(taskServiceConvertorFactory), taskServiceConvertorFactory);
            ConnectControlViewModel = connectControlViewModel ?? new ConnectControlViewModel(OnServerChanged, "Server: ", false);
        }
        public SettingsViewModel(IEventAggregator eventPublisher, IPopupController popupController, IAsyncWorker asyncWorker, IWin32Window parentWindow, IConnectControlViewModel connectControlViewModel)
            : base(eventPublisher)
        {
            Settings = new Data.Settings.Settings();
            VerifyArgument.IsNotNull("popupController", popupController);
            _popupController = popupController;
            VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
            _asyncWorker = asyncWorker;
            VerifyArgument.IsNotNull("parentWindow", parentWindow);
            _parentWindow = parentWindow;

            SaveCommand          = new RelayCommand(o => SaveSettings(), o => IsDirty);
            ServerChangedCommand = new DelegateCommand(OnServerChanged);

            ConnectControlViewModel = connectControlViewModel ?? new ConnectControlViewModel(OnServerChanged, "Server:", false);
        }
Beispiel #4
0
        public SchedulerViewModel(IEventAggregator eventPublisher, DirectoryObjectPickerDialog directoryObjectPicker, IPopupController popupController, IAsyncWorker asyncWorker, IConnectControlViewModel connectControlViewModel)
            : base(eventPublisher)
        {
            VerifyArgument.IsNotNull("directoryObjectPicker", directoryObjectPicker);
            DirectoryObjectPickerDialog directoryObjectPicker1 = directoryObjectPicker;

            VerifyArgument.IsNotNull("popupController", popupController);
            _popupController = popupController;

            VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
            _asyncWorker = asyncWorker;

            IsLoading = false;
            directoryObjectPicker1.AllowedObjectTypes = ObjectTypes.Users;
            directoryObjectPicker1.DefaultObjectTypes = ObjectTypes.Users;
            directoryObjectPicker1.AllowedLocations   = Locations.All;
            directoryObjectPicker1.DefaultLocations   = Locations.JoinedDomain;
            directoryObjectPicker1.MultiSelect        = false;
            directoryObjectPicker1.TargetComputer     = string.Empty;
            directoryObjectPicker1.ShowAdvancedView   = false;

            InitializeHelp();

            var taskServiceConvertorFactory = new TaskServiceConvertorFactory();

            SchedulerFactory        = new ClientSchedulerFactory(new Dev2TaskService(taskServiceConvertorFactory), taskServiceConvertorFactory);
            ConnectControlViewModel = connectControlViewModel ?? new ConnectControlViewModel(OnServerChanged, "Server: ", false);
        }
        public ExplorerViewModel(IEventAggregator eventPublisher, IAsyncWorker asyncWorker, IEnvironmentRepository environmentRepository, IStudioResourceRepository studioResourceRepository, IConnectControlSingleton connectControlSingleton, IMainViewModel mainViewModel, bool isFromActivityDrop = false, enDsfActivityType activityType = enDsfActivityType.All, System.Action updateWorkSpaceItems = null, IConnectControlViewModel connectControlViewModel = null)
            : base(eventPublisher)
        {
            VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
            VerifyArgument.IsNotNull("environmentRepository", environmentRepository);
            VerifyArgument.IsNotNull("connectControlSingleton", connectControlSingleton);

            EnvironmentRepository = environmentRepository;

            NavigationViewModel = new NavigationViewModel(eventPublisher, asyncWorker, Context, environmentRepository, studioResourceRepository, connectControlSingleton, updateWorkSpaceItems, isFromActivityDrop, activityType)
            {
                Parent = this
            };

            ConnectControlViewModel = connectControlViewModel ?? new ConnectControlViewModel(mainViewModel, AddEnvironment, "Connect:", true);
        }
 public MainViewModelMock(IEventAggregator eventPublisher, IAsyncWorker asyncWorker, IEnvironmentRepository environmentRepository, IVersionChecker versionChecker, IStudioResourceRepository studioResourceRepository, IConnectControlSingleton connectControlSingleton, IConnectControlViewModel connectControlViewModel, bool createDesigners = true, IBrowserPopupController browserPopupController = null)
     : base(eventPublisher, asyncWorker, environmentRepository, versionChecker, createDesigners, browserPopupController, studioResourceRepository:studioResourceRepository, connectControlSingleton:connectControlSingleton, connectControlViewModel: connectControlViewModel)
 {
 }
Beispiel #7
0
 public MainViewModelMock(IEventAggregator eventPublisher, IAsyncWorker asyncWorker, IEnvironmentRepository environmentRepository, IVersionChecker versionChecker, IStudioResourceRepository studioResourceRepository, IConnectControlSingleton connectControlSingleton, IConnectControlViewModel connectControlViewModel, bool createDesigners = true, IBrowserPopupController browserPopupController = null)
     : base(eventPublisher, asyncWorker, environmentRepository, versionChecker, createDesigners, browserPopupController, studioResourceRepository: studioResourceRepository, connectControlSingleton: connectControlSingleton, connectControlViewModel: connectControlViewModel)
 {
 }
Beispiel #8
0
 // ReSharper disable TooManyDependencies
 /// <summary>
 /// DI constructor
 /// </summary>
 /// <param name="asyncWorker"> async worker</param>
 /// <param name="serverProvider">server provider</param>
 /// <param name="environmentRepository"> environments </param>
 /// <param name="eventAggregator"> caliburn event handlers</param>
 /// <param name="studioResourceRepository"> studio repository </param>
 /// <param name="sourceConnectControlVm"> source server connect control</param>
 /// <param name="destinationConnectControlVm"> destination server connect control</param>
 /// <param name="deployStatsCalculator"> calculator for new overwritten totla resources</param>
 /// <param name="resourceID"> resource id</param>
 /// <param name="environmentID">environment id</param>
 /// <param name="connectControlSingleton">connect control</param>
 public DeployViewModel(IAsyncWorker asyncWorker, IEnvironmentModelProvider serverProvider, IEnvironmentRepository environmentRepository, IEventAggregator eventAggregator, IStudioResourceRepository studioResourceRepository, IConnectControlViewModel sourceConnectControlVm, IConnectControlViewModel destinationConnectControlVm, IDeployStatsCalculator deployStatsCalculator = null, Guid?resourceID = null, Guid?environmentID = null, IConnectControlSingleton connectControlSingleton = null)
 // ReSharper restore TooManyDependencies
     : base(eventAggregator)
 {
     VerifyArgument.IsNotNull("asyncWorker", asyncWorker);
     if (connectControlSingleton == null)
     {
         connectControlSingleton = ConnectControlSingleton.Instance;
     }
     if (environmentID.HasValue)
     {
         _initialItemEnvironmentID = environmentID.Value;
     }
     _initialItemResourceID      = resourceID.GetValueOrDefault(Guid.Empty);
     DestinationServerHasDropped = false;
     StudioResourceRepository    = studioResourceRepository;
     Initialize(asyncWorker, serverProvider, environmentRepository, eventAggregator, connectControlSingleton, deployStatsCalculator);
     SourceConnectControlViewModel = sourceConnectControlVm ?? new ConnectControlViewModel(ChangeSourceServer, "Source Server:", false);
     TargetConnectControlViewModel = destinationConnectControlVm ?? new ConnectControlViewModel(ChangeDestinationServer, "Destination Server:", false);
     TargetConnectControlViewModel.SetTargetEnvironment();
 }