예제 #1
0
        public static (DialogResult res, LabelEditorForm form) GoEdit(LogLabel lb)
        {
            LabelEditorForm form = new LabelEditorForm(lb);
            var             res  = form.ShowDialog();

            return(res, form);
        }
예제 #2
0
        public static (DialogResult res, LabelEditorForm form) GoCreate(string profileName)
        {
            var form = new LabelEditorForm(profileName);
            var res  = form.ShowDialog();

            return(res, form);
        }
예제 #3
0
        private async void btEdit_Click(object sender, EventArgs e)
        {
            var(res, form) = LabelEditorForm.GoEdit(data);
            if (res == DialogResult.OK)
            {
                await _controller.UpdateLabel(form.Result);

                RaiseOnDataDirty();
            }
        }
예제 #4
0
        private async void addButton_Click(object sender, EventArgs e)
        {
            if (_selectedProfile == PROFILES_ALL_NAME)
            {
                MessageBox.Show("Select profile first");
                return;
            }
            var(res, form) = LabelEditorForm.GoCreate(_selectedProfile);
            if (res == DialogResult.OK)
            {
                await _controller.AddLabel(form.Result);

                RefreshDataInAdapter();
                //adapter.UpdateData(_state.Labels);
            }
        }