/// <summary>
        /// This method is called when VS wants to save the user's changes then the dialog is dismissed.
        /// </summary>
        protected override void OnApply(PageApplyEventArgs e)
        {
            string messageText = Resources.ResourceManager.GetString("ApplyProviderOptions");
            string messageCaption = Resources.ResourceManager.GetString("ProviderName");

            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
            Guid clsid = Guid.Empty;
            int result = VSConstants.S_OK;
            if (uiShell.ShowMessageBox(0, ref clsid,
                                messageCaption,
                                messageText,
                                string.Empty,
                                0,
                                OLEMSGBUTTON.OLEMSGBUTTON_OKCANCEL,
                                OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                                OLEMSGICON.OLEMSGICON_QUERY,
                                0,        // false = application modal; true would make it system modal
                                out result) != VSConstants.S_OK
                || result != (int)DialogResult.OK)
            {
                e.ApplyBehavior = ApplyKind.Cancel;
            }
            else
            {
                base.OnApply(e);
            }
        }
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
                TfsPendingChangesMarginPackage.RaiseGeneralSettingsChanged();
        }
 protected override void OnApply(PageApplyEventArgs e)
 {
     var debugControl = page as DebuggingOptionsPageControl;
     if (e.ApplyBehavior == ApplyKind.Apply && debugControl != null)
         debugControl.ApplySettings(this);
     base.OnApply(e);
 }
示例#4
0
 protected override void OnApply(PageApplyEventArgs e)
 {
     // Do not need to call base.OnApply() here.
     bool wasApplied = this.OptionsControl.ApplyChangedSettings();
     if (!wasApplied) {
         e.ApplyBehavior = ApplyKind.CancelNoNavigate;
     }
 }
示例#5
0
 /// <summary>
 /// Fired before OnClosed. Fired only when closing via Apply.
 /// That's why we can't detect clicking Cancel
 /// </summary>
 /// <param name="e"></param>
 protected override void OnApply(PageApplyEventArgs e)
 {
     if (e.ApplyBehavior == ApplyKind.Apply)
     {
         SavedOptions.Instance.SaveOptions();
     }
     base.OnApply(e);
 }
 /// <summary>
 /// Handles Apply messages from the Visual Studio environment.
 /// </summary>
 /// <param name="e">[in] Arguments to event handler.</param>
 protected override void OnApply(PageApplyEventArgs e)
 {
     Debug.Assert(_view != null);
     var viewModel = _view.DataContext as AvaloniaDesignerGeneralPageViewModel;
     Debug.Assert(viewModel != null);
     viewModel.ApplyChanges();
     base.OnApply(e);
 }
示例#7
0
		protected override void OnApply(PageApplyEventArgs e)
		{
			base.OnApply(e);

			if (e.ApplyBehavior == ApplyKind.Apply && OnOptionsChanged != null)
			{
				OnOptionsChanged(this, EventArgs.Empty);
			}
		}
示例#8
0
        /// <summary>
        /// Handles Apply messages from the Visual Studio environment.
        /// </summary>
        /// <param name="e">[in] Arguments to event handler.</param>
        protected override void OnApply(PageApplyEventArgs e)
        {
            Debug.Assert(_view != null);
            var viewModel = _view.DataContext as AvaloniaDesignerGeneralPageViewModel;

            Debug.Assert(viewModel != null);
            viewModel.ApplyChanges();
            base.OnApply(e);
        }
示例#9
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                SettingsStore.SaveSettings(pageControl.Settings);
            }

            base.OnApply(e);
        }
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                ((OptionsControlViewModel)_optionsControl.DataContext).Save();
            }
        }
示例#11
0
        protected override void OnApply(PageApplyEventArgs args)
        {
            if (args.ApplyBehavior == ApplyKind.Apply)
            {
                SaveSettings();
            }

            base.OnApply(args);
        }
示例#12
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                TfsPendingChangesMarginPackage.RaiseGeneralSettingsChanged();
            }
        }
示例#13
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (!PkgdefEnableColorizer)
            {
                PkgdefShowIntellisense = false;
            }

            base.OnApply(e);
        }
示例#14
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                FontSettingsManager.SaveCurrent();
            }

            base.OnApply(e);
        }
