public void ReadDrawing(Drawing drawing, string[] lines) { this.drawing = drawing; var ini = new IniFile(lines); foreach (var section in ini.Sections) { sectionLookup.Add(section.Title, section); } using (drawing.ActionManager.CreateTransaction()) { drawing.ActionManager.RecordingTransaction.IsDelayed = false; foreach (var section in ini.Sections) { ProcessSection(section); } } DrawingUpdater updater; #if TABULA updater = new TABDrawingUpdater(); #else updater = new DrawingUpdater(); #endif updater.UpdateIfNecessary(drawing); drawing.Recalculate(); }
public virtual void ReadDrawing(Drawing drawing, XElement element) { Check.NotNull(drawing, "drawing"); Check.NotNull(element, "element"); drawing.Version = element.ReadDouble("Version"); // Defaults to 0 if Version attribute does not exist. ReadStyles(drawing, element); var figuresNode = element.Element("Figures"); if (figuresNode == null) { // Perhaps notify user that no figures were found. } else { var figures = ReadFigures(figuresNode, drawing); foreach (var figure in figures) { Actions.Add(drawing, figure); } } ReadViewport(drawing, element); DrawingUpdater updater; #if TABULA updater = new TABDrawingUpdater(); #else updater = new DrawingUpdater(); #endif updater.UpdateIfNecessary(drawing); drawing.Recalculate(); //drawing.CoordinateSystem.MoveTo(drawing.Figures.OfType<IPoint>().Midpoint().Minus()); }
public void ReadDrawing(Drawing drawing, string[] lines) { this.drawing = drawing; var ini = new IniFile(lines); foreach (var section in ini.Sections) { sectionLookup.Add(section.Title, section); } using (drawing.ActionManager.CreateTransaction()) { drawing.ActionManager.RecordingTransaction.IsDelayed = false; foreach (var section in ini.Sections) { ProcessSection(section); } } DrawingUpdater updater; #if TABULA updater = new TABDrawingUpdater(); #else updater = new DrawingUpdater(); #endif updater.UpdateIfNecessary(drawing); drawing.Recalculate(); }
public virtual void ReadDrawing(Drawing drawing, XElement element) { Check.NotNull(drawing, "drawing"); Check.NotNull(element, "element"); drawing.Version = element.ReadDouble("Version"); // Defaults to 0 if Version attribute does not exist. ReadStyles(drawing, element); var figuresNode = element.Element("Figures"); if (figuresNode == null) { // Perhaps notify user that no figures were found. } else { var figures = ReadFigures(figuresNode, drawing); foreach (var figure in figures) { Actions.Add(drawing, figure); } } ReadViewport(drawing, element); DrawingUpdater updater; #if TABULA updater = new TABDrawingUpdater(); #else updater = new DrawingUpdater(); #endif updater.UpdateIfNecessary(drawing); drawing.Recalculate(); //drawing.CoordinateSystem.MoveTo(drawing.Figures.OfType<IPoint>().Midpoint().Minus()); }