/// <summary> /// Initializes a new instance of the Expando class with default settings /// </summary> public Expando() : base() { // This call is required by the Windows.Forms Form Designer. this.components = new System.ComponentModel.Container(); // set control styles this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.Selectable, true); this.TabStop = true; // get the system theme settings this.systemSettings = ThemeManager.GetSystemExplorerBarSettings(); this.customSettings = new ExpandoInfo(); this.customSettings.Expando = this; this.customSettings.SetDefaultEmptyValues(); this.customHeaderSettings = new HeaderInfo(); this.customHeaderSettings.Expando = this; this.customHeaderSettings.SetDefaultEmptyValues(); this.BackColor = this.systemSettings.Expando.NormalBackColor; // the height of the Expando in the expanded state this.expandedHeight = 100; // animation this.animate = false; this.animatingFade = false; this.animatingSlide = false; this.animationImage = null; this.slideEndHeight = -1; this.animationHelper = null; this.fadeHeights = new int[AnimationHelper.NumAnimationFrames]; // size this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight); this.titleBarHeight = this.systemSettings.Header.BackImageHeight; this.headerHeight = this.titleBarHeight; this.oldWidth = this.Width; // start expanded this.collapsed = false; // not a special group this.specialGroup = false; // unfocused titlebar this.focusState = FocusStates.None; // no title image this.titleImage = null; this.watermark = null; this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular); // don't get the Expando to layout its items itself this.autoLayout = false; // don't know which TaskPane we belong to this.taskpane = null; // internal list of items this.itemList = new ItemCollection(this); this.hiddenControls = new ArrayList(); // initialise the dummyPanel this.dummyPanel = new AnimationPanel(); this.dummyPanel.Size = this.Size; this.dummyPanel.Location = new Point(-1000, 0); this.canCollapse = true; this.showFocusCues = false; this.useDefaultTabHandling = true; this.CalcAnimationHeights(); this.slideAnimationBatched = false; this.dragging = false; this.dragStart = Point.Empty; this.beginUpdateCount = 0; this.initialising = false; this.layout = false; }
/// <summary> /// Returns an ExpandoInfo that contains the deserialized ExpandoInfoSurrogate data /// </summary> /// <returns>An ExpandoInfo that contains the deserialized ExpandoInfoSurrogate data</returns> public ExpandoInfo Save() { ExpandoInfo expandoInfo = new ExpandoInfo(); expandoInfo.SpecialBackColor = ThemeManager.ConvertStringToColor(this.SpecialBackColor); expandoInfo.NormalBackColor = ThemeManager.ConvertStringToColor(this.NormalBackColor); expandoInfo.SpecialBorder = this.SpecialBorder; expandoInfo.NormalBorder = this.NormalBorder; expandoInfo.SpecialBorderColor = ThemeManager.ConvertStringToColor(this.SpecialBorderColor); expandoInfo.NormalBorderColor = ThemeManager.ConvertStringToColor(this.NormalBorderColor); expandoInfo.SpecialPadding = this.SpecialPadding; expandoInfo.NormalPadding = this.NormalPadding; expandoInfo.SpecialBackImage = ThemeManager.ConvertByteArrayToImage(this.SpecialBackImage); expandoInfo.NormalBackImage = ThemeManager.ConvertByteArrayToImage(this.NormalBackImage); expandoInfo.WatermarkAlignment = this.WatermarkAlignment; return expandoInfo; }
/// <summary> /// Initializes a new instance of the ExplorerBarInfo class with /// default settings /// </summary> public ExplorerBarInfo() { this.taskPane = new TaskPaneInfo(); this.taskItem = new TaskItemInfo(); this.expando = new ExpandoInfo(); this.header = new HeaderInfo(); this.officialTheme = false; this.classicTheme = false; this.shellStylePath = null; }
/// <summary> /// Populates the ExpandoInfoSurrogate with data that is to be /// serialized from the specified ExpandoInfo /// </summary> /// <param name="expandoInfo">The ExpandoInfo that contains the data /// to be serialized</param> public void Load(ExpandoInfo expandoInfo) { this.SpecialBackColor = ThemeManager.ConvertColorToString(expandoInfo.SpecialBackColor); this.NormalBackColor =ThemeManager.ConvertColorToString( expandoInfo.NormalBackColor); this.SpecialBorder = expandoInfo.SpecialBorder; this.NormalBorder = expandoInfo.NormalBorder; this.SpecialBorderColor = ThemeManager.ConvertColorToString(expandoInfo.SpecialBorderColor); this.NormalBorderColor = ThemeManager.ConvertColorToString(expandoInfo.NormalBorderColor); this.SpecialPadding = expandoInfo.SpecialPadding; this.NormalPadding = expandoInfo.NormalPadding; this.SpecialBackImage = ThemeManager.ConvertImageToByteArray(expandoInfo.SpecialBackImage); this.NormalBackImage = ThemeManager.ConvertImageToByteArray(expandoInfo.NormalBackImage); this.WatermarkAlignment = expandoInfo.WatermarkAlignment; }