Пример #1
0
        static PendingChangesOptionsDialog Build(WorkspaceInfo wkInfo, bool isGluonMode)
        {
            PendingChangesOptionsDialog result = Create(wkInfo, isGluonMode);

            result.CheckFsWatcher(wkInfo);

            result.mInitialOptions = new PendingChangesOptions();
            result.mInitialOptions.LoadPendingChangesOptions();
            result.SetOptions(result.mInitialOptions);

            return(result);
        }
Пример #2
0
        internal static void ChangeOptions(
            WorkspaceInfo wkInfo,
            bool isGluonMode,
            IRefreshableView view,
            IAutorefreshView autorefreshView,
            EditorWindow window)
        {
            PendingChangesOptionsDialog dialog = Build(wkInfo, isGluonMode);

            autorefreshView.DisableAutorefresh();

            bool isDialogDirty = false;

            try
            {
                if (dialog.RunModal(window) != ResponseType.Ok)
                {
                    return;
                }

                PendingChangesOptions currentOptions = dialog.GetOptions();
                isDialogDirty = dialog.IsDirty(currentOptions);

                if (!isDialogDirty)
                {
                    return;
                }

                currentOptions.SavePreferences();
            }
            finally
            {
                autorefreshView.EnableAutorefresh();

                if (isDialogDirty)
                {
                    view.Refresh();
                }
            }
        }