Пример #1
0
        static void SwitchGuiModeIfUserWants(
            PlasticGUIClient plasticClient,
            GuiMode currentMode, GuiMode selectedMode,
            TreeView changesTreeView,
            EditorWindow editorWindow)
        {
            if (currentMode == selectedMode)
            {
                return;
            }

            bool userConfirmed = SwitchModeConfirmationDialog.SwitchMode(
                currentMode == GuiMode.GluonMode, editorWindow);

            if (!userConfirmed)
            {
                return;
            }

            bool isGluonMode = selectedMode == GuiMode.GluonMode;

            LaunchOperation.UpdateWorkspaceForMode(
                isGluonMode, plasticClient);

            PendingChangesTreeHeaderState.SetMode(
                changesTreeView.multiColumnHeader.state,
                isGluonMode);
        }
        internal static bool SwitchMode(
            bool isGluonMode,
            EditorWindow parentWindow)
        {
            SwitchModeConfirmationDialog dialog = Create(isGluonMode);

            return(dialog.RunModal(parentWindow) == ResponseType.Ok);
        }