//----------------------------------------------------------------------------------------------------- private void btnNewFile_Click(object sender, EventArgs e) { //_NpExtFileStruct FileStruct = new _NpExtFileStruct(); if (FileStruct.SaveState == false) { DialogResult ResultDialog = MessageBox.Show("Sure?", "Unsaved Document", MessageBoxButtons.YesNoCancel); if (ResultDialog == DialogResult.Yes) { SaveFile(); } else if (ResultDialog == DialogResult.No) { TypeArea.Clear(); FileStruct.InitializeStruct(); } } }
//----------------------------------------------------------------------------------------------------- private void btnOpenFileDialog_Click(object sender, EventArgs e) { TypeArea.Text = String.Empty; fileDialog.InitialDirectory = Application.StartupPath; fileDialog.ShowDialog(); if (fileDialog.FileName != String.Empty) { String[] content = File.ReadAllLines(fileDialog.FileName); int linecount = content.Length - 1; for (int i = 0; i < content.Length; i++) { TypeArea.AppendText(content[i]); if (i + 1 != content.Length) { TypeArea.AppendText(Environment.NewLine); } } NotepadExt.ActiveForm.Text = fileDialog.SafeFileName + " - " + _AppName; FileStruct.UpdateFileStruct(fileDialog); } }
public ShaftArea() { try { this.id = max_id; //this.structElements = new List<StructElement<TElement>>(); this.structElements = new List <object>(); this.baseArea = false; this.maxDim = false; this.len = default(TArea); this.d = default(TArea); this.typeArea = TypeArea.canon; this.accuracyClass = AccuracyClass.accurate; this.typeTreatment = TypeTreatment.facing; ++max_id; } catch { throw new Exception("ShaftArea hasnt been not constructioned"); } }
//----------------------------------------------------------------------------------------------------- private void btnDateTime_Click(object sender, EventArgs e) { TypeArea.AppendText(System.DateTime.Now.ToString()); }
//----------------------------------------------------------------------------------------------------- private void btnPaste_Click(object sender, EventArgs e) { TypeArea.Paste(); }
//----------------------------------------------------------------------------------------------------- private void btnCopy_Click(object sender, EventArgs e) { TypeArea.Copy(); }
//----------------------------------------------------------------------------------------------------- private void btnCut_Click(object sender, EventArgs e) { TypeArea.Cut(); }
//----------------------------------------------------------------------------------------------------- private void btnAllSelect_Click(object sender, EventArgs e) { TypeArea.SelectAll(); }