public GenericItemContainer() { // We contain other controls m_IsContainer=true; m_PaddingLeft=1; m_PaddingTop=1; m_PaddingBottom=1; m_PaddingRight=1; m_ItemSpacing=0; m_BackgroundColor=Color.Empty; m_BorderType=eBorderType.None; m_WrapItems=false; m_MoreItems=null; m_EqualButtonSize=false; //m_Stretch=false; m_MoreItemsOnMenu=false; m_SystemContainer=false; this.AccessibleRole=System.Windows.Forms.AccessibleRole.Grouping; }
internal static void DrawBorder(Graphics g, eBorderType bordertype, Rectangle r, Color singleLineColor, eBorderSide side, System.Drawing.Drawing2D.DashStyle borderDashStyle, int lineWidth) { if (lineWidth <= 0) return; System.Windows.Forms.Border3DSide border3dside; if (side == eBorderSide.All) border3dside = System.Windows.Forms.Border3DSide.All; else border3dside = (((side | eBorderSide.Left) != 0) ? System.Windows.Forms.Border3DSide.Left : 0) | (((side | eBorderSide.Right) != 0) ? System.Windows.Forms.Border3DSide.Right : 0) | (((side | eBorderSide.Top) != 0) ? System.Windows.Forms.Border3DSide.Top : 0) | (((side | eBorderSide.Bottom) != 0) ? System.Windows.Forms.Border3DSide.Bottom : 0); switch (bordertype) { case eBorderType.Bump: { System.Windows.Forms.ControlPaint.DrawBorder3D(g, r, System.Windows.Forms.Border3DStyle.Bump, border3dside); break; } case eBorderType.Etched: System.Windows.Forms.ControlPaint.DrawBorder3D(g, r, System.Windows.Forms.Border3DStyle.Etched, border3dside); break; case eBorderType.Raised: System.Windows.Forms.ControlPaint.DrawBorder3D(g, r, System.Windows.Forms.Border3DStyle.RaisedInner, border3dside); break; case eBorderType.Sunken: System.Windows.Forms.ControlPaint.DrawBorder3D(g, r, System.Windows.Forms.Border3DStyle.SunkenOuter, border3dside); break; case eBorderType.SingleLine: { SmoothingMode sm = g.SmoothingMode; g.SmoothingMode = SmoothingMode.None; using (Pen pen = new Pen(singleLineColor, lineWidth)) { pen.DashStyle = borderDashStyle; int offset = lineWidth / 2; if ((side & eBorderSide.Left) != 0) g.DrawLine(pen, r.X + offset, r.Y, r.X + offset, r.Bottom - 1); if ((side & eBorderSide.Top) != 0) g.DrawLine(pen, r.X, r.Y + offset, r.Right - 1, r.Y + offset); if (offset == 0) offset = 1; if ((side & eBorderSide.Right) != 0) g.DrawLine(pen, r.Right - offset, r.Y, r.Right - offset, r.Bottom - 1); if ((side & eBorderSide.Bottom) != 0) g.DrawLine(pen, r.X, r.Bottom - offset, r.Right - 1, r.Bottom - offset); } g.SmoothingMode = sm; break; } case eBorderType.DoubleLine: { using (Pen pen = new Pen(singleLineColor, lineWidth)) { pen.DashStyle = borderDashStyle; for (int i = 0; i < lineWidth + 1; i += lineWidth) { if ((side & eBorderSide.Left) != 0) g.DrawLine(pen, r.X, r.Y, r.X, r.Bottom - 1); if ((side & eBorderSide.Top) != 0) g.DrawLine(pen, r.X, r.Y, r.Right - 1, r.Y); if ((side & eBorderSide.Right) != 0) g.DrawLine(pen, r.Right - 1, r.Y, r.Right - 1, r.Bottom - 1); if ((side & eBorderSide.Bottom) != 0) g.DrawLine(pen, r.X, r.Bottom - 1, r.Right - 1, r.Bottom - 1); r.Inflate(-1, -1); } } break; } default: break; } }
internal static void DrawBorder(Graphics g, eBorderType bordertype, Rectangle r, Color singleLineColor, eBorderSide side, System.Drawing.Drawing2D.DashStyle borderDashStyle) { DrawBorder(g, bordertype, r, singleLineColor, side, borderDashStyle, 1); }
internal static void DrawBorder(Graphics g, eBorderType bordertype, Rectangle r, Color singleLineColor) { DrawBorder(g, bordertype, r, singleLineColor, eBorderSide.Left | eBorderSide.Right | eBorderSide.Top | eBorderSide.Bottom); }
public override void Deserialize(ItemSerializationContext context) { base.Deserialize(context); System.Xml.XmlElement ItemXmlSource = context.ItemXmlElement; m_BorderType=(eBorderType)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("bt")); if (ItemXmlSource.HasAttribute("BorderSide")) m_BorderSide = (eBorderSide)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("BorderSide")); else m_BorderSide = DEFAULT_BORDERSIDE; if(ItemXmlSource.HasAttribute("bc")) m_BackColor=BarFunctions.ColorFromString(ItemXmlSource.GetAttribute("bc")); else m_BackColor=Color.Empty; m_ForeColor=BarFunctions.ColorFromString(ItemXmlSource.GetAttribute("fc")); if (ItemXmlSource.HasAttribute("sc")) { m_SingleLineColor = BarFunctions.ColorFromString(ItemXmlSource.GetAttribute("sc")); if (m_SingleLineColor != SystemColors.ControlDark) m_SingleLineColorCustom = true; } else { m_SingleLineColorCustom = false; m_SingleLineColor = SystemColors.ControlDark; } m_TextAlignment=(StringAlignment)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("ta")); m_TextLineAlignment=(StringAlignment)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("tla")); m_DividerStyle=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("ds")); m_PaddingLeft=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pl")); m_PaddingRight=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pr")); m_PaddingTop=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pt")); m_PaddingBottom=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pb")); m_Width=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("w")); m_Height=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("h")); // Load font information if it exists if(ItemXmlSource.HasAttribute("fontname")) { string FontName=ItemXmlSource.GetAttribute("fontname"); float FontSize=System.Xml.XmlConvert.ToSingle(ItemXmlSource.GetAttribute("fontemsize")); System.Drawing.FontStyle FontStyle=(System.Drawing.FontStyle)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("fontstyle")); try { this.Font=new Font(FontName,FontSize,FontStyle); } catch(Exception) { this.Font = SystemFonts.DefaultFont; // System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font; } } // Load Images foreach(System.Xml.XmlElement xmlElem in ItemXmlSource.ChildNodes) { if(xmlElem.Name=="images") { if(xmlElem.HasAttribute("imageindex")) m_ImageIndex=System.Xml.XmlConvert.ToInt32(xmlElem.GetAttribute("imageindex")); foreach(System.Xml.XmlElement xmlElem2 in xmlElem.ChildNodes) { switch(xmlElem2.GetAttribute("type")) { case "default": { m_Image=BarFunctions.DeserializeImage(xmlElem2); m_ImageIndex=-1; break; } case "icon": { m_Icon=BarFunctions.DeserializeIcon(xmlElem2); m_ImageIndex=-1; break; } } } break; } } }
internal void Deserialize(System.Xml.XmlElement styleElement) { m_BackColor1=ColorEx.Empty; if(styleElement.HasAttribute("bc1")) { m_BackColor1.Color=BarFunctions.ColorFromString(styleElement.GetAttribute("bc1")); m_BackColor1.Alpha=System.Xml.XmlConvert.ToByte(styleElement.GetAttribute("bc1a")); } else if(styleElement.HasAttribute("bc1csp")) m_BackColor1.ColorSchemePart=(eColorSchemePart)Enum.Parse(typeof(eColorSchemePart),styleElement.GetAttribute("bc1csp")); m_BackColor2=ColorEx.Empty; if(styleElement.HasAttribute("bc2")) { m_BackColor2.Color=BarFunctions.ColorFromString(styleElement.GetAttribute("bc2")); m_BackColor2.Alpha=System.Xml.XmlConvert.ToByte(styleElement.GetAttribute("bc2a")); } else if(styleElement.HasAttribute("bc2csp")) m_BackColor2.ColorSchemePart=(eColorSchemePart)Enum.Parse(typeof(eColorSchemePart),styleElement.GetAttribute("bc2csp")); m_ForeColor=ColorEx.Empty; if(styleElement.HasAttribute("fc")) { m_ForeColor.Color=BarFunctions.ColorFromString(styleElement.GetAttribute("fc")); m_ForeColor.Alpha=System.Xml.XmlConvert.ToByte(styleElement.GetAttribute("fca")); } else if(styleElement.HasAttribute("fccsp")) m_ForeColor.ColorSchemePart=(eColorSchemePart)Enum.Parse(typeof(eColorSchemePart),styleElement.GetAttribute("fccsp")); m_BorderColor=ColorEx.Empty; if(styleElement.HasAttribute("borderc")) { m_BorderColor.Color=BarFunctions.ColorFromString(styleElement.GetAttribute("borderc")); m_BorderColor.Alpha=System.Xml.XmlConvert.ToByte(styleElement.GetAttribute("borderca")); } else if(styleElement.HasAttribute("bordercsp")) m_BorderColor.ColorSchemePart=(eColorSchemePart)Enum.Parse(typeof(eColorSchemePart),styleElement.GetAttribute("bordercsp")); m_GradientAngle=System.Xml.XmlConvert.ToInt16(styleElement.GetAttribute("ga")); // Load font information if it exists m_Font=null; if(styleElement.HasAttribute("fontname")) { string FontName=styleElement.GetAttribute("fontname"); float FontSize=System.Xml.XmlConvert.ToSingle(styleElement.GetAttribute("fontemsize")); System.Drawing.FontStyle FontStyle=(System.Drawing.FontStyle)System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("fontstyle")); try { m_Font=new Font(FontName,FontSize,FontStyle); } catch(Exception) { m_Font=null; } } // Load Image m_BackgroundImage=null; foreach(System.Xml.XmlElement xmlElem in styleElement.ChildNodes) { if(xmlElem.Name=="backimage") { m_BackgroundImage=BarFunctions.DeserializeImage(xmlElem); m_BackgroundImagePosition=(eBackgroundImagePosition)System.Xml.XmlConvert.ToInt32(xmlElem.GetAttribute("pos")); m_BackgroundImageAlpha=System.Xml.XmlConvert.ToByte(xmlElem.GetAttribute("alpha")); } } m_WordWrap=false; if(styleElement.HasAttribute("wordwrap")) m_WordWrap=System.Xml.XmlConvert.ToBoolean(styleElement.GetAttribute("wordwrap")); m_Alignment=StringAlignment.Near; if(styleElement.HasAttribute("align")) m_Alignment=(StringAlignment)System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("align")); m_LineAlignment=StringAlignment.Center; if(styleElement.HasAttribute("valign")) m_LineAlignment=(StringAlignment)System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("valign")); m_TextTrimming=StringTrimming.EllipsisCharacter; if(styleElement.HasAttribute("trim")) m_TextTrimming=(StringTrimming)System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("trim")); m_Border=eBorderType.None; if(styleElement.HasAttribute("border")) m_Border=(eBorderType)System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("border")); m_BorderWidth=1; if(styleElement.HasAttribute("borderw")) m_BorderWidth=System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("borderw")); m_CornerType=eCornerType.Square; if(styleElement.HasAttribute("cornertype")) m_CornerType=(eCornerType)System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("cornertype")); m_CornerDiameter=DEFAULT_CORNER_DIAMETER; if(styleElement.HasAttribute("cornerdiameter")) m_CornerDiameter=System.Xml.XmlConvert.ToInt32(styleElement.GetAttribute("cornerdiameter")); }
internal void ApplyStyle(ItemStyle style) { if(style==null) return; m_Alignment=style.Alignment; if(!style.BackColor1.IsEmpty) m_BackColor1=style.BackColor1; if(!style.BackColor2.IsEmpty) m_BackColor2=style.BackColor2; if(style.BackgroundImage!=null) m_BackgroundImage=style.BackgroundImage; if(style.BackgroundImageAlpha!=255) m_BackgroundImageAlpha=style.BackgroundImageAlpha; if(style.BackgroundImagePosition!=eBackgroundImagePosition.Stretch) m_BackgroundImagePosition=style.BackgroundImagePosition; if(style.Border!=eBorderType.None) m_Border=style.Border; if(style.BorderDashStyle!=DashStyle.Solid) m_BorderDashStyle=style.BorderDashStyle; if(!style.BorderColor.IsEmpty) m_BorderColor=style.BorderColor; if(style.BorderSide!=DEFAULT_BORDERSIDE) m_BorderSide=style.BorderSide; if(style.BorderWidth!=1) m_BorderWidth=style.BorderWidth; if(style.Font!=null) m_Font=style.Font; if(!style.ForeColor.IsEmpty) m_ForeColor=style.ForeColor; if(style.LineAlignment!=StringAlignment.Center) m_LineAlignment=style.LineAlignment; if(style.TextTrimming!=StringTrimming.EllipsisCharacter) m_TextTrimming=style.TextTrimming; if(style.WordWrap!=false) m_WordWrap=style.WordWrap; if(style.MarginBottom!=0) m_MarginBottom=style.MarginBottom; if(style.MarginLeft!=0) m_MarginLeft=style.MarginLeft; if(style.MarginRight!=0) m_MarginRight=style.MarginRight; if(style.MarginTop!=0) m_MarginTop=style.MarginTop; if(style.CornerType!=eCornerType.Square) m_CornerType=style.CornerType; if(style.CornerDiameter!=DEFAULT_CORNER_DIAMETER) m_CornerDiameter=style.CornerDiameter; if (style.VerticalText) m_VerticalText = style.VerticalText; if (!style.UseMnemonic) _UseMnemonic = style.UseMnemonic; }
private void LoadCommonProperties(System.Xml.XmlElement xmlBar) { m_BarState = eBarState.Docked; this.Name = xmlBar.GetAttribute("name"); if (xmlBar.HasAttribute("candockleft")) m_CanDockLeft = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("candockleft")); if (xmlBar.HasAttribute("candockright")) m_CanDockRight = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("candockright")); if (xmlBar.HasAttribute("candocktop")) m_CanDockTop = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("candocktop")); if (xmlBar.HasAttribute("candockbottom")) m_CanDockBottom = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("candockbottom")); if (xmlBar.HasAttribute("candockdoc")) m_CanDockDocument = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("candockdoc")); if (xmlBar.HasAttribute("candocktab")) m_CanDockTab = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("candocktab")); if (xmlBar.HasAttribute("text")) this.Text = xmlBar.GetAttribute("text"); if (xmlBar.HasAttribute("dockline")) m_DockLine = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("dockline")); if (xmlBar.HasAttribute("dockoffset")) m_DockOffset = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("dockoffset")); if (xmlBar.HasAttribute("grabhandle")) m_GrabHandleStyle = (eGrabHandleStyle)System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("grabhandle")); if (xmlBar.HasAttribute("menubar")) m_MenuBar = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("menubar")); if (xmlBar.HasAttribute("stretch")) m_DockStretch = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("stretch")); if (xmlBar.HasAttribute("wrapdock")) m_WrapItemsDock = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("wrapdock")); if (xmlBar.HasAttribute("wrapfloat")) m_WrapItemsFloat = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("wrapfloat")); if (xmlBar.HasAttribute("custom")) m_CustomBar = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("custom")); if (xmlBar.HasAttribute("canhide")) m_CanHide = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("canhide")); if (xmlBar.HasAttribute("imagesize")) m_ImageSize = (eBarImageSize)System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("imagesize")); if (xmlBar.HasAttribute("itemsp")) m_ItemContainer.ItemSpacing = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("itemsp")); // else // m_ItemContainer.ItemSpacing=0; if (xmlBar.HasAttribute("backcolor")) m_ItemContainer.BackColor = BarFunctions.ColorFromString(xmlBar.GetAttribute("backcolor")); if (xmlBar.HasAttribute("layout")) m_ItemContainer.LayoutType = (eLayoutType)System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("layout")); if (xmlBar.HasAttribute("eqbutton")) m_ItemContainer.EqualButtonSize = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("eqbutton")); if (xmlBar.HasAttribute("dborder")) m_DockedBorder = (eBorderType)System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("dborder")); //else // m_DockedBorder=eBorderType.None; if (xmlBar.HasAttribute("acceptdrop")) m_AcceptDropItems = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("acceptdrop")); if (xmlBar.HasAttribute("slcolor")) m_SingleLineColor = BarFunctions.ColorFromString(xmlBar.GetAttribute("slcolor")); if (xmlBar.HasAttribute("captionbc")) m_CaptionBackColor = BarFunctions.ColorFromString(xmlBar.GetAttribute("captionbc")); if (xmlBar.HasAttribute("captionfc")) m_CaptionForeColor = BarFunctions.ColorFromString(xmlBar.GetAttribute("captionfc")); if (xmlBar.HasAttribute("dockwidth")) m_ItemContainer.MinWidth = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("dockwidth")); if (xmlBar.HasAttribute("dockheight")) m_ItemContainer.MinHeight = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("dockheight")); if (xmlBar.HasAttribute("splitwidthpercent")) m_SplitDockWidthPercent = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("splitwidthpercent")); else m_SplitDockWidthPercent = 0; if (xmlBar.HasAttribute("splitheightpercent")) m_SplitDockHeightPercent = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("splitheightpercent")); // else // m_SplitDockHeightPercent=0; if (xmlBar.HasAttribute("padbottom")) m_ItemContainer.PaddingBottom = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("padbottom")); if (xmlBar.HasAttribute("padleft")) m_ItemContainer.PaddingLeft = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("padleft")); if (xmlBar.HasAttribute("padright")) m_ItemContainer.PaddingRight = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("padright")); if (xmlBar.HasAttribute("padtop")) m_ItemContainer.PaddingTop = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("padtop")); if (xmlBar.HasAttribute("lockdockpos")) m_LockDockPosition = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("lockdockpos")); if (xmlBar.HasAttribute("canundock")) m_CanUndock = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("canundock")); if (xmlBar.HasAttribute("canreordertabs")) m_CanReorderTabs = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("canreordertabs")); if (xmlBar.HasAttribute("cantearoff")) m_CanTearOffTabs = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("cantearoff")); if (xmlBar.HasAttribute("canautohide")) m_CanAutoHide = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("canautohide")); if (xmlBar.HasAttribute("cancust")) m_ItemContainer.CanCustomize = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("cancust")); if (xmlBar.HasAttribute("tabalign")) m_DockTabAlignment = (eTabStripAlignment)System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("tabalign")); if (xmlBar.HasAttribute("showtab")) m_AlwaysDisplayDockTab = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("showtab")); // TODO: Menu Merge Implementation //if(xmlBar.HasAttribute("merge")) // m_MergeEnabled=System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("merge")); if (xmlBar.HasAttribute("hidein")) m_HideFloatingInactive = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("hidein")); if (xmlBar.HasAttribute("themes")) { m_ThemeAware = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("themes")); m_ItemContainer.ThemeAware = m_ThemeAware; } if (xmlBar.HasAttribute("tabnav")) m_TabNavigation = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("tabnav")); if (xmlBar.HasAttribute("tooltips")) m_ShowToolTips = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("tooltips")); // else // m_ShowToolTips=true; if (xmlBar.HasAttribute("overflowmenu")) m_ItemContainer.MoreItemsOnMenu = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("overflowmenu")); // else // m_ItemContainer.MoreItemsOnMenu=false; if (xmlBar.HasAttribute("autocaptionmenu")) m_AutoCreateCaptionMenu = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("autocaptionmenu")); // else // m_AutoCreateCaptionMenu=true; if (xmlBar.HasAttribute("autocaptionsync")) this.AutoSyncBarCaption = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("autocaptionsync")); // else // this.AutoSyncBarCaption=false; if (xmlBar.HasAttribute("style")) { string sty = xmlBar.GetAttribute("style"); //if (sty == "5") // this.Style = eDotNetBarStyle.Office2007; //else this.Style = (eDotNetBarStyle)System.Xml.XmlConvert.ToInt32(sty); } // Load font information if it exists if (xmlBar.HasAttribute("fontname")) { string FontName = xmlBar.GetAttribute("fontname"); float FontSize = System.Xml.XmlConvert.ToSingle(xmlBar.GetAttribute("fontemsize")); System.Drawing.FontStyle FontStyle = (System.Drawing.FontStyle)System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("fontstyle")); try { this.Font = new Font(FontName, FontSize, FontStyle); } catch (Exception) { this.Font = SystemFonts.MenuFont; // System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font; } m_CustomFont = true; } if (xmlBar.HasAttribute("ahanim")) m_AutoHideAnimationTime = System.Xml.XmlConvert.ToInt32(xmlBar.GetAttribute("ahanim")); // else // m_AutoHideAnimationTime=100; if (xmlBar.HasAttribute("savelayout")) m_SaveLayoutChanges = System.Xml.XmlConvert.ToBoolean(xmlBar.GetAttribute("savelayout")); // else // m_SaveLayoutChanges=true; }