/// <summary>
        /// Select the selectable nodes whose bounds intersect the marquee, unselecting
        /// previously selected nodes.
        /// </summary>
        /// <param name="e">A PInputEventArgs that contains the event data.</param>
        protected virtual void ComputeMarqueeSelection(PInputEventArgs e)
        {
            unselectList.Clear();
            // Make just the items in the list selected
            // Do this efficiently by first unselecting things not in the list
            ICollection sel = selection.Keys;

            foreach (PNode node in sel)
            {
                if (!allItems.ContainsKey(node))
                {
                    unselectList.Add(node);
                }
            }
            Unselect(unselectList);

            // Then select the rest
            TEMP_LIST.Clear();
            TEMP_LIST.AddRange(allItems.Keys);

            foreach (PNode node in TEMP_LIST)
            {
                if (!selection.ContainsKey(node) && !marqueeMap.ContainsKey(node) && IsSelectable(node))
                {
                    marqueeMap.Add(node, true);
                }
                else if (!IsSelectable(node))
                {
                    allItems.Remove(node);
                }
            }

            Select(allItems);
        }
Esempio n. 2
0
        /// <summary>
        /// Load all images in the specified directory as slides.
        /// </summary>
        public void LoadSlides(string folder)
        {
            hiliteSlide = null;
            slideBar.RemoveAllChildren();
            slides.Clear();
            Layer.AddChild(slideBar);

            if (folder == null)
            {
                AddDefaultSlides();
            }
            else
            {
                AddSlides(folder);
            }

            // Create visual indicator of current position in slide bar
            Bitmap arrowBitmap = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream(IMAGE_RESOURCE_STREAM + ".up-arrow.gif"));

            currentPosition          = new PImage(arrowBitmap);
            currentPosition.Pickable = false;
            slideBar.AddChild(currentPosition);

            slideActivities = new PActivity[slides.Count];

            LayoutSlides();
            GoToSlide((PMultiSizeImage)slideBar[0]);
        }