示例#1
0
 /// <summary>
 /// Set the icon of the library
 /// </summary>
 /// <param name="iconId">the Shell stock icon ID</param>
 public void SetIcon(int iconId)
 {
     using (ShellLibrary shellLibrary = ShellLibrary.Load(LibraryName, true))
     {
         shellLibrary.Icon = Helper.GetIcon(iconId);
         ShellIcon         = StockIcons.GetBitmapSource((StockIconIdentifier)iconId);
     }
 }
示例#2
0
 private void InsertIcons()
 {
     foreach (StockIconIdentifier iconId in Enum.GetValues(typeof(StockIconIdentifier)))
     {
         Image image = new Image();
         image.Source = StockIcons.GetBitmapSource((StockIconIdentifier)iconId);
         Button button = new Button();
         button.Content = image;
         button.Name    = iconId.ToString();
         button.Click  += (s, e) =>
         {
             _iconId = (int)Enum.Parse(typeof(StockIconIdentifier), ((Button)e.Source).Name);
             Close();
         };
         _wrapPanel.Children.Add(button);
     }
 }