/// <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;
 }
Esempio n. 2
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 = Tools.Drawing.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 = Tools.Drawing.ConvertColorToString(Color.Red);

            this.Expandos = new ArrayList();
        }
        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);
        }
Esempio n. 5
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 = Tools.Drawing.ConvertColorToString(taskPane.BackColor);

            this.CustomSettings = new 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 = Tools.Drawing.ConvertColorToString(taskPane.ExpandoDropIndicatorColor);

            this.Tag = taskPane.Tag.SerializeToByteArray();

            foreach (Expando expando in taskPane.Expandos)
            {
                ExpandoSurrogate es = new ExpandoSurrogate();

                es.Load(expando);

                this.Expandos.Add(es);
            }
        }
Esempio n. 6
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 = (TaskPaneInfoSurrogate)info.GetValue("CustomSettings", typeof(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));
        }