コード例 #1
0
ファイル: NoteView.xaml.cs プロジェクト: punker76/noterium
        private void SelectViewMode(NoteViewModes mode)
        {
            if (mode == NoteViewModes.Default)
            {
                if (Hub.Instance.Settings.DefaultNoteView == "View")
                {
                    mode = NoteViewModes.View;
                }
                else if (Hub.Instance.Settings.DefaultNoteView == "Split")
                {
                    mode = NoteViewModes.Split;
                }
                else if (Hub.Instance.Settings.DefaultNoteView == "Edit")
                {
                    mode = NoteViewModes.Edit;
                }
            }

            Button source = null;

            if (Model.CurrentNote != null && string.IsNullOrEmpty(Model.CurrentNote.Note.DecryptedText))
            {
                if (mode == NoteViewModes.Split)
                {
                    source = SplitModeButton;
                }
                else
                {
                    source = EditModeButton;
                }
            }
            else
            {
                if (mode == NoteViewModes.View)
                {
                    source = ViewModeButton;
                }
                else if (mode == NoteViewModes.Split)
                {
                    source = SplitModeButton;
                }
                else if (mode == NoteViewModes.Edit)
                {
                    source = EditModeButton;
                }
            }

            if (source != null)
            {
                ViewModeButtonClicked(source, null);
            }
        }
コード例 #2
0
ファイル: ChangeViewMode.cs プロジェクト: ekblom/noterium
 public ChangeViewMode(NoteViewModes mode)
 {
     Mode = mode;
 }