/// <summary>Gibt eine CADdy-Formatierte Liste zurück</summary> /// <param name="settings"></param> public void formatCurrentToCADdy(Settings settings) { IScintillaGateway editor = new ScintillaGateway(PluginBase.GetCurrentScintilla()); if (standpunkte.Count > 0) { Position selStart = editor.GetSelectionStart(); Position selEnd = editor.GetSelectionEnd(); editor.BeginUndoAction(); Position oldPos = editor.GetCurrentPos(); editor.ClearAll(); foreach (ClassCADdyStandpunkt item in standpunkte) { String temp = item.getCADdyFormatString(settings); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); foreach (ClassCADdyZielung ziel in item.Zielungen) { temp = ziel.getCADdyFormatString(settings); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); } } editor.ConvertEOLs(0); editor.SetSelection(selStart.Value, selEnd.Value); editor.SetCurrentPos(oldPos); editor.EndUndoAction(); } }
/// <summary>Gibt eine Excel-Formatierte Liste zurück</summary> public void formatCurrentToExcel() { IScintillaGateway editor = new ScintillaGateway(PluginBase.GetCurrentScintilla()); if (Punkte.Count > 0) { Position oldPos = editor.GetCurrentPos(); editor.BeginUndoAction(); editor.ClearAll(); foreach (ClassCADdyPunkt item in Punkte) { String temp = item.getExcelFormatString(); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); } editor.ConvertEOLs(0); editor.EndUndoAction(); editor.SetCurrentPos(oldPos); editor.ClearSelectionToCursor(); } }
/// <summary>Gibt eine Excel-Formatierte Liste zurück</summary> public void formatCurrentToExcel() { IScintillaGateway editor = new ScintillaGateway(PluginBase.GetCurrentScintilla()); if (standpunkte.Count > 0) { editor.BeginUndoAction(); Position oldPos = editor.GetCurrentPos(); editor.ClearAll(); foreach (ClassCADdyStandpunkt item in standpunkte) { String temp = item.getExcelFormatString(); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); foreach (ClassCADdyZielung ziel in item.Zielungen) { temp = ziel.getExcelFormatString(); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); } } editor.ConvertEOLs(0); editor.SetCurrentPos(oldPos); editor.EndUndoAction(); } }
/// <summary>Gibt eine CADdy-Formatierte Liste zurück</summary> /// <param name="settings"></param> public void formatCurrentToCAPLAN(Settings settings) { IScintillaGateway editor = new ScintillaGateway(PluginBase.GetCurrentScintilla()); if (standpunkte.Count > 0) { editor.BeginUndoAction(); Position oldPos = editor.GetCurrentPos(); editor.ClearAll(); Dictionary <String, List <Int32> > stpkIndex = new Dictionary <String, List <Int32> >(); for (Int32 counter = 0; counter < standpunkte.Count; counter++) { if (!stpkIndex.Keys.Contains(standpunkte[counter].Punktnummer)) { stpkIndex.Add(standpunkte[counter].Punktnummer, new List <Int32>()); } stpkIndex[standpunkte[counter].Punktnummer].Add(counter); } foreach (KeyValuePair <String, List <Int32> > stId in stpkIndex) { String temp = standpunkte[stId.Value[0]].getCADdyFormatString(settings); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); foreach (Int32 stpkId in stId.Value) { foreach (ClassCADdyZielung ziel in standpunkte[stpkId].Zielungen) { temp = ziel.getCADdyFormatString(settings); editor.AppendText(temp.Length + 1, temp + Environment.NewLine); } } } editor.ConvertEOLs(0); editor.SetCurrentPos(oldPos); editor.EndUndoAction(); } }