Ejemplo n.º 1
0
        static PendingChangesOptionsDialog Build(WorkspaceInfo wkInfo)
        {
            PendingChangesOptionsDialog result = Create();

            result.CheckFsWatcher(wkInfo);

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

            return(result);
        }
Ejemplo n.º 2
0
        internal static void ChangeOptions(
            WorkspaceInfo wkInfo,
            IRefreshableView view,
            IAutorefreshView autorefreshView,
            EditorWindow window)
        {
            PendingChangesOptionsDialog dialog = Build(wkInfo);

            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();
                }
            }
        }