Example #1
0
        private static void Restore(Dictionary <Part, bool> parts)
        {
            foreach (KeyValuePair <Part, bool> entry in parts)
            {
                Part part      = entry.Key;
                bool recursive = entry.Value;

                HighlightTracker2.Restore(part, recursive);
            }
        }
Example #2
0
        /// <summary>
        /// Cancels the current tracking operation. The current set and previous set are cleared and all parts are restored to their original states.
        /// </summary>
        public void CancelTracking()
        {
            this.tracking = false;

            // Eliminate duplicates held in previousParts.
            foreach (Part part in this.Parts.Keys)
            {
                this.PreviousParts.Remove(part);
            }

            // Now previousParts and parts have all the parts we need to restore.
            HighlightTracker2.Restore(this.Parts);
            HighlightTracker2.Restore(this.PreviousParts);

            this.Parts.Clear();
            this.PreviousParts.Clear();
        }
Example #3
0
        /// <summary>
        /// Finalizes the tracking actions. All parts in the current set are activated for highlighting. All parts in the previous set are restored to their original
        /// state. The current set becomes the previous set and the previous set is emptied and recycled to become the next current set.
        /// </summary>
        public void EndTracking()
        {
            if (!tracking)
            {
                throw new GUIControlsException("Highlight tracking must be started before tracking can be completed.");
            }

            if (Event.current.type == EventType.Repaint)
            {
                HighlightTracker2.Restore(this.PreviousParts);

                this.PreviousParts.Clear();

                this.Swap();
            }

            this.tracking = false;
        }