Ejemplo n.º 1
0
            public Expando Save()
            {
                Expando expando = new Expando();
                ((ISupportInitialize) expando).BeginInit();
                expando.SuspendLayout();

                expando.Name = this.Name;
                expando.Text = this.Text;
                expando.Size = this.Size;
                expando.Location = this.Location;

                expando.BackColor = ThemeManager.ConvertStringToColor(this.BackColor);
                expando.ExpandedHeight = this.ExpandedHeight;

                expando.customSettings = this.CustomSettings.Save();
                expando.customSettings.Expando = expando;
                expando.customHeaderSettings = this.CustomHeaderSettings.Save();
                expando.customHeaderSettings.Expando = expando;

                expando.TitleImage = ThemeManager.ConvertByteArrayToImage(this.TitleImage);
                expando.Watermark = ThemeManager.ConvertByteArrayToImage(this.Watermark);

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

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

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

                expando.Font = new Font(this.FontName, this.FontSize, this.FontDecoration);

                expando.Tag = ThemeManager.ConvertByteArrayToObject(this.Tag);

                ((ISupportInitialize) expando).EndInit();
                expando.ResumeLayout(false);

                return expando;
            }
Ejemplo n.º 2
0
            public ItemCollection(Expando owner)
                : base()
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner");
                }

                this.owner = owner;
            }
Ejemplo n.º 3
0
            public void Dispose()
            {
                if (this.animationTimer != null)
                {
                    this.animationTimer.Stop();
                    this.animationTimer.Dispose();
                    this.animationTimer = null;
                }

                this.expando = null;
            }
Ejemplo n.º 4
0
            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);
            }
Ejemplo n.º 5
0
        /// <summary>
        /// "Drops" the specified Expando and moves it to the current drop point
        /// </summary>
        /// <param name="expando">The Expando to be "dropped"</param>
        internal void DropExpando(Expando expando)
        {
            if (this.dropPoint == Point.Empty)
            {
                return;
            }

            if (expando != null && expando.TaskPane == this)
            {
                int i = 0;
                int expandoIndex = this.Expandos.IndexOf(expando);

                for (; i<this.Expandos.Count; i++)
                {
                    if (this.dropPoint.Y <= this.Expandos[i].Top)
                    {
                        if (i > expandoIndex)
                        {
                            this.Expandos.Move(expando, i-1);
                        }
                        else if (i < expandoIndex)
                        {
                            this.Expandos.Move(expando, i);
                        }

                        break;
                    }
                }

                if (i == this.Expandos.Count)
                {
                    this.Expandos.Move(expando, i);
                }
            }

            this.dropPoint = Point.Empty;

            this.Invalidate(false);
        }
Ejemplo n.º 6
0
            public AnimationHelper(Expando expando, int animationType)
            {
                this.expando = expando;
                this.animationType = animationType;

                this.animating = false;

                this.numAnimationSteps = NumAnimationFrames;
                this.animationFrameInterval = 10;

                this.animationTimer = new System.Windows.Forms.Timer();
                this.animationTimer.Tick += new EventHandler(this.animationTimer_Tick);
                this.animationTimer.Interval = this.animationFrameInterval;
            }
Ejemplo n.º 7
0
 /// <summary>
 /// Collaspes all the Expandos contained in the TaskPane, 
 /// except for the specified Expando which is expanded
 /// </summary>
 /// <param name="expando">The Expando that is to be expanded</param>
 // suggested by: PaleyX ([email protected])
 //               03/06/2004
 //               v1.1
 public void CollapseAllButOne(Expando expando)
 {
     foreach (Expando e in this.Expandos)
     {
         if (e != expando)
         {
             e.Collapsed = true;
         }
         else
         {
             expando.Collapsed = false;
         }
     }
 }
Ejemplo n.º 8
0
            /// <summary>
            /// Determines whether the specified expando is a member of the 
            /// collection
            /// </summary>
            /// <param name="expando">The Expando to locate in the collection</param>
            /// <returns>true if the Expando is a member of the collection; 
            /// otherwise, false</returns>
            public bool Contains(Expando expando)
            {
                if (expando == null)
                {
                    throw new ArgumentNullException("expando");
                }

                return (this.IndexOf(expando) != -1);
            }
