Пример #1
0
        private static void SetHorizontalLine(Section section)
        {
            const double height        = 0.1;
            var          hrFillColor   = Colors.DarkSlateGray;
            var          hrBorderColor = Colors.DarkSlateGray;

            var paragraph = section.AddParagraph();
            var newBorder = new Border {
                Style = BorderStyle.Single, Color = hrBorderColor, Width = height
            };

            paragraph.Format = new ParagraphFormat
            {
                Font    = new Font("Courier New", Unit.FromMillimeter(height)),
                Shading = new Shading {
                    Visible = true, Color = hrFillColor
                },
                Borders = new Borders
                {
                    Color  = Colors.Gray,
                    Bottom = newBorder,
                    Left   = newBorder.Clone(),
                    Right  = newBorder.Clone(),
                    Top    = newBorder.Clone()
                },
                SpaceBefore = "-7.2mm",
                LeftIndent  = "2mm",
                RightIndent = "-1cm"
            };
        }
Пример #2
0
 public void SetFormatting(ReportComponentBase c)
 {
     if (c != null)
     {
         if (Border != null && c.FlagUseBorder)
         {
             c.Border = Border.Clone();
         }
         if (c.FlagUseFill)
         {
             c.Fill = Fill.Clone();
         }
     }
     if (c is TextObject)
     {
         TextObject c1 = c as TextObject;
         if (Font != null)
         {
             c1.Font = Font;
         }
         c1.HorzAlign = HorzAlign;
         c1.VertAlign = VertAlign;
         c1.TextFill  = TextFill.Clone();
         c1.Angle     = Angle;
     }
 }
Пример #3
0
        public static uint AddBorder(this Stylesheet stylesheet, Border border)
        {
            Border clone = (Border)border.Clone();

            stylesheet.Borders.Append(clone);
            return((uint)stylesheet.Borders.ToList().IndexOf(clone));
        }
Пример #4
0
        public object Clone()
        {
            PmsPageSplitter layout = new PmsPageSplitter();

            layout.Name      = Name;
            layout.AutoSize  = AutoSize;
            layout.BackColor = BackColor;
            if (null != BackgroundImage)
            {
                layout.BackgroundImage = BackgroundImage.Clone() as Image;
            }
            layout.BackgroundImageLayout = BackgroundImageLayout;
            if (null != Border)
            {
                layout.Border = Border.Clone() as ElementBorder;
                layout.Border.OwnerElement = layout;
            }
            layout.BorderName = BorderName;
            if (null != ExternDatas)
            {
                layout.ExternDatas = new List <ExternData>();
                foreach (ExternData ed in ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    layout.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (null != Font)
            {
                layout.Font = Font.Clone() as Font;
            }
            layout.HasBorder         = HasBorder;
            layout.HasBottomBorder   = HasBottomBorder;
            layout.HasLeftBorder     = HasLeftBorder;
            layout.HasRightBorder    = HasRightBorder;
            layout.HasTopBorder      = HasTopBorder;
            layout.Height            = Height;
            layout.HorizontalScale   = HorizontalScale;
            layout.Location          = Location;
            layout.MESType           = MESType;
            layout.MoveX             = MoveX;
            layout.MoveY             = MoveY;
            layout.Text              = Text;
            layout.VerticalScale     = VerticalScale;
            layout.Width             = Width;
            layout.Visible           = Visible;
            layout.MESType           = MESType;
            layout.EnableSplitter    = EnableSplitter;
            layout.VisibleExpression = VisibleExpression;
            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)layout).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }
            return(layout);
        }
