Beispiel #1
0
            /// <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;
            }