Ejemplo n.º 9
0
 /// <summary>
 /// Moves the specified expando to the top of the expando collection
 /// </summary>
 /// <param name="value">The expando to be moved</param>
 public void MoveToTop(Expando value)
 {
     this.Move(value, 0);
 }
Ejemplo n.º 10
0
            /// <summary>
            /// Removes the specified expando from the expando collection
            /// </summary>
            /// <param name="value">The Expando to remove from the 
            /// TaskPane.ExpandoCollection</param>
            public void Remove(Expando value)
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                this.List.Remove(value);

                this.owner.Controls.Remove(value);

                this.owner.OnExpandoRemoved(new ExpandoEventArgs(value));
            }
Ejemplo n.º 11
0
 /// <summary>
 /// Moves the specified expando to the bottom of the expando collection
 /// </summary>
 /// <param name="value">The expando to be moved</param>
 public void MoveToBottom(Expando value)
 {
     this.Move(value, this.Count);
 }
Ejemplo n.º 12
0
            /// <summary>
            /// Moves the specified expando to the specified indexed location 
            /// in the expando collection
            /// </summary>
            /// <param name="value">The expando to be moved</param>
            /// <param name="index">The indexed location in the expando collection 
            /// that the specified expando will be moved to</param>
            public void Move(Expando value, int index)
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                // make sure the index is within range
                if (index < 0)
                {
                    index = 0;
                }
                else if (index > this.Count)
                {
                    index = this.Count;
                }

                // don't go any further if the expando is already
                // in the desired position or we don't contain it
                if (!this.Contains(value) || this.IndexOf(value) == index)
                {
                    return;
                }

                this.List.Remove(value);

                // if the index we're supposed to move the expando to
                // is now greater to the number of expandos contained,
                // add it to the end of the list, otherwise insert it at
                // the specified index
                if (index > this.Count)
                {
                    this.List.Add(value);
                }
                else
                {
                    this.List.Insert(index, value);
                }

                // re-layout the controls
                this.owner.MatchControlCollToExpandoColl();
            }
Ejemplo n.º 13
0
            /// <summary>
            /// Retrieves the index of the specified expando in the expando 
            /// collection
            /// </summary>
            /// <param name="expando">The Expando to locate in the collection</param>
            /// <returns>A zero-based index value that represents the position 
            /// of the specified Expando in the TaskPane.ExpandoCollection</returns>
            public int IndexOf(Expando expando)
            {
                if (expando == null)
                {
                    throw new ArgumentNullException("expando");
                }

                for (int i=0; i<this.Count; i++)
                {
                    if (this[i] == expando)
                    {
                        return i;
                    }
                }

                return -1;
            }
Ejemplo n.º 14
0
 public ExpandoEventArgs()
 {
     expando = null;
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Calculates where the specified Expando should be located
        /// </summary>
        /// <returns>A Point that specifies where the Expando should 
        /// be located</returns>
        protected internal Point CalcExpandoLocation(Expando target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            int targetIndex = this.Expandos.IndexOf(target);

            Expando e;
            Point p;

            int y = this.DisplayRectangle.Y + this.Padding.Top;
            int width = this.ClientSize.Width - this.Padding.Left - this.Padding.Right;

            for (int i=0; i<targetIndex; i++)
            {
                e = this.Expandos[i];

                if (!e.Visible)
                {
                    continue;
                }

                p = new Point(this.Padding.Left, y);
                y += e.Height + this.Padding.Bottom;
            }

            return new Point(this.Padding.Left, y);
        }
Ejemplo n.º 16
0
 public ExpandoEventArgs(Expando expando)
 {
     this.expando = expando;
 }
Ejemplo n.º 17
0
            /// <summary>
            /// Adds an array of expando objects to the collection
            /// </summary>
            /// <param name="expandos">An array of Expando objects to add 
            /// to the collection</param>
            public void AddRange(Expando[] expandos)
            {
                if (expandos == null)
                {
                    throw new ArgumentNullException("expandos");
                }

                for (int i=0; i<expandos.Length; i++)
                {
                    this.Add(expandos[i]);
                }
            }