Пример #1
0
        public SolidElement(SolidElement prototype) : base(prototype)
        {
            mBlend          = prototype.Blend;
            mCustomBrush    = prototype.CustomBrush;
            mDrawBackground = prototype.DrawBackground;
            mDrawBorder     = prototype.DrawBorder;
            mDrawGradient   = prototype.DrawGradient;
            mBackColor      = prototype.BackColor;
            mGradientColor  = prototype.GradientColor;
            mGradientMode   = prototype.GradientMode;
            mRotation       = prototype.Rotation;

            mTransformPath              = prototype.TransformPath;
            mTransformRectangle         = prototype.TransformRectangle;
            mTransformInternalRectangle = prototype.TransformInternalRectangle;

            if (prototype.Label != null)
            {
                Label = (TextLabel)prototype.Label.Clone();
            }
            if (prototype.Image != null)
            {
                Image = (Image)prototype.Image.Clone();
            }

            mStencilItem = prototype.StencilItem;
            //if (prototype.StencilItem != null) mStencilItem = (StencilItem) prototype.StencilItem.Clone();

            mInternalRectangle = prototype.InternalRectangle;
        }
Пример #2
0
        //Copies the stencil default values to the element supplied
        public virtual void CopyTo(SolidElement element)
        {
            //Set the element values
            element.SuspendEvents = true;

            element.BorderColor   = BorderColor;
            element.BorderStyle   = BorderStyle;
            element.SmoothingMode = SmoothingMode;
            element.BackColor     = BackColor;
            element.GradientColor = GradientColor;
            element.GradientMode  = GradientMode;
            element.DrawGradient  = DrawGradient;
            element.Label         = Label;
            element.Image         = Image;

            if (element is Shape)
            {
                Shape shape = (Shape)element;
                shape.KeepAspect = KeepAspect;

                //Make sure shape is resized to correct aspect
                if (KeepAspect && AspectRatio != 1)
                {
                    //If width greater than height
                    if (AspectRatio > 1)
                    {
                        shape.Height = shape.Width / AspectRatio;
                    }
                    else
                    {
                        shape.Width = shape.Height * AspectRatio;
                    }
                }
            }

            element.SuspendEvents = false;
        }
Пример #3
0
		public SolidElement(SolidElement prototype): base(prototype)
		{
			mBlend = prototype.Blend;
			mCustomBrush = prototype.CustomBrush;
			mDrawBackground = prototype.DrawBackground;
			mDrawBorder = prototype.DrawBorder;
			mDrawGradient = prototype.DrawGradient;
			mBackColor = prototype.BackColor;
			mGradientColor = prototype.GradientColor;
			mGradientMode = prototype.GradientMode;
			mRotation = prototype.Rotation;

			mTransformPath = prototype.TransformPath;
			mTransformRectangle = prototype.TransformRectangle;
			mTransformInternalRectangle = prototype.TransformInternalRectangle;
			
			if (prototype.Label != null) Label = (TextLabel) prototype.Label.Clone();
			if (prototype.Image != null) Image = (Image) prototype.Image.Clone();
			
			mStencilItem = prototype.StencilItem;
			//if (prototype.StencilItem != null) mStencilItem = (StencilItem) prototype.StencilItem.Clone();

			mInternalRectangle = prototype.InternalRectangle;
		}