Пример #5
0
        /// <summary>
        /// Рендерит докумет с дополнительными параметрами.
        /// </summary>
        /// <param name="zoom">Множитель увеличения. Например: 1 - без увеличения, 0.5 - уменьшить в 2 раза.</param>
        /// <param name="im">Выходное изображение.</param>
        /// <param name="c">Цвет выделенного контура.</param>
        /// <param name="cont">Выделенный контур.</param>
        public void RenderEX(float zoom, out Bitmap im, Color c, GraphicsPath cont)
        {
            var width = (int)(Size.Width * zoom);
            var heigh = (int)(Size.Height * zoom);

            try
            {
                var rec  = new Rectangle(0, 0, width, heigh);
                var rec1 = new Rectangle(0, 0, width - 2, heigh - 2);
                var p    = new Pen(Color.Black, 1.5f);
                var pp   = new Pen(Color.Black, 1.5f);
                p.DashStyle = DashStyle.Dot;
                var bmp = new Bitmap(width, heigh);
                using (var gr = Graphics.FromImage(bmp))
                {
                    gr.FillRectangle(Brushes.White, rec);
                    gr.DrawRectangle(p, rec1);
                    if (Border.Use)
                    {
                        var g = DocumentBorderRender.Render((DocumentBorder)Border.Clone(), Size);
                        var m = new Matrix();
                        m.Scale(zoom, zoom);
                        g.Transform(m);
                        gr.DrawPath(BorderPen, g);
                    }
                    foreach (var a in Items)
                    {
                        var g = (GraphicsPath)a.Render().Clone();
                        //GraphicsPath scaled = Scale(g, a.Size.Width, a.Size.Height);
                        var m = new Matrix();
                        m.Scale(zoom, zoom);
                        g.Transform(m);
                        m.RotateAt(a.Angle, new PointF(a.Size.Width / 2, a.Size.Height / 2));
                        if (a.UseDispColor)
                        {
                            pp = new Pen(a.DispColor, 1.5f);
                            gr.DrawPath(pp, g);
                        }
                        else
                        {
                            gr.DrawPath(Pens.Black, g);
                        }
                    }
                    {
                        var m = new Matrix();
                        m.Scale(zoom, zoom);
                        cont.Transform(m);
                        pp = new Pen(c, 1.5f);
                        gr.DrawPath(pp, cont);
                    }
                }
                im = bmp;
            }
            catch
            {
                im = null;
            }
        }
Пример #6
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>A new object that is a copy of this instance.</returns>
        public LegendOptions Clone()
        {
            var clonned = (LegendOptions)MemberwiseClone();

            clonned.Font   = Font.Clone();
            clonned.Border = Border.Clone();

            return(clonned);
        }
Пример #7
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>A new object that is a copy of this instance.</returns>
        public FooterTitleOptions Clone()
        {
            var clonned = (FooterTitleOptions)MemberwiseClone();

            clonned.Font   = Font.Clone();
            clonned.Border = Border.Clone();

            return(clonned);
        }
Пример #8
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);
        }
Пример #9
0
        public override Control CreateControl()
        {
            Image img = new Image();

            CopyBasicProperties(img);
            img.ImageKey = ImageKey;
            img.Border   = (Border)Border.Clone();
            img.Offset   = new Point(offset.X, offset.Y);
            return(img);
        }
Пример #10
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);
        }
Пример #11
0
 /// <summary>
 /// Invokes the border editor.
 /// </summary>
 /// <param name="border">The <b>Border</b> to edit.</param>
 /// <returns>The new border.</returns>
 public static Border EditBorder(Border border)
 {
     using (BorderEditorForm editor = new BorderEditorForm())
     {
         editor.Border = border.Clone();
         if (editor.ShowDialog() == DialogResult.OK)
         {
             return(editor.Border);
         }
     }
     return(border);
 }
Пример #12
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);
 }
