/// <summary> /// Returns a TaskPaneInfo that contains the deserialized TaskPaneInfoSurrogate data /// </summary> /// <returns>A TaskPaneInfo that contains the deserialized TaskPaneInfoSurrogate data</returns> public TaskPaneInfo Save() { TaskPaneInfo taskPaneInfo = new TaskPaneInfo(); taskPaneInfo.GradientStartColor = ThemeManager.ConvertStringToColor(this.GradientStartColor); taskPaneInfo.GradientEndColor = ThemeManager.ConvertStringToColor(this.GradientEndColor); taskPaneInfo.GradientDirection = this.GradientDirection; taskPaneInfo.Padding = this.Padding; taskPaneInfo.BackImage = ThemeManager.ConvertByteArrayToImage(this.BackImage); taskPaneInfo.StretchMode = this.StretchMode; taskPaneInfo.Watermark = ThemeManager.ConvertByteArrayToImage(this.Watermark); taskPaneInfo.WatermarkAlignment = this.WatermarkAlignment; return taskPaneInfo; }
/// <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 TaskPaneInfoSurrogate with data that is to be /// serialized from the specified TaskPaneInfo /// </summary> /// <param name="taskPaneInfo">The TaskPaneInfo that contains the data /// to be serialized</param> public void Load(TaskPaneInfo taskPaneInfo) { this.GradientStartColor = ThemeManager.ConvertColorToString(taskPaneInfo.GradientStartColor); this.GradientEndColor = ThemeManager.ConvertColorToString(taskPaneInfo.GradientEndColor); this.GradientDirection = taskPaneInfo.GradientDirection; this.Padding = taskPaneInfo.Padding; this.BackImage = ThemeManager.ConvertImageToByteArray(taskPaneInfo.BackImage); this.StretchMode = taskPaneInfo.StretchMode; this.Watermark = ThemeManager.ConvertImageToByteArray(taskPaneInfo.Watermark); this.WatermarkAlignment = taskPaneInfo.WatermarkAlignment; }
/// <summary> /// Initializes a new instance of the TaskPane class with default settings /// </summary> public TaskPane() { // This call is required by the Windows.Forms Form Designer. 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.expandoCollection = new TaskPane.ExpandoCollection(this); // get the system theme settings this.systemSettings = ThemeManager.GetSystemExplorerBarSettings(); this.customSettings = new TaskPaneInfo(); this.customSettings.TaskPane = this; this.customSettings.SetDefaultEmptyValues(); this.BackColor = this.systemSettings.TaskPane.GradientStartColor; this.BackgroundImage = this.BackImage; this.classicTheme = false; this.customTheme = false; // size int width = (this.systemSettings.TaskPane.Padding.Left + this.systemSettings.TaskPane.Padding.Right + this.systemSettings.Header.BackImageWidth); int height = width; this.Size = new Size(width, height); // setup sutoscrolling this.AutoScroll = false; this.AutoScrollMargin = new Size(this.systemSettings.TaskPane.Padding.Right, this.systemSettings.TaskPane.Padding.Bottom); // Listen for changes to the parent this.ParentChanged += new EventHandler(this.OnParentChanged); this.allowExpandoDragging = false; this.dropPoint = Point.Empty; this.dropIndicatorColor = Color.Red; this.beginUpdateCount = 0; this.initialising = false; this.layout = false; }