Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new object that is a copy of the current instance.
 /// </summary>
 /// <returns>
 /// A new object that is a copy of this instance.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override object Clone()
 {
     return(new PolygonSymbolizerUsingLineSymbolizer
     {
         Fill = (Brush)Fill.Clone(),
         Outline = (LineSymbolizer)Outline.Clone(),
         RenderOrigin = RenderOrigin,
         UseClipping = UseClipping
     });
 }
Ejemplo n.º 2
0
        protected internal override ExcelDxfStyleConditionalFormatting Clone()
        {
            var s = new ExcelDxfStyleConditionalFormatting(_helper.NameSpaceManager, null, _styles);

            s.Font         = Font.Clone();
            s.NumberFormat = NumberFormat.Clone();
            s.Fill         = Fill.Clone();
            s.Border       = Border.Clone();
            return(s);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new object that is a copy of the current instance.
 /// </summary>
 /// <returns>
 /// A new object that is a copy of this instance.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override object Clone()
 {
     return(new BasicPolygonSymbolizer
     {
         Fill = (Brush)Fill.Clone(),
         Outline = (Pen)Outline.Clone(),
         RenderOrigin = RenderOrigin,
         UseClipping = UseClipping,
     });
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a duplicate of the current value.
        /// </summary>
        /// <returns>The cloned value.</returns>
        /// <remarks>This method is a deep copy clone.</remarks>
        public object Clone()
        {
            var clone = (OpenExcelCellFormat)MemberwiseClone();

            clone.NumberingFormat = (OpenExcelNumberingFormat)NumberingFormat?.Clone();
            clone.Font            = (OpenExcelFont)Font?.Clone();
            clone.Fill            = (OpenExcelFill)Fill?.Clone();
            clone.Border          = (OpenExcelBorder)Border?.Clone();
            return(clone);
        }
Ejemplo n.º 5
0
        /// <inheritdoc/>
        public override object Clone()
        {
            var res = (WarpedLineSymbolizer)MemberwiseClone();

            res.Fill    = (Brush)Fill.Clone();
            res.Line    = (Pen)Line.Clone();
            res.Pattern = (GraphicsPath)Pattern.Clone();

            return(res);
        }
Ejemplo n.º 6
0
        private void canvas_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (listBack.Count == 10)
            {
                listBack.RemoveAt(0);
            }
            UIElement[] temp = new UIElement[canvas.Children.Count];
            canvas.Children.CopyTo(temp, 0);
            listBack.Add(temp);


            anchorPoint = e.MouseDevice.GetPosition(canvas);
            string sizeStroke = ((ComboBoxItem)ComboBoxSize.SelectedItem).Content.ToString();

            if (line != null)
            {
                line = new Line
                {
                    Stroke          = Countor.Clone(),
                    StrokeThickness = Convert.ToInt32(sizeStroke),
                    Fill            = Fill.Clone()
                };
                canvas.CaptureMouse();

                canvas.Children.Add(line);
                line.Y1 = anchorPoint.Y;
                line.X1 = anchorPoint.X;
            }
            if (rect != null)
            {
                rect = new Rectangle
                {
                    Stroke          = Countor.Clone(),
                    StrokeThickness = Convert.ToInt32(sizeStroke),
                    Fill            = Fill.Clone()
                };
                canvas.CaptureMouse();

                canvas.Children.Add(rect);
            }
            if (elip != null)
            {
                elip = new Ellipse
                {
                    Stroke          = Countor.Clone(),
                    StrokeThickness = Convert.ToInt32(sizeStroke),
                    Fill            = Fill.Clone()
                };
                canvas.CaptureMouse();

                canvas.Children.Add(elip);
            }
        }
        public override object Clone()
        {
            RectangleRenderingAction clone = new RectangleRenderingAction();

            clone.X      = (mvarX.Clone() as RenderingExpression);
            clone.Y      = (mvarY.Clone() as RenderingExpression);
            clone.Width  = (mvarWidth.Clone() as RenderingExpression);
            clone.Height = (mvarHeight.Clone() as RenderingExpression);

            clone.Outline = (mvarOutline.Clone() as Outline);
            clone.Fill    = (mvarFill.Clone() as Fill);
            return(clone);
        }
Ejemplo n.º 8
0
        public TransportTaskDirectionModel(TransportTask transportTask, Func <string, List <PlaceModel> > findPlaceAccessor)
        {
            _findPlaceAccessor = findPlaceAccessor;
            Source             = transportTask;

            _startPlaceModel  = _findPlaceAccessor(Source.TaskStartPlaceCode).FirstOrDefault();
            _finishPlaceModel = _findPlaceAccessor(Source.TaskFinishPlace).FirstOrDefault();

            if (_startPlaceModel == null || _finishPlaceModel == null)
            {
                IsValid = false;
                return;
            }

            IsValid       = true;
            this.Point1   = _startPlaceModel.Center;
            this.Point2   = _finishPlaceModel.Center;
            this.Diameter = 0.05;

            switch (Source.StatusCode)
            {
            case TTaskStates.TTASK_CREATED:
                Fill = CreatedBrushForArrow;
                break;

            case TTaskStates.TTASK_ACTIVATED:
                Fill = ActivatedBrushForArrow;
                break;

            case TTaskStates.TTASK_COMPLETED:
                Fill = CompletedBrushForArrow;
                break;

            default:
                Fill = DefaultBrushForArrow;
                break;
            }
            if (Fill.IsFrozen)
            {
                var myFill = Fill.Clone();
                myFill.Opacity = 0.7;
                Fill           = myFill;
            }
            else
            {
                Fill.Opacity = 0.7;
            }
        }
Ejemplo n.º 9
0
 void ISelectable.SetSelected()
 {
     _startPlaceModel.Fill  = BrushForStartPlace;
     _finishPlaceModel.Fill = BrushForFinishPlace;
     _previosFill           = Fill;
     if (Fill.IsFrozen)
     {
         var myFill = Fill.Clone();
         myFill.Opacity = 1;
         Fill           = myFill;
     }
     else
     {
         Fill.Opacity = 1;
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Clones shape style.
 /// </summary>
 /// <returns>The new instance of the <see cref="ShapeStyle"/> class.</returns>
 public ShapeStyle Clone()
 {
     return(new ShapeStyle()
     {
         Name = Name,
         Stroke = Stroke.Clone(),
         Fill = Fill.Clone(),
         Thickness = Thickness,
         LineCap = LineCap,
         Dashes = Dashes,
         DashOffset = 0.0,
         LineStyle = _lineStyle.Clone(),
         TextStyle = _textStyle.Clone(),
         StartArrowStyle = _startArrowStyle.Clone(),
         EndArrowStyle = _endArrowStyle.Clone()
     });
 }
Ejemplo n.º 11
0
 protected virtual void CloneTo(DDObject target)
 {
     target.X      = X;
     target.Y      = Y;
     target.Width  = Width;
     target.Height = Height;
     if (Fill != null)
     {
         target.Fill = Fill.Clone();
     }
     if (Stroke != null)
     {
         target.Stroke = Stroke.Clone();
     }
     target.StrokeThickness = StrokeThickness;
     //TODO: Add more when needed!
 }
Ejemplo n.º 12
0
 protected virtual void CopyToCLR(Shape target)
 {
     Canvas.SetLeft(target, X);
     Canvas.SetTop(target, Y);
     target.Width  = Width;
     target.Height = Height;
     if (Fill != null)
     {
         target.Fill = Fill.Clone();
     }
     if (Stroke != null)
     {
         target.Stroke = Stroke.Clone();
     }
     target.StrokeThickness = StrokeThickness;
     //TODO: Add more when needed!
 }
Ejemplo n.º 13
0
        public void CouldFillValues()
        {
            var sm = new Series <int, double>
            {
                { 1, 1 },
                { 3, 3 },
                { 5, 5 }
            };

            var c = new Fill <int, double, Cursor <int, double> >(sm.GetSpecializedCursor(), 42).Initialize();

            Assert.True(c.MoveNext());
            Assert.AreEqual(1, c.CurrentValue);

            Assert.True(c.MoveNext());
            Assert.AreEqual(3, c.CurrentValue);

            Assert.True(c.MoveNext());
            Assert.AreEqual(5, c.CurrentValue);

            Assert.False(c.MoveNext());
            Assert.AreEqual(5, c.CurrentValue);

            Assert.True(c.MoveLast());
            Assert.AreEqual(5, c.CurrentValue);

            Assert.False(c.MoveAt(4, Lookup.EQ));
            Assert.AreEqual(5, c.CurrentValue);

            Assert.True(c.MoveAt(4, Lookup.LE));
            Assert.AreEqual(3, c.CurrentValue);

            Assert.True(c.TryGetValue(2, out var x));
            Assert.AreEqual(3, c.CurrentValue);
            Assert.AreEqual(42, x);

            var clone = c.Clone();

            Assert.True(c.MoveAt(4, Lookup.GT));
            Assert.AreEqual(5, c.CurrentValue);
            Assert.AreEqual(3, clone.CurrentValue);

            Assert.True(clone.TryGetValue(0, out var y));
            Assert.AreEqual(42, y);
        }
        internal SLShapeProperties Clone()
        {
            var sp = new SLShapeProperties(listThemeColors);

            sp.HasBlackWhiteMode = HasBlackWhiteMode;
            sp.vBlackWhiteMode   = vBlackWhiteMode;
            sp.HasTransform2D    = HasTransform2D;
            sp.Transform2D       = Transform2D.Clone();
            sp.HasPresetGeometry = HasPresetGeometry;
            sp.vPresetGeometry   = vPresetGeometry;
            sp.Fill       = Fill.Clone();
            sp.Outline    = Outline.Clone();
            sp.EffectList = EffectList.Clone();
            sp.Rotation3D = Rotation3D.Clone();
            sp.Format3D   = Format3D.Clone();

            return(sp);
        }
Ejemplo n.º 15
0
 private void CreateResultTable()
 {
     SetResultTable(new TableResult());
     // assign properties from this object. Do not use Assign method: TableResult is incompatible with MatrixObject.
     ResultTable.OriginalComponent = OriginalComponent;
     ResultTable.Alias             = Alias;
     ResultTable.Border            = Border.Clone();
     ResultTable.Fill                    = Fill.Clone();
     ResultTable.Bounds                  = Bounds;
     ResultTable.RepeatHeaders           = RepeatHeaders;
     ResultTable.RepeatRowHeaders        = RepeatRowHeaders;
     ResultTable.RepeatColumnHeaders     = RepeatColumnHeaders;
     ResultTable.Layout                  = Layout;
     ResultTable.WrappedGap              = WrappedGap;
     ResultTable.AdjustSpannedCellsWidth = AdjustSpannedCellsWidth;
     ResultTable.SetReport(Report);
     ResultTable.AfterData += new EventHandler(ResultTable_AfterData);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Clones arrow style.
 /// </summary>
 /// <returns>The new instance of the <see cref="ArrowStyle"/> class.</returns>
 public ArrowStyle Clone()
 {
     return(new ArrowStyle()
     {
         Name = Name,
         Stroke = Stroke.Clone(),
         Fill = Fill.Clone(),
         Thickness = Thickness,
         LineCap = LineCap,
         Dashes = Dashes,
         DashOffset = DashOffset,
         ArrowType = _arrowType,
         IsStroked = _isStroked,
         IsFilled = _isFilled,
         RadiusX = _radiusX,
         RadiusY = _radiusY
     });
 }
Ejemplo n.º 17
0
        public override object Clone()
        {
            VectorStyle vectorStyle = new VectorStyle();

            vectorStyle.Shape     = Shape;
            vectorStyle.ShapeSize = ShapeSize;
            if ((_CustomSymbol) && (null != Symbol))
            {
                vectorStyle.Symbol = (Bitmap)Symbol.Clone();
            }

            vectorStyle.Line          = Line == null ? null : (Pen)Line.Clone();
            vectorStyle.Outline       = Outline == null ? null : (Pen)Outline.Clone();
            vectorStyle.EnableOutline = EnableOutline;
            vectorStyle.Fill          = Fill == null ? null : (Brush)Fill.Clone();
            vectorStyle.GeometryType  = GeometryType;

            return(vectorStyle);
        }
Ejemplo n.º 18
0
        // use the TableObject to represent the contents. It's easier to export it later.
        private TableObject GetTable(bool autoRows)
        {
            TableObject table = new TableObject();

            table.SetPrinting(IsPrinting);
            table.SetReport(Report);

            float cellWidth  = CellWidth;
            float cellHeight = CellHeight;

            // calculate cellWidth, cellHeight automatically
            if (cellWidth == 0 || cellHeight == 0)
            {
                float fontHeight = Font.GetHeight() * 96f / DrawUtils.ScreenDpi;
                cellWidth  = (int)Math.Round((fontHeight + 10) / Page.SnapSize.Width) * Page.SnapSize.Width;
                cellHeight = cellWidth;
            }

            int colCount = (int)((Width + HorzSpacing + 1) / (cellWidth + HorzSpacing));

            if (colCount == 0)
            {
                colCount = 1;
            }
            int rowCount = (int)((Height + VertSpacing + 1) / (cellHeight + VertSpacing));

            if (rowCount == 0 || autoRows)
            {
                rowCount = 1;
            }

            table.ColumnCount = colCount;
            table.RowCount    = rowCount;

            // process the text
            int    row       = 0;
            int    lineBegin = 0;
            int    lastSpace = 0;
            string text      = Text.Replace("\r\n", "\n");

            for (int i = 0; i < text.Length; i++)
            {
                bool isCRLF = text[i] == '\n';
                if (text[i] == ' ' || isCRLF)
                {
                    lastSpace = i;
                }

                if (i - lineBegin + 1 > colCount || isCRLF)
                {
                    if (WordWrap && lastSpace > lineBegin)
                    {
                        AddText(table, row, text.Substring(lineBegin, lastSpace - lineBegin));
                        lineBegin = lastSpace + 1;
                    }
                    else if (i - lineBegin > 0)
                    {
                        AddText(table, row, text.Substring(lineBegin, i - lineBegin));
                        lineBegin = i;
                    }
                    else
                    {
                        lineBegin = i + 1;
                    }

                    lastSpace = lineBegin;
                    row++;
                    if (autoRows && row >= rowCount)
                    {
                        rowCount++;
                        table.RowCount++;
                    }
                }
            }

            // finish the last line
            if (lineBegin < text.Length)
            {
                AddText(table, row, text.Substring(lineBegin, text.Length - lineBegin));
            }

            // set up cells appearance
            for (int i = 0; i < colCount; i++)
            {
                for (int j = 0; j < rowCount; j++)
                {
                    TableCell cell = table[i, j];
                    cell.Border    = Border.Clone();
                    cell.Fill      = Fill.Clone();
                    cell.Font      = Font;
                    cell.TextFill  = TextFill.Clone();
                    cell.HorzAlign = HorzAlign.Center;
                    cell.VertAlign = VertAlign.Center;
                }
            }

            // set cell's width and height
            for (int i = 0; i < colCount; i++)
            {
                table.Columns[i].Width = cellWidth;
            }

            for (int i = 0; i < rowCount; i++)
            {
                table.Rows[i].Height = cellHeight;
            }

            // insert spacing between cells
            if (HorzSpacing > 0)
            {
                for (int i = 0; i < colCount - 1; i++)
                {
                    TableColumn newColumn = new TableColumn();
                    newColumn.Width = HorzSpacing;
                    table.Columns.Insert(i * 2 + 1, newColumn);
                }
            }

            if (VertSpacing > 0)
            {
                for (int i = 0; i < rowCount - 1; i++)
                {
                    TableRow newRow = new TableRow();
                    newRow.Height = VertSpacing;
                    table.Rows.Insert(i * 2 + 1, newRow);
                }
            }

            table.Left   = AbsLeft;
            table.Top    = AbsTop;
            table.Width  = table.Columns[table.ColumnCount - 1].Right;
            table.Height = table.Rows[table.RowCount - 1].Bottom;
            return(table);
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Uses fill object to set necessary properties to be used for notification
 /// </summary>
 /// <param name="fill"></param>
 public void SetFill(Fill fill)
 {
     // Set fill by duplicating
     _fill = (Fill)fill.Clone();
 }