Пример #13
0
        public object Clone()
        {
            var style = new CSSStyleDeclaration
            {
                Color      = this.Color.Clone() as CSSColor,
                Background = Background.Clone() as CSSBackground,
                Padding    = Padding.Clone() as CSSPadding,
                Margin     = Margin.Clone() as CSSMargin,
                Border     = Border.Clone() as CSSBorder,
                Cursor     = Cursor.Clone() as CSSCursor,
                Float      = Float.Clone() as CSSFloat,
                Font       = Font.Clone() as CSSFont,
                Left       = Left.Clone() as CSSNumber,
                Right      = Right.Clone() as CSSNumber,
                Width      = Width.Clone() as CSSNumber,
                Height     = Height.Clone() as CSSNumber,
                Display    = Display.Clone() as CSSDisplay,
                Position   = Position.Clone() as CSSPosition
            };

            return(style);
        }
Пример #14
0
        public override Control CreateControl()
        {
            TextBlock textBlock = new TextBlock();

            CopyBasicProperties(textBlock);
            textBlock.CanGrow             = CanGrow;
            textBlock.CanShrink           = CanShrink;
            textBlock.Border              = (Border)Border.Clone();
            textBlock.FontName            = FontName;
            textBlock.LineSpan            = LineSpan;
            textBlock.Padding             = new Thickness(Padding.Left, Padding.Top, Padding.Right, Padding.Bottom);
            textBlock.FontSize            = FontSize;
            textBlock.FontSlant           = FontSlant;
            textBlock.FontWeight          = FontWeight;
            textBlock.FontColor           = new Color(FontColor.R, FontColor.G, FontColor.B, FontColor.A);
            textBlock.FieldName           = FieldName;
            textBlock.FieldKind           = FieldKind;
            textBlock.FieldTextFormat     = FieldTextFormat;
            textBlock.HorizontalAlignment = HorizontalAlignment;
            textBlock.VerticalAlignment   = VerticalAlignment;
            textBlock.Text = Text;
            return(textBlock);
        }
Пример #15
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns>对象</returns>
        public object Clone()
        {
            BarCodeWrapper bcw = new BarCodeWrapper();

            bcw.Name      = Name;
            bcw.AutoSize  = AutoSize;
            bcw.BackColor = BackColor;
            if (null != BackgroundImage)
            {
                bcw.BackgroundImage = BackgroundImage.Clone() as Image;
            }
            bcw.BackgroundImageLayout = BackgroundImageLayout;
            if (null != Border)
            {
                bcw.Border = Border.Clone() as ElementBorder;
                bcw.Border.OwnerElement = bcw;
            }
            bcw.BorderName = BorderName;
            if (null != ExternDatas)
            {
                bcw.ExternDatas = new List <ExternData>();
                foreach (ExternData ed in ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    bcw.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (null != Font)
            {
                bcw.Font = Font.Clone() as Font;
            }
            bcw.HasBorder       = HasBorder;
            bcw.HasBottomBorder = HasBottomBorder;
            bcw.HasLeftBorder   = HasLeftBorder;
            bcw.HasRightBorder  = HasRightBorder;
            bcw.HasTopBorder    = HasTopBorder;
            bcw.Height          = Height;
            bcw.HorizontalScale = HorizontalScale;
            bcw.Location        = Location;
            bcw.MESType         = MESType;
            bcw.MoveX           = MoveX;
            bcw.MoveY           = MoveY;
            bcw.Parent          = Parent;
            bcw.Text            = Text;
            bcw.VerticalScale   = VerticalScale;
            bcw.Width           = Width;
            if (null != SourceField)
            {
                bcw.SourceField = SourceField.Clone();
            }
            bcw.EnableMapping = EnableMapping;
            bcw.MappingTable  = MappingTable;
            bcw.Expression    = Expression;
            bcw.RealText      = RealText;
            bcw.IncludeLabel  = IncludeLabel;
            bcw.BarCodeAlign  = BarCodeAlign;
            bcw.BarCodeType   = BarCodeType;
            bcw.Visible       = Visible;
            bcw.MESType       = MESType;
            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)bcw).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }
            return(bcw);
        }
