Beispiel #1
0
        public void ChangeView(EditingMode editingMode)
        {
            if (!_documentComplete)
            {
                _editMode = editingMode;
                return;
            }

            try
            {
                switch (editingMode)
                {
                case EditingMode.Wysiwyg:
                    contentEditor.ChangeToWysiwygMode();
                    return;

                case EditingMode.Source:
                    contentEditor.ChangeToCodeMode();
                    return;

                case EditingMode.Preview:
                    contentEditor.ChangeToPreviewMode();
                    return;

                case EditingMode.PlainText:
                    contentEditor.ChangeToPlainTextMode();
                    return;
                }
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                throw;
            }


            Debug.Fail("Unknown value for editingView: " + editingMode.ToString() + "\r\nAccepted values Wysiwyg, Source, Preview, PlainText");
        }