示例#1
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);
        }
示例#2
0
        public PmsPageSplitter(IElement element)
        {
            this.MinimumSize = new Size(110, 16);
            this.MaximumSize = this.MinimumSize;
            PmsSplitterWrapper layout = element as PmsSplitterWrapper;

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