Пример #16
0
 private void Clear()
 {
     captureZone.Children.Clear();
     _dragBorder = _dummyBorder.Clone();
     captureZone.Children.Add(_dragBorder);
 }
Пример #17
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            PmsLabel label = new PmsLabel();

            label.BackColor  = this.BackColor;
            label.StrFormate = StrFormate;
            label.Anchor     = this.Anchor;
            label.Bounds     = this.Bounds;
            label.BorderName = this.BorderName;
            if (null != ExternDatas && ExternDatas.Count > 0)
            {
                if (null == label.ExternDatas)
                {
                    label.ExternDatas = new List <ExternData>();
                }
                foreach (ExternData ed in this.ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    label.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (null != this.Border)
            {
                label.Border = Border.Clone() as ElementBorder;
                label.Border.OwnerElement = label;
            }
            label.ForeColor       = this.ForeColor;
            label.HasBottomBorder = this.HasBottomBorder;
            label.HasLeftBorder   = this.HasLeftBorder;
            label.HasRightBorder  = this.HasRightBorder;
            label.HasTopBorder    = this.HasTopBorder;
            label.Height          = this.Height;
            label.Width           = this.Width;
            label.VerticalScale   = this.VerticalScale;
            label.HorizontalScale = this.HorizontalScale;
            label.Location        = this.Location;
            label.Left            = this.Left;
            label.Top             = this.Top;
            label.Text            = this.Text;
            label.Region          = this.Region;
            label.RightToLeft     = this.RightToLeft;
            label.HasBorder       = this.HasBorder;
            //label.Site = this.Site;
            label.RealText = this.RealText;
            if (null != this.SourceField)
            {
                label.SourceField = this.SourceField.Clone() as SourceField;
            }
            label.Size      = this.Size;
            label.MoveX     = this.MoveX;
            label.MoveY     = this.MoveY;
            label.Name      = this.Name;
            label.TextAlign = this.TextAlign;
            if (null != Expression)
            {
                label.Expression = Expression.Clone() as string;
            }
            label.EnableMapping = EnableMapping;
            label.MappingTable  = MappingTable;
            label.Font          = new Font(this.Font.FontFamily, this.Font.Size, this.Font.Style, this.Font.Unit, this.Font.GdiCharSet, this.Font.GdiVerticalFont);
            label.Visible       = Visible;
            label.MESType       = MESType;
            label.RotateDegree  = RotateDegree;
            //for (int i = 0; i < _bindedValues.Values.Count; i++)
            //{
            //    label._bindedValues[_bindedValues.Keys.ElementAt(i)] = _bindedValues.Values.ElementAt(i).ToString();
            //}
            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)label).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }


            if (null != Tag)
            {
                if (Tag is ICloneable)
                {
                    label.Tag = ((ICloneable)Tag).Clone();
                }
                else
                {
                    label.Tag = Tag;
                }
            }

            return(label);
        }
