Beispiel #1
0
 internal void UpdateBackground()
 {
     PageColor.Update(new Rectangle(-2, -2, Width + 1, Height + 1), Owner.Alignment);
     TabColor.Update(Owner.BoundsNormalTab, Owner.Alignment);
     TabActiveColor.Update(Owner.BoundsSelectTab, Owner.Alignment);
     Invalidate();
 }
Beispiel #2
0
    public static PageColor ReadXml(XmlReader reader)
    {
        PageColor pc = new PageColor();

        if (reader.HasAttributes)
        {
            if (!string.IsNullOrEmpty(reader.GetAttribute("type")) && reader.GetAttribute("type") == "enumeration")
            {
                pc.PageColorOptions = (PageColorOptions)Parser.ParseEnum <PageColorOptions>(reader.ReadElementString());
            }
            else
            {
                throw new NotImplementedException();
            }
        }
        else
        {
            throw new NotImplementedException();
        }

        return(pc);
    }
Beispiel #3
0
        public static Page ReadXml(XmlReader reader)
        {
            Page p = new Page();

            if (reader.HasAttributes)
            {
                p.Self                = reader.GetAttribute("Self");
                p.GeometricBounds     = reader.GetAttribute("GeometricBounds");
                p.ItemTransform       = reader.GetAttribute("ItemTransform");
                p.Name                = reader.GetAttribute("Name");
                p.AppliedTrapPreset   = reader.GetAttribute("AppliedTrapPreset");
                p.OverrideList        = reader.GetAttribute("OverrideList");
                p.AppliedMaster       = reader.GetAttribute("AppliedMaster");
                p.MasterPageTransform = reader.GetAttribute("MasterPageTransform");
                p.TabOrder            = reader.GetAttribute("TabOrder").Split(' ');
                p.GridStartingPoint   = (GridStartingPointOptions)Enum.Parse(typeof(GridStartingPointOptions), reader.GetAttribute("GridStartingPoint"));
                p.UseMasterGrid       = Convert.ToBoolean(reader.GetAttribute("UseMasterGrid"));
            }

            if (reader.IsEmptyElement)
            {
                return(p);
            }

            while (reader.Read())
            {
                switch (reader.Name)
                {
                case "Properties":
                    while (reader.Read())
                    {
                        switch (reader.Name)
                        {
                        case "PageColor":
                            p.PageColor = PageColor.ReadXml(reader);
                            break;

                        case "Descriptor":
                            p.Descriptor = Descriptor.ReadXml(reader);
                            break;

                        default:
                            if (reader.NodeType == XmlNodeType.Element)
                            {
                                Debug.WriteLine("Unrecognized element: {0} in element: {1}", reader.Name, "Page - Properties");
                            }
                            break;
                        }
                        if (reader.Name == "Properties" & reader.NodeType == XmlNodeType.EndElement)
                        {
                            break;
                        }
                    }
                    break;

                case "GridDataInformation":
                    p.GridDataInformation = GridDataInformation.ReadXml(reader);
                    break;

                case "MarginPreference":
                    p.MarginPreference = MarginPreference.ReadXml(reader);
                    break;

                case "Page":
                    if (reader.NodeType == XmlNodeType.EndElement)
                    {
                        goto exit1;
                    }

                    break;

                default:
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        Debug.WriteLine("Unrecognized element: {0} in element: {1}", reader.Name, "Page");
                    }
                    break;
                }
            }

exit1:
            return(p);
        }