Example #1
0
 //-----------------------------------------------------------------------------------------------------
 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();
         }
     }
 }
Example #2
0
 //-----------------------------------------------------------------------------------------------------
 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);
     }
 }
Example #3
0
        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");
            }
        }
Example #4
0
 //-----------------------------------------------------------------------------------------------------
 private void btnDateTime_Click(object sender, EventArgs e)
 {
     TypeArea.AppendText(System.DateTime.Now.ToString());
 }
Example #5
0
 //-----------------------------------------------------------------------------------------------------
 private void btnPaste_Click(object sender, EventArgs e)
 {
     TypeArea.Paste();
 }
Example #6
0
 //-----------------------------------------------------------------------------------------------------
 private void btnCopy_Click(object sender, EventArgs e)
 {
     TypeArea.Copy();
 }
Example #7
0
 //-----------------------------------------------------------------------------------------------------
 private void btnCut_Click(object sender, EventArgs e)
 {
     TypeArea.Cut();
 }
Example #8
0
 //-----------------------------------------------------------------------------------------------------
 private void btnAllSelect_Click(object sender, EventArgs e)
 {
     TypeArea.SelectAll();
 }