Пример #18
0
        public IControlTranslator ToElement(bool transferChild)
        {
            PmsLabelWrapper label = new PmsLabelWrapper();

            label.BackColor  = this.BackColor;
            label.StrFormate = StrFormate;
            label.BorderName = this.BorderName;
            if (null != ExternDatas && ExternDatas.Count > 0)
            {
                if (null == label.ExternDatas)
                {
                    label.ExternDatas = new List <ExternData>();
                }
                foreach (ExternData ed in this.ExternDatas)
                {
                    label.ExternDatas.Add(ed);
                }
            }
            if (null != this.Border)
            {
                label.Border = Border.Clone() as ElementBorder;
                label.Border.OwnerElement = label;
            }
            label.Text            = Text;
            label.ForeColor       = this.ForeColor;
            label.HasBottomBorder = this.HasBottomBorder;
            label.HasLeftBorder   = this.HasLeftBorder;
            label.HasRightBorder  = this.HasRightBorder;
            label.HasTopBorder    = this.HasTopBorder;
            label.HasBorder       = HasBorder;
            label.Visible         = Visible;
            label.MESType         = MESType;
            if (_orginalHeight > 0)
            {
                label.Height = this._orginalHeight;
            }
            else
            {
                label.Height = this.Height;
            }
            if (_orginalWidth > 0)
            {
                label.Width = _orginalWidth;
            }
            else
            {
                label.Width = this.Width;
            }
            //label.VerticalScale = this.VerticalScale;
            //label.HorizontalScale = this.HorizontalScale;
            if (_orginalLocation != Point.Empty)
            {
                label.Location = this._orginalLocation;
            }
            else
            {
                label.Location = this.Location;
            }
            label.VerticalScale   = 1f;
            label.HorizontalScale = 1f;
            label.MoveX           = this.MoveX;
            label.MoveY           = this.MoveY;
            label.Name            = this.Name;
            label.TextAlign       = this.TextAlign;
            label.Expression      = Expression;
            label.EnableMapping   = EnableMapping;
            label.MappingTable    = MappingTable;
            if (_orginalFontSize > 0)
            {
                label.Font = new Font(Font.FontFamily, _orginalFontSize);
            }
            else
            {
                label.Font = new Font(this.Font.FontFamily, this.Font.Size);
            }

            if (EnableMapping)
            {
                label.EnableMapping = false;
                if (!string.IsNullOrEmpty(RealText))
                {
                    label.RealText = GetMapValue(RealText);
                }
            }

            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)label).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }

            label.RealText = RealText;
            return(label);
        }
Пример #19
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns>对象</returns>
        public object Clone()
        {
            PmsLabelWrapper label = new PmsLabelWrapper();

            label.BackColor  = this.BackColor;
            label.StrFormate = StrFormate;
            label.BorderName = this.BorderName;
            if (null != ExternDatas && ExternDatas.Count > 0)
            {
                if (null == label.ExternDatas)
                {
                    label.ExternDatas = new List <ExternData>();
                }
                foreach (ExternData ed in this.ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    label.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (null != this.Border)
            {
                label.Border = Border.Clone() as ElementBorder;
                label.Border.OwnerElement = label;
            }
            label.ForeColor       = this.ForeColor;
            label.HasBottomBorder = this.HasBottomBorder;
            label.HasLeftBorder   = this.HasLeftBorder;
            label.HasRightBorder  = this.HasRightBorder;
            label.HasTopBorder    = this.HasTopBorder;
            label.Height          = this.Height;
            label.Width           = this.Width;
            label.VerticalScale   = this.VerticalScale;
            label.HorizontalScale = this.HorizontalScale;
            label.Location        = this.Location;
            label.HasBorder       = this.HasBorder;
            label.RealText        = this.RealText;
            label.Text            = this.Text;
            label.Visible         = Visible;
            if (null != this.SourceField)
            {
                label.SourceField = this.SourceField.Clone() as SourceField;
            }
            if (null != Font)
            {
                label.Font = new Font(this.Font.FontFamily, this.Font.Size, this.Font.Style);
            }
            label.MoveX         = this.MoveX;
            label.MoveY         = this.MoveY;
            label.Name          = this.Name;
            label.TextAlign     = this.TextAlign;
            label.Expression    = Expression;
            label.EnableMapping = EnableMapping;
            label.MappingTable  = MappingTable;
            label.MESType       = MESType;
            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)label).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }
            return(label);
        }
