示例#1
0
        public override object Clone()
        {
            ThreeDOutline clone = new ThreeDOutline();

            clone.DarkColor  = (mvarDarkColor.Clone() as string);
            clone.LightColor = (mvarLightColor.Clone() as string);
            clone.Type       = mvarType;
            clone.Width      = this.Width;
            return(clone);
        }
        private Outline OutlineFromTag(MarkupTagElement tag)
        {
            if (tag == null) return null;

            Outline outline = null;

            MarkupAttribute attOutlineType = tag.Attributes["Type"];
            if (attOutlineType != null)
            {
                switch (attOutlineType.Value.ToLower())
                {
                    case "none":
                    {
                        break;
                    }
                    case "solid":
                    {
                        MarkupAttribute attColor = tag.Attributes["Color"];
                        if (attColor != null)
                        {
                            SolidOutline realOutline = new SolidOutline();
                            realOutline.Color = attColor.Value;
                            outline = realOutline;
                        }
                        break;
                    }
                    case "inset":
                    case "outset":
                    {
                        MarkupAttribute attLightColor = tag.Attributes["LightColor"];
                        MarkupAttribute attDarkColor = tag.Attributes["DarkColor"];
                        MarkupAttribute attColor = tag.Attributes["Color"];

                        if ((attLightColor != null && attDarkColor != null) || (attColor != null))
                        {
                            ThreeDOutline realOutline = new ThreeDOutline();
                            switch (attOutlineType.Value.ToLower())
                            {
                                case "inset":
                                {
                                    realOutline.Type = ThreeDOutlineType.Inset;
                                    break;
                                }
                                case "outset":
                                {
                                    realOutline.Type = ThreeDOutlineType.Outset;
                                    break;
                                }
                            }
                            if (attLightColor != null && attDarkColor != null)
                            {
                                realOutline.LightColor = attLightColor.Value;
                                realOutline.DarkColor = attDarkColor.Value;
                            }
                            else if (attColor != null)
                            {
                                realOutline.LightColor = attColor.Value;
                                realOutline.DarkColor = attColor.Value;
                            }
                            outline = realOutline;
                        }
                        break;
                    }
                }

                MarkupAttribute attOutlineWidth = tag.Attributes["Width"];
                if (attOutlineWidth != null && outline != null)
                {
                    outline.Width = Single.Parse(attOutlineWidth.Value);
                }
            }
            return outline;
        }
 public override object Clone()
 {
     ThreeDOutline clone = new ThreeDOutline();
     clone.DarkColor = (mvarDarkColor.Clone() as string);
     clone.LightColor = (mvarLightColor.Clone() as string);
     clone.Type = mvarType;
     clone.Width = this.Width;
     return clone;
 }