Exemplo n.º 1
0
            /// <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);
                }
            }
Exemplo n.º 2
0
            protected TaskPaneSurrogate(SerializationInfo info, StreamingContext context)
                : base()
            {
                int version = info.GetInt32("Version");

                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 = (TaskPaneInfo.TaskPaneInfoSurrogate) info.GetValue("CustomSettings", typeof(TaskPaneInfo.TaskPaneInfoSurrogate));

                this.AutoScroll = info.GetBoolean("AutoScroll");
                this.AutoScrollMargin = (Size) info.GetValue("AutoScrollMargin", typeof(Size));

                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));

                if (version >= 3300)
                {
                    this.AllowExpandoDragging = info.GetBoolean("AllowExpandoDragging");
                    this.ExpandoDropIndicatorColor = info.GetString("ExpandoDropIndicatorColor");
                }

                this.Tag = (byte[]) info.GetValue("Tag", typeof(byte[]));

                this.Expandos = (ArrayList) info.GetValue("Expandos", typeof(ArrayList));
            }
Exemplo n.º 3
0
            /// <summary>
            /// Initializes a new instance of the TaskPaneSurrogate class with default settings
            /// </summary>
            public TaskPaneSurrogate()
            {
                this.Name = null;

                this.Size = Size.Empty;
                this.Location = Point.Empty;

                this.BackColor = ThemeManager.ConvertColorToString(SystemColors.Control);

                this.CustomSettings = null;

                this.AutoScroll = false;
                this.AutoScrollMargin = Size.Empty;

                this.Enabled = true;
                this.Visible = true;

                this.Anchor = AnchorStyles.None;
                this.Dock = DockStyle.None;

                this.FontName = "Tahoma";
                this.FontSize = 8.25f;
                this.FontDecoration = FontStyle.Regular;

                this.Tag = new byte[0];

                this.AllowExpandoDragging = false;
                this.ExpandoDropIndicatorColor = ThemeManager.ConvertColorToString(Color.Red);

                this.Expandos = new ArrayList();
            }
            /// <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 TaskPaneInfo.TaskPaneInfoSurrogate();
                this.TaskPaneInfoSurrogate.Load(explorerBarInfo.TaskPane);

                this.TaskItemInfoSurrogate = new TaskItemInfo.TaskItemInfoSurrogate();
                this.TaskItemInfoSurrogate.Load(explorerBarInfo.TaskItem);

                this.ExpandoInfoSurrogate = new ExpandoInfo.ExpandoInfoSurrogate();
                this.ExpandoInfoSurrogate.Load(explorerBarInfo.Expando);

                this.HeaderInfoSurrogate = new HeaderInfo.HeaderInfoSurrogate();
                this.HeaderInfoSurrogate.Load(explorerBarInfo.Header);
            }
            protected ExplorerBarInfoSurrogate(SerializationInfo info, StreamingContext context)
                : base()
            {
                int version = info.GetInt32("Version");

                this.TaskPaneInfoSurrogate = (TaskPaneInfo.TaskPaneInfoSurrogate) info.GetValue("TaskPaneInfoSurrogate", typeof(TaskPaneInfo.TaskPaneInfoSurrogate));
                this.TaskItemInfoSurrogate = (TaskItemInfo.TaskItemInfoSurrogate) info.GetValue("TaskItemInfoSurrogate", typeof(TaskItemInfo.TaskItemInfoSurrogate));
                this.ExpandoInfoSurrogate = (ExpandoInfo.ExpandoInfoSurrogate) info.GetValue("ExpandoInfoSurrogate", typeof(ExpandoInfo.ExpandoInfoSurrogate));
                this.HeaderInfoSurrogate = (HeaderInfo.HeaderInfoSurrogate) info.GetValue("HeaderInfoSurrogate", typeof(HeaderInfo.HeaderInfoSurrogate));
            }
 /// <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;
 }