Пример #20
0
        public IControlTranslator ToElement(bool transferChild)
        {
            PmsSplitterWrapper layout = new PmsSplitterWrapper();

            layout.Name      = Name;
            layout.AutoSize  = AutoSize;
            layout.BackColor = BackColor;
            if (null != BackgroundImage)
            {
                layout.BackgroundImage = BackgroundImage.Clone() as Image;
            }
            layout.BackgroundImageLayout = BackgroundImageLayout;
            if (null != Border)
            {
                layout.Border = Border.Clone() as ElementBorder;
            }
            layout.BorderName = BorderName;
            if (null != ExternDatas)
            {
                layout.ExternDatas = new List <ExternData>();
                foreach (ExternData ed in ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    layout.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (_orginalFontSize > 0)
            {
                layout.Font = new Font(Font.FontFamily, _orginalFontSize);
            }
            else
            {
                layout.Font = new Font(this.Font.FontFamily, this.Font.Size);
            }
            layout.VerticalScale     = 1f;
            layout.HorizontalScale   = 1f;
            layout.HasBorder         = HasBorder;
            layout.HasBottomBorder   = HasBottomBorder;
            layout.HasLeftBorder     = HasLeftBorder;
            layout.HasRightBorder    = HasRightBorder;
            layout.HasTopBorder      = HasTopBorder;
            layout.Location          = Location;
            layout.MESType           = MESType;
            layout.MoveX             = MoveX;
            layout.MoveY             = MoveY;
            layout.Text              = Text;
            layout.Visible           = Visible;
            layout.MESType           = MESType;
            layout.VisibleExpression = VisibleExpression;
            layout.EnableSplitter    = EnableSplitter;
            if (_orginalHeight > 0)
            {
                layout.Height = this._orginalHeight;
            }
            else
            {
                layout.Height = this.Height;
            }
            if (_orginalWidth > 0)
            {
                layout.Width = _orginalWidth;
            }
            else
            {
                layout.Width = this.Width;
            }
            //layout.VerticalScale = this.VerticalScale;
            //layout.HorizontalScale = this.HorizontalScale;
            if (_orginalLocation != Point.Empty)
            {
                layout.Location = this._orginalLocation;
            }
            else
            {
                layout.Location = this.Location;
            }
            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)layout).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }
            return(layout);
        }
