コード例 #1
0
ファイル: ExplorerBarInfo.cs プロジェクト: zhuangyy/Motion
            /// <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);
            }
コード例 #2
0
ファイル: ExplorerBarInfo.cs プロジェクト: zhuangyy/Motion
            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));
            }
コード例 #3
0
ファイル: ExplorerBarInfo.cs プロジェクト: zhuangyy/Motion
 /// <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;
 }
コード例 #4
0
ファイル: Expando.cs プロジェクト: zhuangyy/Motion
            /// <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 = ThemeManager.ConvertColorToString(expando.BackColor);
                this.ExpandedHeight = expando.ExpandedHeight;

                this.CustomSettings = new ExpandoInfo.ExpandoInfoSurrogate();
                this.CustomSettings.Load(expando.CustomSettings);
                this.CustomHeaderSettings = new HeaderInfo.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 = ThemeManager.ConvertImageToByteArray(expando.TitleImage);
                this.Watermark = ThemeManager.ConvertImageToByteArray(expando.Watermark);

                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 = ThemeManager.ConvertObjectToByteArray(expando.Tag);

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

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

                        this.Items.Add(tis);
                    }
                }
            }
コード例 #5
0
ファイル: Expando.cs プロジェクト: zhuangyy/Motion
            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 = (ExpandoInfo.ExpandoInfoSurrogate) info.GetValue("CustomSettings", typeof(ExpandoInfo.ExpandoInfoSurrogate));
                this.CustomHeaderSettings = (HeaderInfo.HeaderInfoSurrogate) info.GetValue("CustomHeaderSettings", typeof(HeaderInfo.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));
            }
コード例 #6
0
ファイル: Expando.cs プロジェクト: zhuangyy/Motion
            /// <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 = ThemeManager.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];
            }