/// <summary> /// Initializes a new instance of the ExplorerBarInfoSurrogate class with default settings /// </summary> public ExplorerBarInfoSurrogate() { this.TaskPaneInfoSurrogate = null; this.TaskItemInfoSurrogate = null; this.ExpandoInfoSurrogate = null; this.HeaderInfoSurrogate = null; }
protected TaskItemSurrogate(SerializationInfo info, StreamingContext context) : base() { this.Name = info.GetString("Name"); this.Size = (Size)info.GetValue("Size", typeof(Size)); this.Location = (Point)info.GetValue("Location", typeof(Point)); this.BackColor = info.GetString("BackColor"); this.CustomSettings = (TaskItemInfoSurrogate)info.GetValue("CustomSettings", typeof(TaskItemInfoSurrogate)); this.Text = info.GetString("Text"); this.ShowFocusCues = info.GetBoolean("ShowFocusCues"); this.Image = (byte[])info.GetValue("Image", typeof(byte[])); this.Enabled = info.GetBoolean("Enabled"); this.Visible = info.GetBoolean("Visible"); this.Anchor = (AnchorStyles)info.GetValue("Anchor", typeof(AnchorStyles)); this.Dock = (DockStyle)info.GetValue("Dock", typeof(DockStyle)); this.FontName = info.GetString("FontName"); this.FontSize = info.GetSingle("FontSize"); this.FontDecoration = (FontStyle)info.GetValue("FontDecoration", typeof(FontStyle)); this.Tag = (byte[])info.GetValue("Tag", typeof(byte[])); }
/// <summary> /// Populates the TaskItemSurrogate with data that is to be /// serialized from the specified TaskItem /// </summary> /// <param name="taskItem">The TaskItem that contains the data /// to be serialized</param> public void Load(TaskItem taskItem) { this.Name = taskItem.Name; this.Size = taskItem.Size; this.Location = taskItem.Location; this.BackColor = Tools.Drawing.ConvertColorToString(taskItem.BackColor); this.CustomSettings = new TaskItemInfoSurrogate(); this.CustomSettings.Load(taskItem.CustomSettings); this.Text = taskItem.Text; this.ShowFocusCues = taskItem.ShowFocusCues; this.Image = taskItem.Image.ToByteArray(); this.Enabled = taskItem.Enabled; this.Visible = taskItem.Visible; this.Anchor = taskItem.Anchor; this.Dock = taskItem.Dock; this.FontName = taskItem.Font.FontFamily.Name; this.FontSize = taskItem.Font.SizeInPoints; this.FontDecoration = taskItem.Font.Style; this.Tag = taskItem.Tag.SerializeToByteArray(); }
/// <summary> /// Initializes a new instance of the TaskItemSurrogate class with default settings /// </summary> public TaskItemSurrogate() { this.Name = null; this.Size = Size.Empty; this.Location = Point.Empty; this.BackColor = Tools.Drawing.ConvertColorToString(Color.Empty); this.CustomSettings = null; this.Text = null; this.ShowFocusCues = false; this.Image = new byte[0]; this.Enabled = true; this.Visible = true; this.Anchor = AnchorStyles.None; this.Dock = DockStyle.None; this.FontName = null; this.FontSize = 8.25f; this.FontDecoration = FontStyle.Regular; this.Tag = new byte[0]; }
protected ExplorerBarInfoSurrogate(SerializationInfo info, StreamingContext context) : base() { int version = info.GetInt32("Version"); this.TaskPaneInfoSurrogate = (TaskPaneInfoSurrogate)info.GetValue("TaskPaneInfoSurrogate", typeof(TaskPaneInfoSurrogate)); this.TaskItemInfoSurrogate = (TaskItemInfoSurrogate)info.GetValue("TaskItemInfoSurrogate", typeof(TaskItemInfoSurrogate)); this.ExpandoInfoSurrogate = (ExpandoInfoSurrogate)info.GetValue("ExpandoInfoSurrogate", typeof(ExpandoInfoSurrogate)); this.HeaderInfoSurrogate = (HeaderInfoSurrogate)info.GetValue("HeaderInfoSurrogate", typeof(HeaderInfoSurrogate)); }
/// <summary> /// Populates the ExplorerBarInfoSurrogate with data that is to be /// serialized from the specified ExplorerBarInfo /// </summary> /// <param name="explorerBarInfo">The ExplorerBarInfo that contains the data /// to be serialized</param> public void Load(ExplorerBarInfo explorerBarInfo) { this.TaskPaneInfoSurrogate = new TaskPaneInfoSurrogate(); this.TaskPaneInfoSurrogate.Load(explorerBarInfo.TaskPane); this.TaskItemInfoSurrogate = new TaskItemInfoSurrogate(); this.TaskItemInfoSurrogate.Load(explorerBarInfo.TaskItem); this.ExpandoInfoSurrogate = new ExpandoInfoSurrogate(); this.ExpandoInfoSurrogate.Load(explorerBarInfo.Expando); this.HeaderInfoSurrogate = new HeaderInfoSurrogate(); this.HeaderInfoSurrogate.Load(explorerBarInfo.Header); }