示例#15
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (!PkgdefEnableColorizer)
            {
                PkgdefShowIntellisense = false;
            }

            base.OnApply(e);
        }
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                UpdateConfig();
            }
        }
        protected override void OnApply(PageApplyEventArgs args) {
            if (args.ApplyBehavior == ApplyKind.Apply) {

                HighlightReferencesUnderCursor  = _advancedOptionsControl.HighlightReferencesUnderCursor.IsChecked.GetValueOrDefault();
                HighlightReferencesUnderInclude = _advancedOptionsControl.HighlightReferencesUnderInclude.IsChecked.GetValueOrDefault();
            }

            base.OnApply(args);
        }
示例#18
0
 protected override void OnApply(PageApplyEventArgs e)
 {
     base.OnApply(e);
     if (e.ApplyBehavior != ApplyKind.Apply)
     {
         return;
     }
     this.SettingsChanged?.Invoke(this, EventArgs.Empty);
 }
示例#19
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (_keyboardSettingsControl != null)
            {
                _keyboardSettingsControl.Apply();
            }

            base.OnApply(e);
        }
示例#20
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            DiffClipboardWithCodeCommand.Instance.Turn(DiffClipboardWithCodeEnabled);
            DiffClipboardWithFileCommand.Instance.Turn(DiffClipboardWithFileEnabled);

            DiffToolFactory.ClearCache();

            base.OnApply(e);
        }
示例#21
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (_keyboardSettingsControl != null)
            {
                _keyboardSettingsControl.Apply();
            }

            base.OnApply(e);
        }
示例#22
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (e.ApplyBehavior == ApplyKind.Apply && _viewModel.ApplyCommand.CanExecute(null))
            {
                _viewModel.ApplyCommand.Execute(null);
            }

            base.OnApply(e);
        }
示例#23
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                UpdateFeatureStates();
            }

            base.OnApply(e);
        }
示例#24
0
 protected override void OnApply(PageApplyEventArgs e)
 {
     if (e.ApplyBehavior == ApplyKind.Apply)
     {
         _holder.Apply();
         RtvsTelemetry.Current.ReportSettings();
     }
     base.OnApply(e);
 }
示例#25
0
 protected override void OnApply(PageApplyEventArgs e)
 {
     base.OnApply(e);
     Options.SemanticColoringEnabled  = Control.SemanticColoringBox.IsChecked.GetValueOrDefault();
     Options.OccurrenceTaggingEnabled = Control.OccurrenceTaggingBox.IsChecked.GetValueOrDefault();
     Options.DimPatternsString        = Control.DimPatterns.Text;
     Options.EmphasizePatternsString  = Control.HighlightPatterns.Text;
     SaveSettingsToStorage();
 }
        protected override void OnApply(PageApplyEventArgs args)
        {
            //if (args.ApplyBehavior == ApplyKind.Apply)
            //{
            //	this.workspaceSettingsDialogControl.ViewModel.Apply();
            //}

            base.OnApply(args);
        }
 protected override void OnApply(PageApplyEventArgs args)
 {
     base.OnApply(args);
     AllocationRules.Settings.Enabled              = Enabled;
     AllocationRules.Settings.IgnoredAttributes    = IgnoredAttributes;
     AllocationRules.Settings.IgnoredFilesPatterns = IgnoredFilesPatterns;
     AllocationRules.Settings.OnlyReportOnHotPath  = OnlyReportOnHotPath;
     AllocationRules.Settings.HotPathAttributes    = HotPathAttributes;
 }
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                Settings.ShowServerNuGetTrustWarning = dialogControl.ShowServerNuGetTrustWarning.IsChecked.Value;
            }

            base.OnApply(e);
        }
示例#29
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                OnApply();
            }

            base.OnApply(e);
        }
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                SaveToSetting();
            }
        }
        protected override void OnApply(PageApplyEventArgs args)
        {
            if (args.ApplyBehavior == ApplyKind.Apply)
            {
                this.optionsDialogControl.ViewModel.Apply();
            }

            base.OnApply(args);
        }
示例#32
0
        protected override void OnApply(PageApplyEventArgs args)
        {
            if (args.ApplyBehavior == ApplyKind.Apply)
            {
                SaveSettings();
            }

            base.OnApply(args);
        }