Пример #21
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            BarCode bc = new BarCode();

            bc.ForeColor    = ForeColor;
            bc.BackColor    = this.BackColor;
            bc.BarCodeType  = this.BarCodeType;
            bc.BarCodeAlign = this.BarCodeAlign;
            if (null != Border)
            {
                bc.Border = Border.Clone() as ElementBorder;
                bc.Border.OwnerElement = bc;
            }
            if (null != ExternDatas && ExternDatas.Count > 0)
            {
                if (null == bc.ExternDatas)
                {
                    bc.ExternDatas = new List <ExternData>();
                }
                foreach (ExternData ed in this.ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    bc.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            bc.HasBottomBorder = this.HasBottomBorder;
            bc.HasLeftBorder   = this.HasLeftBorder;
            bc.HasRightBorder  = this.HasRightBorder;
            bc.HasTopBorder    = this.HasTopBorder;
            if (_orginalHeight > 0)
            {
                bc.Height = this._orginalHeight;
            }
            else
            {
                bc.Height = this.Height;
            }
            if (_orginalWidth > 0)
            {
                bc.Width = _orginalWidth;
            }
            else
            {
                bc.Width = this.Width;
            }
            //edit.VerticalScale = this.VerticalScale;
            //edit.HorizontalScale = this.HorizontalScale;
            if (_orginalLocation != Point.Empty)
            {
                bc.Location = this._orginalLocation;
            }
            else
            {
                bc.Location = this.Location;
            }
            bc.Left         = this.Left;
            bc.Top          = this.Top;
            bc.Text         = this.Text;
            bc.Region       = this.Region;
            bc.RightToLeft  = this.RightToLeft;
            bc.HasBorder    = this.HasBorder;
            bc.RealText     = this.RealText;
            bc.IncludeLabel = this.IncludeLabel;
            if (null != this.SourceField)
            {
                bc.SourceField = this.SourceField.Clone() as SourceField;
            }
            if (null != Expression)
            {
                bc.Expression = Expression.Clone() as string;
            }
            bc.Size            = this.Size;
            bc.MoveX           = this.MoveX;
            bc.MoveY           = this.MoveY;
            bc.Name            = this.Name;
            bc.TextAlign       = this.TextAlign;
            bc.VerticalScale   = 1f;
            bc.HorizontalScale = 1f;
            bc.Visible         = Visible;
            bc.MESType         = MESType;
            if (_orginalFontSize > 0)
            {
                bc.Font = new Font(Font.FontFamily, _orginalFontSize);
            }
            else
            {
                bc.Font = new Font(this.Font.FontFamily, this.Font.Size);
            }
            bc.LabelFont = new Font(this.LabelFont.FontFamily, this.LabelFont.Size);
            if (null != Tag)
            {
                if (Tag is ICloneable)
                {
                    bc.Tag = ((ICloneable)Tag).Clone();
                }
                else
                {
                    bc.Tag = Tag;
                }
            }
            if (null != ((IElement)this).ExtendObject)
            {
                bc.Tag = ((ICloneable)((IElement)this).ExtendObject).Clone();
            }
            return(bc);
        }
Пример #22
0
        public IControlTranslator ToElement(bool transferChild)
        {
            QRCodeWrapper bcw = new QRCodeWrapper();

            bcw.Name      = Name;
            bcw.AutoSize  = AutoSize;
            bcw.BackColor = BackColor;
            if (null != BackgroundImage)
            {
                bcw.BackgroundImage = BackgroundImage.Clone() as Image;
            }
            bcw.BackgroundImageLayout = BackgroundImageLayout;
            if (null != Border)
            {
                bcw.Border = Border.Clone() as ElementBorder;
                bcw.Border.OwnerElement = bcw;
            }
            bcw.BorderName = BorderName;
            if (null != ExternDatas)
            {
                bcw.ExternDatas = new List <ExternData>();
                foreach (ExternData ed in ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    bcw.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            bcw.Font            = Font.Clone() as Font;
            bcw.HasBorder       = HasBorder;
            bcw.HasBottomBorder = HasBottomBorder;
            bcw.HasLeftBorder   = HasLeftBorder;
            bcw.HasRightBorder  = HasRightBorder;
            bcw.HasTopBorder    = HasTopBorder;
            // bcw.Height = Height;
            bcw.HorizontalScale = 1f;
            //bcw.Location = Location;
            bcw.MESType = MESType;
            bcw.MoveX   = MoveX;
            bcw.MoveY   = MoveY;
            //bcw.Parent = Parent;
            bcw.Text          = Text;
            bcw.VerticalScale = 1f;
            bcw.Visible       = Visible;
            bcw.MESType       = MESType;
            //bcw.Width = Width;
            if (null != SourceField)
            {
                bcw.SourceField = SourceField.Clone();
            }

            if (_orginalHeight > 0)
            {
                bcw.Height = this._orginalHeight;
            }
            else
            {
                bcw.Height = this.Height;
            }
            if (_orginalWidth > 0)
            {
                bcw.Width = _orginalWidth;
            }
            else
            {
                bcw.Width = this.Width;
            }
            //label.VerticalScale = this.VerticalScale;
            //label.HorizontalScale = this.HorizontalScale;
            if (_orginalLocation != Point.Empty)
            {
                bcw.Location = this._orginalLocation;
            }
            else
            {
                bcw.Location = this.Location;
            }

            bcw.EnableMapping   = EnableMapping;
            bcw.MappingTable    = MappingTable;
            bcw.Expression      = Expression;
            bcw.RealText        = RealText;
            bcw.IncludeLabel    = IncludeLabel;
            bcw.CorrectionLevel = CorrectionLevel;
            bcw.EncodedMode     = EncodedMode;

            if (null != ((IElement)this).ExtendObject)
            {
                bcw.ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }

            return(bcw);
        }
Пример #23
0
        public override object Clone()
        {
            PmsPageSplitter layout = new PmsPageSplitter();

            layout.BackColor  = this.BackColor;
            layout.Anchor     = this.Anchor;
            layout.Bounds     = this.Bounds;
            layout.BorderName = this.BorderName;
            if (null != ExternDatas && ExternDatas.Count > 0)
            {
                if (null == layout.ExternDatas)
                {
                    layout.ExternDatas = new List <ExternData>();
                }
                foreach (ExternData ed in this.ExternDatas)
                {
                    layout.ExternDatas.Add(ed);
                }
            }
            if (null != Border)
            {
                layout.Border = Border.Clone() as ElementBorder;
                layout.Border.OwnerElement = layout;
            }
            layout.Font              = Font.Clone() as Font;
            layout.Height            = this.Height;
            layout.Width             = this.Width;
            layout.VerticalScale     = this.VerticalScale;
            layout.HorizontalScale   = this.HorizontalScale;
            layout.Location          = this.Location;
            layout.Left              = this.Left;
            layout.Top               = this.Top;
            layout.Text              = this.Text;
            layout.Region            = this.Region;
            layout.RightToLeft       = this.RightToLeft;
            layout.Size              = this.Size;
            layout.MoveX             = this.MoveX;
            layout.MoveY             = this.MoveY;
            layout.Name              = this.Name;
            layout.Visible           = Visible;
            layout.MESType           = MESType;
            layout.EnableSplitter    = EnableSplitter;
            layout.VisibleExpression = VisibleExpression;
            if (null != Tag)
            {
                if (Tag is ICloneable)
                {
                    layout.Tag = ((ICloneable)Tag).Clone();
                }
                else
                {
                    layout.Tag = Tag;
                }
            }

            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)layout).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }
            return(layout);
        }
