示例#1
0
        /// <summary>
        /// Initializes a new instance of the TaskPaneInfo class with default settings
        /// </summary>
        public TaskPaneInfo()
        {
            // set background values
            this.gradientStartColor = Color.Transparent;
            this.gradientEndColor = Color.Transparent;
            this.direction = LinearGradientMode.Vertical;

            // set padding values
            this.padding = new Padding(12, 12, 12, 12);

            // images
            this.backImage = null;
            this.stretchMode = ImageStretchMode.Tile;

            this.watermark = null;
            this.watermarkAlignment = ContentAlignment.BottomCenter;

            this.owner = null;
        }
示例#2
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;
            }
示例#3
0
            /// <summary>
            /// Initializes a new instance of the TaskPane.ExpandoCollection class
            /// </summary>
            /// <param name="owner">A TaskPane representing the taskpane that owns 
            /// the Expando collection</param>
            public ExpandoCollection(TaskPane owner)
                : base()
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner");
                }

                this.owner = owner;
            }
示例#4
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);
                }
            }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the Expando class with default settings
        /// </summary>
        public Expando()
            : base()
        {
            // This call is required by the Windows.Forms Form Designer.
            this.components = new System.ComponentModel.Container();

            // set control styles
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            // get the system theme settings
            this.systemSettings = ThemeManager.GetSystemExplorerBarSettings();

            this.customSettings = new ExpandoInfo();
            this.customSettings.Expando = this;
            this.customSettings.SetDefaultEmptyValues();

            this.customHeaderSettings = new HeaderInfo();
            this.customHeaderSettings.Expando = this;
            this.customHeaderSettings.SetDefaultEmptyValues();

            this.BackColor = this.systemSettings.Expando.NormalBackColor;

            // the height of the Expando in the expanded state
            this.expandedHeight = 100;

            // animation
            this.animate = false;
            this.animatingFade = false;
            this.animatingSlide = false;
            this.animationImage = null;
            this.slideEndHeight = -1;
            this.animationHelper = null;
            this.fadeHeights = new int[AnimationHelper.NumAnimationFrames];

            // size
            this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight);
            this.titleBarHeight = this.systemSettings.Header.BackImageHeight;
            this.headerHeight = this.titleBarHeight;
            this.oldWidth = this.Width;

            // start expanded
            this.collapsed = false;

            // not a special group
            this.specialGroup = false;

            // unfocused titlebar
            this.focusState = FocusStates.None;

            // no title image
            this.titleImage = null;
            this.watermark = null;

            this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular);

            // don't get the Expando to layout its items itself
            this.autoLayout = false;

            // don't know which TaskPane we belong to
            this.taskpane = null;

            // internal list of items
            this.itemList = new ItemCollection(this);
            this.hiddenControls = new ArrayList();

            // initialise the dummyPanel
            this.dummyPanel = new AnimationPanel();
            this.dummyPanel.Size = this.Size;
            this.dummyPanel.Location = new Point(-1000, 0);

            this.canCollapse = true;

            this.showFocusCues = false;
            this.useDefaultTabHandling = true;

            this.CalcAnimationHeights();

            this.slideAnimationBatched = false;

            this.dragging = false;
            this.dragStart = Point.Empty;

            this.beginUpdateCount = 0;

            this.initialising = false;
            this.layout = false;
        }