예제 #1
0
        private void ListDataGriddView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0 || e.ColumnIndex < 0)
                {
                    return;
                }

                if (e.ColumnIndex == 0)
                {  //单选
                   //checkbox
                    if ((bool)listDataGriddView.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true)
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = false;
                    }
                    else
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = true;
                    }
                }

                string columnName = listDataGriddView.Columns[e.ColumnIndex].Name;
                if (columnName == "detail_row")
                {
                    FormTemAdd itemForm = new FormTemAdd(codeProjectInfo, lists[e.RowIndex].ID);
                    DialogUtil.ShowDialog(itemForm, this, itemForm.Width, itemForm.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        private void ListDataGriddView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0 || e.ColumnIndex < 0)
                {
                    return;
                }

                if (e.ColumnIndex == 0)
                {  //单选
                   //checkbox
                    if ((bool)listDataGriddView.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true)
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = false;
                    }
                    else
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = true;
                    }
                }

                string columnName = listDataGriddView.Columns[e.ColumnIndex].Name;
                //删除
                if (columnName == "detail_row")
                {
                    AccoutEncFrm accoutEncFrm = new AccoutEncFrm(listData[e.RowIndex]);
                    DialogUtil.ShowDialog(accoutEncFrm, this, accoutEncFrm.Width, accoutEncFrm.Height, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
        private void btnAdd_Click_1(object sender, EventArgs e)
        {
            AccoutEncFrm AccoutEncFrm = new AccoutEncFrm();

            AccoutEncFrm.RefeshParentWindow = BtnRefesh_ParentWindow;
            DialogUtil.ShowDialog(AccoutEncFrm, this, 883, 519, new FormWindowProp(false, false, FormBorderStyle.FixedSingle));
        }
예제 #4
0
 private void ImportBtn_Click(object sender, EventArgs e)
 {
     importForm = new ImportForm <OsZbPurchaseProjectInfo>("项目信息导出表.xlsx");
     //importForm.importEvent += btnImportProject_Click;
     importForm.ImportCheck = ImportCheck;
     DialogUtil.ShowDialog(importForm, this, importForm.Width, importForm.Height, new FormWindowProp(false, false, FormBorderStyle.FixedDialog));
 }
예제 #5
0
        private void btnAdd_Click_1(object sender, EventArgs e)
        {
            FormDemoAdd formDemoAdd = new FormDemoAdd();

            formDemoAdd.RefeshParentWindow = BtnRefesh_ParentWindow;
            DialogUtil.ShowDialog(formDemoAdd, this, 883, 519, new FormWindowProp(false, false, FormBorderStyle.FixedSingle));
        }
예제 #6
0
 private void ShowMainUIDialog(string text, string buttonText, Action action)
 {
     if (action != null)
     {
         DialogUtil.ShowDialog(null, text, buttonText, action);
     }
     else
     {
         DialogUtil.ShowDialog(null, text, buttonText);
     }
 }
예제 #7
0
 /// <summary>
 /// 显示参考图
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButtonCkt_Click(object sender, EventArgs e)
 {
     try
     {
         string         filePath = Path.Combine(@System.AppDomain.CurrentDomain.BaseDirectory, "Images\\CKT.png");
         PicturePreview formT    = new PicturePreview(filePath);
         DialogUtil.ShowDialog(formT, this, formT.Width + 300, formT.Height + 300, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #8
0
        public void ShowDialog(string text, string NegativeButton, Action negativeAction, string PositiveButton, Action positiveAction)
        {
            int id = Activity.Resources.GetIdentifier(text, "string", Activity.PackageName);

            if (id > 0)
            {
                text = Resources.GetString(id);
            }
            id = Activity.Resources.GetIdentifier(NegativeButton, "string", Activity.PackageName);
            if (id > 0)
            {
                NegativeButton = Resources.GetString(id);
            }
            id = Activity.Resources.GetIdentifier(PositiveButton, "string", Activity.PackageName);
            if (id > 0)
            {
                PositiveButton = Resources.GetString(id);
            }
            DialogUtil.ShowDialog(null, text, NegativeButton, negativeAction, PositiveButton, positiveAction);
        }
예제 #9
0
        private void ListDataGriddView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0 || e.ColumnIndex < 0)
                {
                    return;
                }

                if (e.ColumnIndex == 0)
                {  //单选
                   //checkbox
                    if ((bool)listDataGriddView.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true)
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = false;
                    }
                    else
                    {
                        listDataGriddView.Rows[e.RowIndex].Cells[0].Value = true;
                    }
                }

                string columnName = listDataGriddView.Columns[e.ColumnIndex].Name;
                //删除
                if (columnName == "java_row")
                {
                    CodeProjectAdd createCode = new CodeProjectAdd(listData[e.RowIndex].ID);
                    DialogUtil.ShowDialog(createCode, this, createCode.Width, createCode.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
                }
                else if (columnName == "csharp_row")
                {
                    AutoCodeConfigForm autoCodeConfigForm = new AutoCodeConfigForm(listData[e.RowIndex]);
                    DialogUtil.ShowDialog(autoCodeConfigForm, this, autoCodeConfigForm.Width, autoCodeConfigForm.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #10
0
        public void ShowError(String errorMessage, String actionText, Action action)
        {
            if (_isError)
            {
                return;
            }
            _alertError = DialogUtil.ShowDialog(null, errorMessage, actionText, action);

            /*var root = View.FindViewById<RelativeLayout>(Resource.Id.rootFragment);
             * if (root != null)
             * {
             *  _error = View.Inflate(Activity, Resource.Layout.view_error, null);
             *  _error.LayoutParameters = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
             *  _error.FindViewById(Resource.Id.back).SetOnTouchListener(new BlockTouchListener());
             *  _error.FindViewById<TextView>(Resource.Id.textError).Text = errorMessage;
             *  var actionButton = _error.FindViewById<Button>(Resource.Id.actionButton);
             *  actionButton.Text = actionText;
             *  actionButton.Click += (o, e) => action?.Invoke();
             *  root.Post(() => root.AddView(_error));
             * }*/
            _isError = true;
        }
예제 #11
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            FormTemAdd formTemAdd = new FormTemAdd(codeProjectInfo, 0);

            DialogUtil.ShowDialog(formTemAdd, this, formTemAdd.Width, formTemAdd.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
        }
예제 #12
0
 public void ShowDialog(string text, string NegativeButton, string PositiveButton, Action positiveAction)
 {
     DialogUtil.ShowDialog(null, text, NegativeButton, PositiveButton, positiveAction);
 }
예제 #13
0
 public void ShowDialog(string text, string buttonText, Action action)
 {
     DialogUtil.ShowDialog(null, text, buttonText, action);
 }
예제 #14
0
        private void btnAdd_Click_2(object sender, EventArgs e)
        {
            CodeProjectAdd createCode = new CodeProjectAdd();

            DialogUtil.ShowDialog(createCode, this, createCode.Width, createCode.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
        }
예제 #15
0
        /// <summary>
        /// 图标工具点击事件
        /// </summary>
        /// <param name="toolStripItem"></param>
        private void ClickItemEventFunc(ToolStripItem toolStripItem, MenuStrip menuStrip)
        {
            try
            {
                Form form;

                MenuStrip menu = new MenuStrip();
                if ("menuOut" == menuStrip.Name)
                {
                    menu = this.menuInner;
                }
                else if ("menuInner" == menuStrip.Name)
                {
                    menu = this.menuOut;
                }
                for (int i = 0; i < menu.Items.Count; i++)
                {
                    menu.Items[i].BackColor = Color.WhiteSmoke;
                }
                if (toolStripItem.Name == "outBrowerMenuItem")
                {
                    //调用系统默认的浏览器
                    Process.Start("https://www.baidu.com/");

                    /*Process[] appProcess = Process.GetProcessesByName("MiniBlinkPinvokeDemo");
                     * foreach (Process prc in appProcess)
                     * {
                     *  prc.Kill();
                     * }
                     * string updateExe = $@"{AppDomain.CurrentDomain.BaseDirectory}tools\MiniBlinkPinvokeDemo.exe";
                     * if (File.Exists(updateExe))
                     * {
                     *  Process p = new Process();
                     *  p.StartInfo.FileName = updateExe;
                     *  if (p.Start())
                     *  {
                     *      ((Form)this.TopLevelControl).WindowState = FormWindowState.Minimized;
                     *      SetForegroundWindow(p.MainWindowHandle);
                     *  }
                     * }*/
                }
                else if (toolStripItem.Name == "innerBrowerMenuItem")
                {
                    form = new WebBrowserForm();
                    DialogUtil.ShowDialog(form, this, form.Width, form.Height, new Common.prop.FormWindowProp(true, false, FormBorderStyle.FixedDialog));
                }
                else if (toolStripItem.Name == "AccoutEncStripMenuItem")//账号管理
                {
                    form = new AccoutEncFrmList();
                    DialogUtil.ShowDialog(form, this, form.Width, form.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
                }
                else if (toolStripItem.Name == "FileEncStripMenuItem") //文件加解密
                {
                    form = new FormCrypt();
                    DialogUtil.ShowDialog(form, this, form.Width, form.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog));
                }
            }
            catch (Exception ex)
            {
                MessageHelper.ShowError(ex);
            }
        }