Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
File: Glyphs.cs Progetto: ernado/Owl
 public LineGlyph InsertNewLineGlyph(Line line)
 {
     var lineGlyph = new LineGlyph(line)
                         {Config = ParentVectorRedactor.LineConfig, Parent = this, MainGlyph = MainGlyph};
     InsertChild(lineGlyph);
     return lineGlyph;
 }
Esempio n. 3
0
        public LineGlyph InsertNewLineGlyph(Line line)
        {
            var lineGlyph = new LineGlyph(line)
            {
                Config = ParentVectorRedactor.LineConfig, Parent = this, MainGlyph = MainGlyph
            };

            InsertChild(lineGlyph);
            return(lineGlyph);
        }
Esempio n. 4
0
File: Glyphs.cs Progetto: ernado/Owl
        /// <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;
        }