public Expando() : base() { this.components = new System.ComponentModel.Container(); this.SetStyle(ControlStyles.DoubleBuffer, 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; 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; this.expandedHeight = 100; this.animate = false; this.animatingFade = false; this.animatingSlide = false; this.animationImage = null; this.slideEndHeight = -1; this.animationHelper = null; this.fadeHeights = new int[AnimationHelper.NumAnimationFrames]; this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight); this.titleBarHeight = this.systemSettings.Header.BackImageHeight; this.headerHeight = this.titleBarHeight; this.oldWidth = this.Width; this.collapsed = false; this.specialGroup = false; this.focusState = FocusStates.None; this.titleImage = null; this.watermark = null; this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular); this.autoLayout = false; this.taskpane = null; this.itemList = new ItemCollection(this); this.hiddenControls = new ArrayList(); 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> /// Populates the TaskPaneSurrogate with data that is to be /// serialized from the specified TaskPane /// </summary> /// <param name="taskPane">The TaskPane that contains the data /// to be serialized</param> public void Load(TaskPane taskPane) { this.Name = taskPane.Name; this.Size = taskPane.Size; this.Location = taskPane.Location; this.BackColor = ThemeManager.ConvertColorToString(taskPane.BackColor); this.CustomSettings = new TaskPaneInfo.TaskPaneInfoSurrogate(); this.CustomSettings.Load(taskPane.CustomSettings); this.AutoScroll = taskPane.AutoScroll; this.AutoScrollMargin = taskPane.AutoScrollMargin; this.Enabled = taskPane.Enabled; this.Visible = taskPane.Visible; this.Anchor = taskPane.Anchor; this.Dock = taskPane.Dock; this.FontName = taskPane.Font.FontFamily.Name; this.FontSize = taskPane.Font.SizeInPoints; this.FontDecoration = taskPane.Font.Style; this.AllowExpandoDragging = taskPane.AllowExpandoDragging; this.ExpandoDropIndicatorColor = ThemeManager.ConvertColorToString(taskPane.ExpandoDropIndicatorColor); this.Tag = ThemeManager.ConvertObjectToByteArray(taskPane.Tag); foreach (Expando expando in taskPane.Expandos) { Expando.ExpandoSurrogate es = new Expando.ExpandoSurrogate(); es.Load(expando); this.Expandos.Add(es); } }
/// <summary> /// Returns a TaskPane that contains the deserialized TaskPaneSurrogate data /// </summary> /// <returns>A TaskPane that contains the deserialized TaskPaneSurrogate data</returns> public TaskPane Save() { TaskPane taskPane = new TaskPane(); ((ISupportInitialize) taskPane).BeginInit(); taskPane.SuspendLayout(); taskPane.Name = this.Name; taskPane.Size = this.Size; taskPane.Location = this.Location; taskPane.BackColor = ThemeManager.ConvertStringToColor(this.BackColor); taskPane.customSettings = this.CustomSettings.Save(); taskPane.customSettings.TaskPane = taskPane; taskPane.AutoScroll = this.AutoScroll; taskPane.AutoScrollMargin = this.AutoScrollMargin; taskPane.Enabled = this.Enabled; taskPane.Visible = this.Visible; taskPane.Anchor = this.Anchor; taskPane.Dock = this.Dock; taskPane.Font = new Font(this.FontName, this.FontSize, this.FontDecoration); taskPane.Tag = ThemeManager.ConvertByteArrayToObject(this.Tag); taskPane.AllowExpandoDragging = this.AllowExpandoDragging; taskPane.ExpandoDropIndicatorColor = ThemeManager.ConvertStringToColor(this.ExpandoDropIndicatorColor); foreach (Object o in this.Expandos) { Expando e = ((Expando.ExpandoSurrogate) o).Save(); taskPane.Expandos.Add(e); } ((ISupportInitialize) taskPane).EndInit(); taskPane.ResumeLayout(false); return taskPane; }
/// <summary> /// Initializes a new instance of the TaskPane.ExpandoCollection class /// </summary> /// <param name="owner">A TaskPane representing the taskpane that owns /// the Expando collection</param> public ExpandoCollection(TaskPane owner) : base() { if (owner == null) { throw new ArgumentNullException("owner"); } this.owner = owner; }