示例#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;
        }
示例#2
0
文件: Glyphs.cs 项目: ernado/Owl
 public LineGlyph InsertNewLineGlyph(Line line)
 {
     var lineGlyph = new LineGlyph(line)
                         {Config = ParentVectorRedactor.LineConfig, Parent = this, MainGlyph = MainGlyph};
     InsertChild(lineGlyph);
     return lineGlyph;
 }
示例#3
0
        public LineGlyph InsertNewLineGlyph(Line line)
        {
            var lineGlyph = new LineGlyph(line)
            {
                Config = ParentVectorRedactor.LineConfig, Parent = this, MainGlyph = MainGlyph
            };

            InsertChild(lineGlyph);
            return(lineGlyph);
        }
示例#4
0
文件: Glyphs.cs 项目: 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;
        }