示例#33
0
        protected override void OnApply(PageApplyEventArgs args)
        {
            base.OnApply(args);
            Settings.Instance.RawRepositoryPath = RepositoryPath;

            var output = new OutputWindowWrapper(ServiceProvider.GlobalProvider);

            output.WriteLine("New path to persist data: {0}", Settings.Instance.RepositoryPath);
        }
        private async Task OnApplyAsync(PageApplyEventArgs e, CancellationToken cancellationToken)
        {
            bool wasApplied = await PackageSourcesControl.ApplyChangedSettingsAsync(cancellationToken);

            if (!wasApplied)
            {
                e.ApplyBehavior = ApplyKind.CancelNoNavigate;
            }
        }
 protected override void OnApply(PageApplyEventArgs e)
 {
     // Do not need to call base.OnApply() here.
     DoCancelableOperationWithProgressUI(() =>
     {
         // Normally we shouldn't wrap JTF around BrokeredCalls but this is in a cancelable operation already
         NuGetUIThreadHelper.JoinableTaskFactory.Run(async() => await OnApplyAsync(e, CancellationToken));
     }, Resources.PackageSourceOptions_OnApply);
 }
        protected override void OnApply(PageApplyEventArgs e) {
            if (_control != null) {
                CppOptions = _control.CppOptions;
                CsOptions = _control.CsOptions;
                CppFormatOnSave = _control.CppFormatOnSave;
                CsFormatOnSave = _control.CsFormatOnSave;
            }

            base.OnApply(e);
        }
 protected override void OnApply(PageApplyEventArgs e)
 {
     base.OnApply(e);
     this.SanitizeData();
     var handler = this.OnPackageOptionsChanged;
     if (handler != null)
     {
         handler(null, new PackageOptionsChangedEventArgs(this));
     }
 }
示例#38
0
        protected override void OnApply(PageApplyEventArgs args)
        {
            if(args.ApplyBehavior == ApplyKind.Apply)
              {
            var options = GetOptions();
            options.Update(IndentSize, CompilerPath, SrcPath);
              }

              base.OnApply(args);
        }
示例#39
0
        protected override void OnApply(PageApplyEventArgs args)
        {
            if (args.ApplyBehavior == ApplyKind.Apply)
            {
                string[] userEncouragments = optionsDialogControl.Encouragements.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
                GetEncouragements().AllEncouragements = userEncouragments;
            }

            base.OnApply(args);
        }
示例#40
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                Configuration.InlineMethodsBody = this.InlineMethodsBody;
                Configuration.CheckerArguments  = this.CheckerArguments;
            }
        }
示例#41
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (e.ApplyBehavior == ApplyKind.Apply)
            {
                SettingsManager.Instance.UpdateVisualStudioSettings(this);
                SettingsManager.Instance.ApplyTo(CodeFixSettings.Current);
            }
        }
示例#42
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            // Clean up the path
            CachePath = CachePath.Replace("/", "\\");

            if (string.IsNullOrEmpty(CachePath))
                e.ApplyBehavior = ApplyKind.Cancel;
            else
                base.OnApply(e);
        }
        protected override void OnApply(PageApplyEventArgs e)
        {
            // Do not need to call base.OnApply() here.
            bool wasApplied = PackageSourcesControl.ApplyChangedSettings();

            if (!wasApplied)
            {
                e.ApplyBehavior = ApplyKind.CancelNoNavigate;
            }
        }
示例#44
0
        // When the user presses the OK button
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);
            var pageControl = Child as OptionsPageControl;

            if (pageControl != null)
            {
                pageControl.ShouldSaveChanges = true;
            }
        }
