Represents a standard system icon.
Inheritance: IDisposable
Exemplo n.º 1
0
        public AdvancedSearch()
        {
            stockIcons = new StockIcons();

            documentsStockIcon = stockIcons.DocumentAssociated;
            videosStockIcon = stockIcons.VideoFiles;
            musicStockIcon = stockIcons.AudioFiles;
            picturesStockIcon = stockIcons.ImageFiles;

            InitializeComponent();

            // Set our default
            DocumentsRadioButton.IsChecked = true;

            // 
            prop1prop2OperationComboBox.SelectedIndex = 0;

            // Because the search can take some time, using a background thread.
            // This timer will check if that thread is still alive and accordingly update
            // the cursor
            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.IsEnabled = true;
            timer.Tick += new EventHandler(timer_Tick);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the existing stock icon from the internal cache, or creates a new one
        /// based on the current settings if it's not in the cache.
        /// </summary>
        /// <param name="stockIconIdentifier">Unique identifier for the requested stock icon</param>
        /// <returns>Stock Icon based on the identifier given (either from the cache or created new)</returns>
        private StockIcon GetStockIcon(StockIconIdentifier stockIconIdentifier)
        {
            // Check the cache first
            if (stockIconCache[stockIconIdentifier] != null)
            {
                return(stockIconCache[stockIconIdentifier]);
            }
            else
            {
                // Create a new icon based on our default settings
                StockIcon icon = new StockIcon(stockIconIdentifier, defaultSize, isLinkOverlay, isSelected);

                try
                {
                    // Add it to the cache
                    stockIconCache[stockIconIdentifier] = icon;
                }
                catch
                {
                    icon.Dispose();
                    throw;
                }

                // Return
                return(icon);
            }
        }
        /// <summary>
        /// Returns the existing stock icon from the internal cache, or creates a new one
        /// based on the current settings if it's not in the cache.
        /// </summary>
        /// <param name="stockIconIdentifier">Unique identifier for the requested stock icon</param>
        /// <returns>Stock Icon based on the identifier given (either from the cache or created new)</returns>
        private StockIcon GetStockIcon(StockIconIdentifier stockIconIdentifier)
        {
            // Check the cache first
            if (stockIconCache[stockIconIdentifier] != null)
                return stockIconCache[stockIconIdentifier];
            else
            {
                // Create a new icon based on our default settings
                StockIcon icon = new StockIcon(stockIconIdentifier, defaultSize, isLinkOverlay, isSelected);

                try
                {
                    // Add it to the cache
                    stockIconCache[stockIconIdentifier] = icon;
                }
                catch
                {
                    icon.Dispose();
                    throw;
                }

                // Return
                return icon;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Modifie l'icône de statut dans la zone de notification
        /// </summary>
        /// <param name="status">Statut de la copie</param>
        private void SetOverlayIcon(CopyEnd status)
        {
            if (TaskbarManager.IsPlatformSupported)
                try
                {
                    Icon ico;
                    switch (status)
                    {
                        default:
                            ico = new StockIcon(StockIconIdentifier.Warning).Icon;
                            break;

                        case CopyEnd.Error:
                            ico = new StockIcon(StockIconIdentifier.Error).Icon;
                            break;

                        case CopyEnd.OK:
                            ico = new Icon("go.ico");
                            break;
                    }

                    TaskbarManager.Instance.SetOverlayIcon(ico, status.ToString());
                }
                catch (Exception ex)
                {
                    WriteLog(ex);
                }
        }