/// <summary> /// Завершает добавления новой строки /// </summary> private void CompleteCreatingLine() { var figure = Figure as UnclosedPathFigure; if (figure == null) { throw new ArgumentNullException(); } GraphicsPath path = figure.GeneratePath(); var line = new Line(); line.Polygon.LoadPointList(figure.Points); var number = 1; if (Redactor.Page.Lines.Count > 0) { number = (from fromDbline in Redactor.Page.Lines orderby fromDbline.Number descending select fromDbline.Number).ToList()[0] + 1; } line.Number = number; Redactor.Page.AddLine(line); var glyph = new LineGlyph(line) { Figure = new SolidFigure(path), Config = ParentVectorRedactor.LineConfig }; Parent.InsertChild(glyph); ParentVectorRedactor.ActiveGlyph = glyph; }
public LineGlyph InsertNewLineGlyph(Line line) { var lineGlyph = new LineGlyph(line) {Config = ParentVectorRedactor.LineConfig, Parent = this, MainGlyph = MainGlyph}; InsertChild(lineGlyph); return lineGlyph; }
public LineGlyph InsertNewLineGlyph(Line line) { var lineGlyph = new LineGlyph(line) { Config = ParentVectorRedactor.LineConfig, Parent = this, MainGlyph = MainGlyph }; InsertChild(lineGlyph); return(lineGlyph); }
/// <summary> /// Завершает добавления новой строки /// </summary> private void CompleteCreatingLine() { var figure = Figure as UnclosedPathFigure; if (figure == null) throw new ArgumentNullException(); GraphicsPath path = figure.GeneratePath(); var line = new Line(); line.Polygon.LoadPointList(figure.Points); var number = 1; if (Redactor.Page.Lines.Count > 0) number = (from fromDbline in Redactor.Page.Lines orderby fromDbline.Number descending select fromDbline.Number).ToList()[0] + 1; line.Number = number; Redactor.Page.AddLine(line); var glyph = new LineGlyph(line) {Figure = new SolidFigure(path), Config = ParentVectorRedactor.LineConfig}; Parent.InsertChild(glyph); ParentVectorRedactor.ActiveGlyph = glyph; }