예제 #1
0
        /// <summary>
        /// Removes all application destinations (such as frequent and recent)
        /// from the application's jump list.
        /// </summary>
        public void ClearApplicationDestinations()
        {
            IApplicationDestinations destinations = (IApplicationDestinations) new CApplicationDestinations();

            if (!String.IsNullOrEmpty(_appId))
            {
                HResult setAppIDResult = destinations.SetAppID(_appId);
                setAppIDResult.ThrowIf();
            }
            try
            {
                //This does not remove pinned items.
                HResult removeAllDestinationsResult = destinations.RemoveAllDestinations();
                removeAllDestinationsResult.ThrowIf();
            }
            catch (FileNotFoundException)
            { /* There are no destinations. That's cool. */ }
        }
예제 #2
0
        /// <summary>
        /// Removes all application destinations (such as frequent and recent)
        /// from the application's jump list.
        /// </summary>
        public void ClearApplicationDestinations()
        {
            IApplicationDestinations destinations = (IApplicationDestinations)
                                                    new CApplicationDestinations();

            if (!String.IsNullOrEmpty(_appId))
            {
                destinations.SetAppID(_appId);
            }
            try
            {
                //This does not remove pinned items.
                destinations.RemoveAllDestinations();
            }
            catch (System.IO.FileNotFoundException)
            {//There are no destinations.  That's cool.
            }
        }