public void SOEMapTextAdd(string new_text, MainForm f1) { IFormatProvider NumFormat = new CultureInfo("en-US"); var soe_maptext = string.Format(NumFormat, "P {0:f3}, {1:f3}, {2}, {3}, {4}, {5}, {6}, {7}", f1.alertX * -1, f1.alertY * -1, f1.alertZ, txtColr.R, txtColr.G, txtColr.B, txtSize, new_text); MapText work = new MapText(soe_maptext); work.draw_color = work.color; work.draw_pen = new Pen(work.color); f1.map.AddMapText(work); if (DialogResult.Yes == MessageBox.Show($"Do you want to write the label to {mapName}?" + Environment.NewLine + Environment.NewLine + soe_maptext, "Write label to map", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)) { try { File.AppendAllText(f1.mapnameWithLabels, soe_maptext); } catch (Exception ex) { MessageBox.Show($"Access Violation {ex}", "Add text to Map Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { f1.map.DeleteMapText(work); } }
internal void ParseLP(string line, ref int numtexts, ref int numlines) { if (line.StartsWith("L")) { MapLine work = new MapLine(line); Lines.Add(work); numlines++; } else if (line.StartsWith("P")) { MapText work = new MapText(line); Texts.Add(work); numtexts++; } }
public void DeleteMapText(MapText work) { Texts.Remove(work); }
public void AddMapText(MapText work) { Texts.Add(work); }