Esempio n. 1
0
        private void UpdateRecentLocations(string address)
        {
            // Get the collection of recent locations (right pane)
            RibbonItemCollection mru = c1Ribbon.ApplicationMenu.RightPaneItems;

            // Add the specified address if not already present
            if (address.Length > 0 && !mru.Contains(address))
            {
                // Create a list item containing a label
                RibbonLabel    label = new RibbonLabel(address);
                RibbonListItem item  = new RibbonListItem(label);

                // Add a handler for the Click event
                item.Click += new EventHandler(recentLocation_Click);

                // Must set the ID for subsequent calls to mru.Contains(address)
                item.ID = address;

                // Add the new item to the collection
                mru.Add(item);
            }
        }