Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Populates the ExpandoSurrogate with data that is to be
        /// serialized from the specified Expando
        /// </summary>
        /// <param name="expando">The Expando that contains the data
        /// to be serialized</param>
        public void Load(Expando expando)
        {
            this.Name     = expando.Name;
            this.Text     = expando.Text;
            this.Size     = expando.Size;
            this.Location = expando.Location;

            this.BackColor      = Tools.Drawing.ConvertColorToString(expando.BackColor);
            this.ExpandedHeight = expando.ExpandedHeight;

            this.CustomSettings = new ExpandoInfoSurrogate();
            this.CustomSettings.Load(expando.CustomSettings);
            this.CustomHeaderSettings = new HeaderInfoSurrogate();
            this.CustomHeaderSettings.Load(expando.CustomHeaderSettings);

            this.Animate       = expando.Animate;
            this.ShowFocusCues = expando.ShowFocusCues;
            this.Collapsed     = expando.Collapsed;
            this.CanCollapse   = expando.CanCollapse;
            this.SpecialGroup  = expando.SpecialGroup;

            this.TitleImage = expando.TitleImage.ToByteArray();
            this.Watermark  = expando.Watermark.ToByteArray();

            this.Enabled    = expando.Enabled;
            this.Visible    = expando.Visible;
            this.AutoLayout = expando.AutoLayout;

            this.Anchor = expando.Anchor;
            this.Dock   = expando.Dock;

            this.FontName       = expando.Font.FontFamily.Name;
            this.FontSize       = expando.Font.SizeInPoints;
            this.FontDecoration = expando.Font.Style;

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

            for (int i = 0; i < expando.Items.Count; i++)
            {
                if (expando.Items[i] is TaskItem)
                {
                    TaskItemSurrogate tis = new TaskItemSurrogate();

                    tis.Load((TaskItem)expando.Items[i]);

                    this.Items.Add(tis);
                }
            }
        }
Ejemplo n.º 5
0
        protected ExpandoSurrogate(SerializationInfo info, StreamingContext context)
            : base()
        {
            int version = info.GetInt32("Version");

            this.Name     = info.GetString("Name");
            this.Text     = info.GetString("Text");
            this.Size     = (Size)info.GetValue("Size", typeof(Size));
            this.Location = (Point)info.GetValue("Location", typeof(Point));

            this.BackColor      = info.GetString("BackColor");
            this.ExpandedHeight = info.GetInt32("ExpandedHeight");

            this.CustomSettings       = (ExpandoInfoSurrogate)info.GetValue("CustomSettings", typeof(ExpandoInfoSurrogate));
            this.CustomHeaderSettings = (HeaderInfoSurrogate)info.GetValue("CustomHeaderSettings", typeof(HeaderInfoSurrogate));

            this.Animate       = info.GetBoolean("Animate");
            this.ShowFocusCues = info.GetBoolean("ShowFocusCues");
            this.Collapsed     = info.GetBoolean("Collapsed");
            this.CanCollapse   = info.GetBoolean("CanCollapse");
            this.SpecialGroup  = info.GetBoolean("SpecialGroup");

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

            this.Enabled    = info.GetBoolean("Enabled");
            this.Visible    = info.GetBoolean("Visible");
            this.AutoLayout = info.GetBoolean("AutoLayout");

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

            this.Items = (ArrayList)info.GetValue("Items", typeof(ArrayList));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the ExpandoSurrogate class with default settings
        /// </summary>
        public ExpandoSurrogate()
        {
            this.Name     = null;
            this.Text     = null;
            this.Size     = Size.Empty;
            this.Location = Point.Empty;

            this.BackColor      = Tools.Drawing.ConvertColorToString(SystemColors.Control);
            this.ExpandedHeight = -1;

            this.CustomSettings       = null;
            this.CustomHeaderSettings = null;

            this.Animate       = false;
            this.ShowFocusCues = false;
            this.Collapsed     = false;
            this.CanCollapse   = true;
            this.SpecialGroup  = false;

            this.TitleImage = new byte[0];
            this.Watermark  = new byte[0];

            this.Enabled    = true;
            this.Visible    = true;
            this.AutoLayout = false;

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

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

            this.Items = new ArrayList();

            this.Tag = new byte[0];
        }