示例#45
0
        protected override void OnApply(PageApplyEventArgs args)
        {
            //if (args.ApplyBehavior == ApplyKind.Apply)
            //{
            //    string[] userEncouragments = optionsDialogControl.Encouragements.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
            //    GetEncouragements().AllEncouragements = userEncouragments;
            //}

            base.OnApply(args);
        }
 protected override void OnApply(PageApplyEventArgs e)
 {
     if (!String.IsNullOrEmpty(this.BackgroundImageFile) &&
         !File.Exists(this.BackgroundImageFile))
     {
         e.ApplyBehavior = ApplyKind.Cancel;
         MessageBox.Show(Window, "The specified path for the background image file is invalid. Please enter a valid path.", "AddOn Studio for World of Warcraft", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
         base.OnApply(e);
 }
 protected override void OnApply(PageApplyEventArgs e)
 {
     base.OnApply(e);
     if (OptionsChanged != null)
     {
         var optionsEventArg = new OptionsChangedEventArgs
         {
             AppVeyorOptions = this
         };
         OptionsChanged(this, optionsEventArg);
     }
 }
        protected override void OnApply(PageApplyEventArgs args)
        {
            //if (args.ApplyBehavior == ApplyKind.Apply)
            //{
            //    settingsPageControl.CommitChanges();

            //    // Save settings
            //    var templateProvider = GetTemplateProvider();
            //    templateProvider.TemplateDefinitions = settingsPageControl.Templates;
            //}

            base.OnApply(args);
        }
示例#49
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            if (_optionService.GetOption(LoggerOptions.EtwLoggerKey))
            {
                Logger.SetLogger(AggregateLogger.AddOrReplace(new EtwLogger(_optionService), Logger.GetLogger(), l => l is EtwLogger));
            }

            if (_optionService.GetOption(LoggerOptions.TraceLoggerKey))
            {
                Logger.SetLogger(AggregateLogger.AddOrReplace(new TraceLogger(_optionService), Logger.GetLogger(), l => l is TraceLogger));
            }
        }
示例#50
0
    protected override void OnApply(PageApplyEventArgs e) {
      base.OnApply(e);

      if (e.ApplyBehavior != ApplyKind.Apply)
        return;

      var componentModel = (IComponentModel)this.GetService(typeof(SComponentModel));
      if (componentModel == null) {
        Logger.LogError("No component model found in DialogPage.");
        return;
      }

      var bus = componentModel.DefaultExportProvider.GetExportedValue<IEventBus>();
      bus.Fire("ToolsOptionsPageApply", this, new EventArgs());
    }
示例#51
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            bool saved = settingControl.ValidateAndSave();

            if (saved)
            {
                OnSettingsChanged(EventArgs.Empty);
            }
            else
            {
                e.ApplyBehavior = ApplyKind.CancelNoNavigate;
            }

            base.OnApply(e);
        }
 protected override void OnApply(PageApplyEventArgs e) {
     base.OnApply(e);
     bool flag = OnOptionsChanged == null;
     if (!flag) {
         var optionsEventArg = new OptionsChangedEventArgs
         {
             PauseWhileDebugging = PauseWhileDebugging,
             Interval = TimerSaveInterval,
             MaximumShelvesets = MaximumShelvesets,
         	OutputPane = OutputPane,
             ShelvesetName = ShelvesetName,
         };
         OnOptionsChanged(this, optionsEventArg);
     }
 }
 protected override void OnApply(PageApplyEventArgs e)
 {
     Properties.Settings.Default.MaxRowsToEdit = MaxRowsToEdit;
     Properties.Settings.Default.MaxColumnWidth = MaxColumnWidth;
     Properties.Settings.Default.MultiLineTextEntry = MultiLineTextEntry;
     Properties.Settings.Default.DropTargetTables = DropTargetTables;
     Properties.Settings.Default.IncludeSystemTablesInDocumentation = IncludeSystemTablesInDocumentation;
     Properties.Settings.Default.IgnoreIdentityInInsertScript = IgnoreIdentityInInsertScript;
     Properties.Settings.Default.KeepSchemaNames = KeepServerSchemaNames;
     Properties.Settings.Default.PreserveSqlDates = PreserveSqlDates;
     Properties.Settings.Default.TruncateSQLiteStrings = TruncateSQLiteStrings;
     Properties.Settings.Default.ParticipateInTelemetry = ParticipateInTelemetry;
     Properties.Settings.Default.Save();
     base.OnApply(e);
 }
			internal void OnApply(PageApplyEventArgs args)
			{
				if (args.ApplyBehavior == ApplyKind.Apply)
				{
                    try
                    {
                        this.model.EndEdit();
                    }
                    catch (Exception ex)
                    {
                        this.messageBox.Show(ex.Message, icon: MessageBoxImage.Error);
                        args.ApplyBehavior = ApplyKind.CancelNoNavigate;
                    }
                }
				else
				{
					this.model.CancelEdit();
				}
			}