Пример #24
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns>对象</returns>
        public object Clone()
        {
            PmsEditWrapper edit = new PmsEditWrapper();

            edit.Name      = Name;
            edit.AutoSize  = AutoSize;
            edit.BackColor = BackColor;
            if (null != BackgroundImage)
            {
                edit.BackgroundImage = BackgroundImage.Clone() as Image;
            }
            edit.BackgroundImageLayout = BackgroundImageLayout;
            if (null != Border)
            {
                edit.Border = Border.Clone() as ElementBorder;
                edit.Border.OwnerElement = edit;
            }
            edit.BorderName = BorderName;
            if (null != ExternDatas)
            {
                edit.ExternDatas = new List <ExternData>();
                foreach (ExternData ed in ExternDatas)
                {
                    object value = ed.Value;
                    if (null != value && value is ICloneable)
                    {
                        value = ((ICloneable)value).Clone();
                    }
                    edit.ExternDatas.Add(new ExternData(ed.Key, value));
                }
            }
            if (null != Font)
            {
                edit.Font = Font.Clone() as Font;
            }
            edit.HasBorder       = HasBorder;
            edit.HasBottomBorder = HasBottomBorder;
            edit.HasLeftBorder   = HasLeftBorder;
            edit.HasRightBorder  = HasRightBorder;
            edit.HasTopBorder    = HasTopBorder;
            edit.Height          = Height;
            edit.HorizontalScale = HorizontalScale;
            edit.Location        = Location;
            edit.MESType         = MESType;
            edit.MoveX           = MoveX;
            edit.MoveY           = MoveY;
            edit.Parent          = Parent;
            edit.Text            = Text;
            edit.VerticalScale   = VerticalScale;
            edit.Width           = Width;
            edit.RealText        = RealText;
            edit.BorderStyle     = BorderStyle;
            edit.Var             = Var;
            edit.Visible         = Visible;
            edit.MESType         = MESType;
            if (null != ((IElement)this).ExtendObject)
            {
                ((IElement)edit).ExtendObject = ((IElement)this).ExtendObject.Clone() as ExtendObject;
            }
            return(edit);
        }