예제 #1
0
 private void CmdDecoderAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (tabDecoder.SelectedTabPage == tabDecoderAcc)
     {
         AccessoryDecoderEditorView form = new AccessoryDecoderEditorView();
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             this.ListAccessoryDecoders();
         }
     }
     else
     {
         FeedbackEncoderEditorView form = new FeedbackEncoderEditorView();
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             this.ListFeedbackEncoders();
         }
     }
 }
예제 #2
0
        private void CmdDecoderEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (tabDecoder.SelectedTabPage == tabDecoderAcc)
                {
                    if (!(this.GetSelectedResource() is AccessoryDecoder accDecoder))
                    {
                        return;
                    }

                    AccessoryDecoderEditorView form = new AccessoryDecoderEditorView(accDecoder);
                    if (form.ShowDialog(this) == DialogResult.OK)
                    {
                        this.ListAccessoryDecoders();
                    }
                }
                else
                {
                    if (!(this.GetSelectedResource() is FeedbackEncoder fbEncoder))
                    {
                        return;
                    }

                    FeedbackEncoderEditorView form = new FeedbackEncoderEditorView(fbEncoder);
                    if (form.ShowDialog(this) == DialogResult.OK)
                    {
                        this.ListFeedbackEncoders();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }