Пример #1
0
        private void _rightMenuButton_Clicked(object sender, System.EventArgs e)
        {
            switch (RightMenu)
            {
            case RightMenuIcon.Add:
                AddCommand?.Execute(null);
                break;

            case RightMenuIcon.CustomText:
            case RightMenuIcon.CustomIcon:
                RightMenuCommand?.Execute(null);
                break;

            case RightMenuIcon.Delete:
                DeleteCommand?.Execute(null);
                break;

            case RightMenuIcon.Edit:
                EditCommand?.Execute(null);
                break;

            case RightMenuIcon.Save:
                SaveCommand?.Execute(null);
                break;

            case RightMenuIcon.Settings:
                SettingsCommand?.Execute(null);
                break;
            }
        }
Пример #2
0
        private void ChangesetDownload()
        {
            if (string.IsNullOrWhiteSpace(Settings.Default.TfsServerName))
            {
                if (IoC.Get <IMessageBoxService>().ShowOkCancel("TFS Server must be specified. Enter now?", "Required Data"))
                {
                    SettingsCommand.Execute(null);
                }
            }

            if (string.IsNullOrWhiteSpace(Settings.Default.TfsServerName))
            {
                return;
            }

            //TODO: save last work item id in settings and pass in a default?
            //TODO: work item id validation?
            var vm  = new WorkItemSelectorViewModel();
            var msg = new ModalMessage <WorkItemSelectorViewModel>(
                vm, (confirm, resultVm) =>
            {
                if (!confirm || !resultVm.WorkItemId.HasValue)
                {
                    return;
                }

                try
                {
                    this.BusyText = "Getting work item info from TFS";
                    this.IsBusy   = true;
                    //TODO: use command pattern for this
                    var known  = IoC.Get <KnownFileTypes>();
                    var csInfo = new ChangesetInfo(Settings.Default.TfsServerName, known);
                    csInfo.GetInfo(resultVm.WorkItemId.Value);
                    this.BusyText = "Downloading work item files";
                    csInfo.Downloader.DownloadAllFiles();
                    csInfo.Downloader.OpenWorkItemDirectory();
                }
                finally
                {
                    this.IsBusy = false;
                }
            });

            Messenger.Default.Send(msg);
        }
        private void ExecuteSynchronizeCommand()
        {
            Logger.Instance.Information("Synchronize now menu from icon in the task bar clicked.");

            var cloudStorageService = ServiceLocator.GetService <CloudStorageService>();

            if (cloudStorageService.IsLinkedToAService)
            {
                if (!cloudStorageService.IsSynchronizing)
                {
                    cloudStorageService.SynchronizeAsync();
                }
            }
            else
            {
                SettingsCommand.Execute(SettingsViewMode.Synchronization);
            }
        }
Пример #4
0
		// Token: 0x060000E4 RID: 228 RVA: 0x00004150 File Offset: 0x00002350
		private bool CheckVitality(StepContext stepContext)
		{
			SettingsCommand settingsCommand = new SettingsCommand(stepContext.EasConnectionSettings);
			bool result;
			try
			{
				settingsCommand.Execute(SettingsRequest.Default);
				result = true;
			}
			catch (LocalizedException ex)
			{
				stepContext.EasConnectionSettings.Log.Error("Failed to check vitality: {0}", new object[]
				{
					ex
				});
				result = false;
			}
			return result;
		}
Пример #5
0
        SettingsResponse IEasConnection.Settings(SettingsRequest settingsRequest)
        {
            SettingsCommand settingsCommand = new SettingsCommand(this.EasConnectionSettings);

            return(settingsCommand.Execute(settingsRequest));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowViewModel" /> class.
        /// </summary>
        internal MainWindowViewModel()
        {
            MonitorSettingsContainer.LoadAllSettings();

            List <BuildInformation> builds = new List <BuildInformation>();

            foreach (var buildServer in MonitorSettingsContainer.BuildServers)
            {
                builds.AddRange(buildServer.GetBuilds());
            }

            selectedRefreshInterval = MonitorSettingsContainer.MonitorSettings.RefreshInterval;
            selectedZoomFactor      = (int)(zoomFactor * 100);
            PinBuildViews           = new List <PinBuildView>();
            BuildAdapters           = new ObservableCollection <BuildAdapter>(builds.Select(build => new BuildAdapter(this, build, false)));

            AvailableTags = new ObservableCollection <FilterTag>(new[] { new FilterTag {
                                                                             IsAllFilter = true, IsSelected = true, Label = Resources.AllFilterLabel
                                                                         } });
            FillAvailableTags();

            CollectionViewSourceBuildAdapters = new CollectionViewSource {
                Source = BuildAdapters
            };
            CollectionViewSourceBuildAdapters.Filter += CollectionViewSourceBuildAdaptersFilter;
            SelectedBuildAdapters = new ObservableCollection <BuildAdapter>();

            ActualValue            = Maximum = MonitorSettingsContainer.MonitorSettings.RefreshInterval;
            this.bigSizeMode       = MonitorSettingsContainer.MonitorSettings.BigSize;
            this.useFullWidth      = MonitorSettingsContainer.MonitorSettings.UseFullWidth;
            this.zoomFactor        = MonitorSettingsContainer.MonitorSettings.ZoomFactor;
            this.isRibbonMinimized = MonitorSettingsContainer.MonitorSettings.RibbonMinimized;

            ApplyExistingTagToBuildCommand = new ApplyExistingTagToBuildCommand(this);
            ApplyNewTagToBuildCommand      = new ApplyNewTagToBuildCommand(this);
            RemoveTagFromBuildCommand      = new RemoveTagFromBuildCommand(this);
            RefreshCommand            = new RelayCommand(Refresh);
            SetRefreshIntervalCommand = new RelayCommand(SetRefreshInterval);
            SetZoomFactorCommand      = new RelayCommand(SetZoomFactor);
            CloseCommand          = new CloseCommand(null);
            AboutCommand          = new RelayCommand(About);
            SettingsCommand       = new SettingsCommand(this);
            NotificationCommand   = new NotificationCommand();
            MinimizeRibbonCommand = new RelayCommand(o => IsRibbonMinimized = !IsRibbonMinimized);
            DoFilterCommand       = new RelayCommand(DoFilter);
            BigSizeModeCommand    = new RelayCommand(o => BigSizeMode = !BigSizeMode);

            var intervals = new List <int>();

            for (var i = 15; i <= 300; i += 15)
            {
                intervals.Add(i);
            }

            RefreshIntervals = new ObservableCollection <int>(intervals);

            var factors = new List <int>();

            for (var i = 100; i <= 300; i += 25)
            {
                factors.Add(i);
            }

            ZoomFactors = new ObservableCollection <int>(factors);

            Refresh();

            var dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal)
            {
                Interval = TimeSpan.FromSeconds(1)
            };

            dispatcherTimer.Tick += DispatcherTimerTick;
            dispatcherTimer.Start();

            if (!MonitorSettingsContainer.BuildServers.Any())
            {
                SettingsCommand.Execute(null);
            }
        }