Пример #1
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));
            }
Пример #2
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);
                }
            }
Пример #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();
            }