예제 #1
0
        public NoteControl(NotesForm notesForm, NotesModel model, NotesModel.Note note)
        {
            InitializeComponent();

            this.notesForm = notesForm;
            this.model     = model;
            this.note      = note;
        }
예제 #2
0
파일: NotesForm.cs 프로젝트: sda97ghb/Notes
        private void runOnline()
        {
            AuthorizationForm auth = new AuthorizationForm();

            auth.ShowDialog();

            if (auth.isBackwardPressed)
            {
                auth.isBackwardPressed = false;
                init();
                return;
            }

            if (!auth.isDataEntered)
            {
                var res = MessageBox.Show("You can't be authorized without login and password. Retry?",
                                          "Oops! Are you shure?", MessageBoxButtons.RetryCancel);
                if (res == DialogResult.Cancel)
                {
                    System.Environment.Exit(0);
                }
                if (res == DialogResult.Retry)
                {
                    auth.ShowDialog();
                }
            }
            if (auth.isBackwardPressed)
            {
                auth.isBackwardPressed = false;
                init();
                return;
            }
            if (!auth.isDataEntered)
            {
                System.Environment.Exit(0);
            }

            model = new NotesSqlModel(auth.login, auth.password);

            (model as NotesSqlModel).loadNotes();

            showNotes();
        }
예제 #3
0
파일: NotesForm.cs 프로젝트: sda97ghb/Notes
        private void runOffline()
        {
            model = new NotesOfflineModel();

            showNotes();
        }