private void AddStyle_Click(object sender, EventArgs e) { var _f = new FormInput(); _f.Message = "Enter name for style"; var _r = _f.ShowDialog(); if (_r == DialogResult.OK) { var _style = new RtfControlStyle(); if (rtf.SelectionColor != null) { _style.Color = rtf.SelectionColor; } if (rtf.SelectionFont != null) { _style.FontFamily = rtf.SelectionFont.Name; _style.FontSize = rtf.SelectionFont.Size; _style.FontStyle = rtf.SelectionFont.Style; } _style.HorizontalAlignment = rtf.SelectionAlignment; _style.StyleName = _f.InputText; StyleCollection.Instance.Styles.Add(_style); _FontStyleComboBoxHelper.Add(_style); SetButtons(); } }
private void 修改ToolStripMenuItem_Click_1(object sender, EventArgs e) { var row = this.gvlog.CurrentRow; if (row != null) { var key = row.Cells["Key"].Value.ToString(); var log = EntityTableEngine.LocalEngine.Find <SearchLog>(Global.TBName_SearchLog, key).FirstOrDefault(); if (log != null) { FormInput input = new FormInput(); if (input.ShowDialog() == DialogResult.OK) { if (!string.IsNullOrWhiteSpace(input.Val)) { log.Mark = input.Val; EntityTableEngine.LocalEngine.Update <SearchLog>(Global.TBName_SearchLog, log); this.gvlog.ClearSelection(); Thread.Sleep(3000); LoadLog(); } } ; } } }
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { _document = commandData.Application.ActiveUIDocument.Document; _uiDocument = commandData.Application.ActiveUIDocument; try { Element element = SelectionPiepe(); if (element is Pipe pipeNeedRotate) { Element theSecondElem = SelectPipeIsVector(); if (theSecondElem == null) { return(Result.Cancelled); } Pipe pipeAxis = theSecondElem as Pipe; _pipeNeedRotate = pipeNeedRotate; _pipeAxis = pipeAxis; FormInput formInput = new FormInput(); formInput.Rotate += RotatePipe; formInput.ShowDialog(); } else { MessageBox.Show("Please! Select one element is Pipe."); } return(Result.Succeeded); } catch (Exception) { MessageBox.Show("Error, Please contact [email protected] for more details."); return(Result.Failed); } }
private void 修改ToolStripMenuItem_Click(object sender, EventArgs e) { var row = gvlog.CurrentRow; if (row != null) { FormInput inputform = new FormInput(); if (inputform.ShowDialog() == DialogResult.OK) { if (!string.IsNullOrWhiteSpace(inputform.Val)) { var log = EntityTableEngine.LocalEngine.Find <SearchLog>(Global.TBName_SearchLog, row.Cells[0].Value.ToString()).FirstOrDefault(); if (log != null) { log.Mark = inputform.Val; EntityTableEngine.LocalEngine.Update <SearchLog>(Global.TBName_SearchLog, log); //MessageBox.Show("修改成功"); //Thread.Sleep(1000); //this.gvlog.ClearSelection(); this.LoadLog(); } } } } }
void SolicitarPlaca() { this.Visible = false; this.Update(); FormInput input = new FormInput("ENTRE COM A PLACA", "Digite a Placa para o novo cadastro"); input.ShowDialog(); if (input.result == DialogResult.OK) { VerificarExistencia(input.Value); txtPlaca.Text = input.Value; this.Visible = true; } else { PerguntarParaSair = false; this.Close(); } }
// 新建目录 private void menuMkdir_Click(object sender, EventArgs e) { try { TreeNode currNod = this.treeView1.SelectedNode; if (null == currNod) { return; } FormInput fm = new FormInput(); fm.Content = "newdirectory"; if (DialogResult.OK == fm.ShowDialog()) { string name = fm.Content; if (string.IsNullOrWhiteSpace(name)) { MessageBox.Show("目录名称不能为空!"); return; } string dirname = name.Replace(":", "").Replace("/", "") .Replace(" ", "").Replace("*", ""); if (string.IsNullOrWhiteSpace(dirname)) { return; } string parentDir = currNod.Name; string hdfsDir = (parentDir.Length > 1) ? parentDir + "/" : parentDir; hdfsDir = hdfsDir + dirname; bool bok = HdfsHelper.MkDir(hdfsDir); if (bok) { // update cache if (_fileinfoCache.ContainsKey(parentDir)) { List <HdfsFileInfo> fis = _fileinfoCache[parentDir]; if (null != fis) { fis.Add(new HdfsFileInfo() { Name = dirname, PathName = hdfsDir, IsDirectory = true, }); } } // Refresh TreeNodes TreeNode nod = currNod.Nodes.Add(dirname, dirname, 0); nod.Name = hdfsDir; } else { MessageBox.Show("目录创建失败"); } } } catch (System.Exception ex) { DebugHelper.Error(ex); MessageBox.Show(ex.Message); } }