Exemple #1
0
        internal static void DebugStructure(TabGroupSequence tgs, int indent)
        {
            int parentId = -1;

            if (tgs.Parent != null)
            {
                parentId = tgs.Parent.Unique;
            }

            Decimal total = 0;

            for (int l = 0; l < tgs.Count; l++)
            {
                total += tgs[l].Space;
            }

            for (int k = 0; k < indent; k++)
            {
                Console.Write(" ");
            }

            Console.WriteLine("Sequence({0}) %:{1} ID:{2} P:{3} nChild:{4} Dir:{5}",
                              total, tgs.Space, tgs.Unique, parentId, tgs.Count, tgs.Direction);

            indent++;

            for (int i = 0; i < tgs.Count; i++)
            {
                TabGroupBase tgb = tgs[i];

                if (tgb is TabGroupSequence)
                {
                    DebugStructure(tgb as TabGroupSequence, indent);
                }
                else
                {
                    if (tgb.Parent != null)
                    {
                        parentId = tgb.Parent.Unique;
                    }

                    for (int j = 0; j < indent; j++)
                    {
                        Console.Write(" ");
                    }

                    Console.WriteLine("Leaf %:{0} ID:{1} P:{2} nChild:{3}",
                                      tgb.Space, tgb.Unique, parentId, (tgb.GroupControl as TabControl).TabPages.Count);
                }
            }
        }
Exemple #2
0
        private void InternalConstruct(TabbedGroups tabbedGroups, TabGroupBase parent)
        {
            // Assign initial values
            _tabbedGroups  = tabbedGroups;
            _parent        = parent;
            _unique        = _count++;
            _resizeBarLock = false;

            // Defaults
            _tag     = null;
            _space   = 100m;
            _minSize = new Size(_tabbedGroups.DefaultGroupMinimumWidth,
                                _tabbedGroups.DefaultGroupMinimumHeight);
        }
Exemple #3
0
 /// <summary>
 /// Determines whether a TabGroupBase is in the collection.
 /// </summary>
 /// <param name="value">The TabGroupBase to locate in the collection.</param>
 /// <returns>true if item is found in the collection; otherwise, false.</returns>
 public bool Contains(TabGroupBase value)
 {
     // Use base class to process actual collection operation
     return(base.List.Contains(value as object));
 }
Exemple #4
0
 /// <summary>
 /// Inserts a TabGroupBase instance into the collection at the specified location.
 /// </summary>
 /// <param name="index">The location in the collection where you want to add the TabGroupBase.</param>
 /// <param name="value">The TabGroupBase object to insert.</param>
 public void Insert(int index, TabGroupBase value)
 {
     // Use base class to process actual collection operation
     base.List.Insert(index, value as object);
 }
Exemple #5
0
 /// <summary>
 /// Removes a TabGroupBase from the collection.
 /// </summary>
 /// <param name="value">A TabGroupBase to remove from the collection.</param>
 public void Remove(TabGroupBase value)
 {
     // Use base class to process actual collection operation
     base.List.Remove(value as object);
 }
Exemple #6
0
 /// <summary>
 /// Returns the index of the first occurrence of the given TabGroupBase.
 /// </summary>
 /// <param name="value">The TabGroupBase to locate.</param>
 /// <returns>Index of object; otherwise -1</returns>
 public int IndexOf(TabGroupBase value)
 {
     // Find the 0 based index of the requested entry
     return(base.List.IndexOf(value));
 }
Exemple #7
0
 internal void SetParent(TabGroupBase tgb)
 {
     _parent = tgb;
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the TabGroupBase class.
 /// </summary>
 /// <param name="tabbedGroups">Owning control instance.</param>
 /// <param name="parent">Parent group instance.</param>
 public TabGroupBase(TabbedGroups tabbedGroups, TabGroupBase parent)
 {
     InternalConstruct(tabbedGroups, parent);
 }