Exemple #1
0
        public Target Add(Target value)
        {
            // Use base class to process actual collection operation
            base.List.Add(value as object);

            return value;
        }
        public void MouseMove(Point mousePos)
        {
            // Find the Target the mouse is currently over (if any)
            Target t = _targets.Contains(mousePos);

            // Set appropriate cursor
            if (t != null)
                _source.Cursor = _validCursor;
            else
                _source.Cursor = _invalidCursor;

            if (t != _lastTarget)
            {
                // Remove the old indicator
                if (_lastTarget != null)
                    DrawHelper.DrawDragRectangle(_lastTarget.DrawRect, _rectWidth);

                // Draw the new indicator
                if (t != null)
                    DrawHelper.DrawDragRectangle(t.DrawRect, _rectWidth);

                // Remember for next time around
                _lastTarget = t;
            }
        }
        public TargetManager(TabbedGroups host, TabGroupLeaf leaf, Controls.TabControl source)
        {
            // Define state
            _host = host;
            _leaf = leaf;
            _source = source;
            _lastTarget = null;

            // Create collection to hold generated targets
            _targets = new TargetCollection();

            // Process each potential leaf in turn
            TabGroupLeaf tgl = host.FirstLeaf();

            while(tgl != null)
            {
                // Create all possible targets for this leaf
                CreateTargets(tgl);

                // Enumerate all leafs
                tgl = host.NextLeaf(tgl);
            }
        }
Exemple #4
0
 public void Remove(Target value)
 {
     // Use base class to process actual collection operation
     base.List.Remove(value as object);
 }
Exemple #5
0
 public void Insert(int index, Target value)
 {
     // Use base class to process actual collection operation
     base.List.Insert(index, value as object);
 }
Exemple #6
0
 public int IndexOf(Target value)
 {
     // Find the 0 based index of the requested entry
     return base.List.IndexOf(value);
 }
Exemple #7
0
 public bool Contains(Target value)
 {
     // Use base class to process actual collection operation
     return base.List.Contains(value as object);
 }
Exemple #8
0
 public void AddRange(Target[] values)
 {
     // Use existing method to add each array entry
     foreach(Target page in values)
         Add(page);
 }