public void WriteCoord(double x, double y) { if (ActualCoords.Text.CompareTo("")) { ActualCoords.AppendText(System.Environment.NewLine); } ActualCoords.AppendText(x.ToString()); ActualCoords.AppendText(","); ActualCoords.AppendText(y.ToString()); ActualCoords.AppendText(",0 "); ActualCoords.ScrollToCaret(); int xxx = System.Convert.ToInt32(Math.Round(x * 60 * 10000)); // in milliminutes for NAVCOM AI use int yyy = System.Convert.ToInt32(Math.Round(y * 60 * 10000)); // in milliminutes for NAVCOM AI use if (AICMDFile.Text.CompareTo("")) { AICMDFile.AppendText(System.Environment.NewLine); } AICMDFile.AppendText("@WW "); AICMDFile.AppendText((AICMDFile.Lines.Length + 1).ToString()); AICMDFile.AppendText(" "); AICMDFile.AppendText(yyy.ToString()); AICMDFile.AppendText(" "); AICMDFile.AppendText(xxx.ToString()); AICMDFile.ScrollToCaret(); }
private void DelButton_Click(object sender, System.EventArgs e) { string[] myData = null; string lines = null; string outputString = null; lines = ActualCoords.Text; myData = lines.Split('\n'); outputString = string.Join("\n", myData, 0, myData.Length - 1); ActualCoords.Clear(); ActualCoords.AppendText(outputString); lines = AICMDFile.Text; myData = lines.Split('\n'); outputString = string.Join("\n", myData, 0, myData.Length - 1); AICMDFile.Clear(); AICMDFile.AppendText(outputString); }
private void Button5_Click(object sender, System.EventArgs e) { SaveFileDialog SaveHere = new SaveFileDialog(); SaveHere.Filter = "AICMD files (*.aicmd)|*.aicmd"; SaveHere.FilterIndex = 2; SaveHere.RestoreDirectory = true; if (SaveHere.ShowDialog() == System.Windows.Forms.DialogResult.OK) { AICMDFile.ScrollToCaret(); AICMDFile.AppendText(System.Environment.NewLine + System.Environment.NewLine); AICMDFile.SaveFile(SaveHere.FileName, RichTextBoxStreamType.PlainText); AICMDFile.Clear(); } }