示例#55
0
        protected override void OnApply(PageApplyEventArgs e)
        {
            base.OnApply(e);

            try
            {
                Color color = this.control.colorPicker.Value;
                string colorString = string.Format("{0},{1},{2}", color.R, color.G, color.B);

                VSGestureInfo info = VSGestureService.Current.VSGestureInfo;
                info.UserSettings.LineColor = colorString;
                info.UserSettings.LineThickness = this.control.lineWeightPicker.Value.ToString();

                info.UserSettings.EnableVSGesture = this.control.chkEnabled.Checked;
                info.UserSettings.EnableVSGestureAlram = this.control.chkAlarm.Checked;

                VSGestureService.Current.VSGestureInfo = info;
            }
            catch (Exception ex)
            {
            }
        }
        protected override void OnApply(PageApplyEventArgs e) {
            OpensEnabled = _control.Opens.OutliningEnabled;
            OpensCollapsedByDefault = _control.Opens.CollapsedByDefault;
            ModulesEnabled = _control.Modules.OutliningEnabled;
            ModulesCollapsedByDefault = _control.Modules.CollapsedByDefault;
            HashDirectivesEnabled = _control.HashDirectives.OutliningEnabled;
            HashDirectivesCollapsedByDefault = _control.HashDirectives.CollapsedByDefault;
            TypesEnabled = _control.Types.OutliningEnabled;
            TypesCollapsedByDefault = _control.Types.CollapsedByDefault;
            SimpleTypesEnabled = _control.SimpleTypes.OutliningEnabled;
            SimpleTypesCollapsedByDefault = _control.SimpleTypes.CollapsedByDefault;
            TypeExpressionsEnabled = _control.TypeExpressions.OutliningEnabled;
            TypeExpressionsCollapsedByDefault = _control.TypeExpressions.CollapsedByDefault;
            MembersEnabled = _control.Members.OutliningEnabled;
            MembersCollapsedByDefault = _control.Members.CollapsedByDefault;
            LetOrUseEnabled = _control.LetOrUse.OutliningEnabled;
            LetOrUseCollapsedByDefault = _control.LetOrUse.CollapsedByDefault;
            CollectionsEnabled = _control.Collections.OutliningEnabled;
            CollectionsCollapsedByDefault = _control.Collections.CollapsedByDefault;
            PatternMatchesEnabled = _control.PatternMatches.OutliningEnabled;
            PatternMatchesCollapsedByDefault = _control.PatternMatches.CollapsedByDefault;
            TryWithFinallyEnabled = _control.TryWithFinally.OutliningEnabled;
            TryWithFinallyCollapsedByDefault = _control.TryWithFinally.CollapsedByDefault;
            IfThenElseEnabled = _control.IfThenElse.OutliningEnabled;
            IfThenElseCollapsedByDefault = _control.IfThenElse.CollapsedByDefault;
            CExpressionMembersEnabled = _control.CExpressionMembers.OutliningEnabled;
            CExpressionMembersCollapsedByDefault = _control.CExpressionMembers.CollapsedByDefault;
            LoopsEnabled = _control.Loops.OutliningEnabled;
            LoopsCollapsedByDefault = _control.Loops.CollapsedByDefault;
            AttributesEnabled = _control.Attributes.OutliningEnabled;
            AttributesCollapsedByDefault = _control.Attributes.CollapsedByDefault;
            CommentsEnabled = _control.Comments.OutliningEnabled;
            CommentsCollapsedByDefault = _control.Comments.CollapsedByDefault;
            XmlDocCommentsEnabled = _control.XmlDocComments.OutliningEnabled;
            XmlDocCommentsCollapsedByDefault = _control.XmlDocComments.CollapsedByDefault;
            TooltipZoomLevel = _control.Tooltip.InputValue;

            base.OnApply(e);
        }
 protected override void OnApply(PageApplyEventArgs e)
 {
     try
     {
         base.OnApply(e);
         GeneralControl.OnApply();
     }
     catch (Exception ex)
     {
         if (ex is System.IO.IOException ||
             ex is System.UnauthorizedAccessException)
         {
             MessageHelper.ShowErrorMessage(
                 ExceptionUtility.Unwrap(ex).Message,
                 VsResources.DialogTitle);
         }
         else
         {
             throw;
         }
     }
 }
示例#58
0
 protected override void OnApply(PageApplyEventArgs e)
 {
     OptionControl.OnApply();
     base.OnApply(e);
 }
 protected override void OnApply(PageApplyEventArgs e)
 {
     _colorerOptions.Apply(e.ApplyBehavior);
     base.OnApply(e);
 }