private void AddSpecialMenuItem(SpecialCommandConfigurationElement commad) { ToolStripItem specialItem = this.CreateSpecialItem(commad); specialItem.Image = ConnectionImageHandler.LoadImage(commad.Thumbnail, Resources.server_administrator_icon); specialItem.ImageTransparentColor = Color.Magenta; specialItem.Tag = commad; specialItem.Click += specialItem_Click; }
private static ToolStripMenuItem CreateFavoriteMenuItem(FavoriteConfigurationElement favorite) { ToolStripMenuItem item = new ToolStripMenuItem(favorite.Name) { Tag = FAVORITE, Image = ConnectionImageHandler.GetFavoriteIcon(favorite) }; return(item); }
private ToolStripButton CreateFavoriteButton(FavoriteConfigurationElement favorite) { Image buttonImage = ConnectionImageHandler.GetFavoriteIcon(favorite); ToolStripButton favoriteBtn = new ToolStripButton(favorite.Name, buttonImage, this.serverToolStripMenuItem_Click) { ToolTipText = favorite.GetToolTipText(), Tag = favorite, Overflow = ToolStripItemOverflow.AsNeeded }; return(favoriteBtn); }
public FavoriteTreeNode(FavoriteConfigurationElement favorite) : base(favorite.Name) { this.Name = favorite.Name; this.Favorite = favorite; this.Tag = favorite; this.ImageKey = ConnectionImageHandler.GetTreeviewImageListKey(favorite); this.SelectedImageKey = this.ImageKey; new System.Threading.Thread(new System.Threading.ThreadStart(new MethodInvoker(delegate { this.ToolTipText = favorite.GetToolTipText(); }))).Start(); }
public FavoriteTreeNode(FavoriteConfigurationElement favorite) : base(favorite.Name) { this.Name = favorite.Name; this.Favorite = favorite; this.Tag = favorite; this.ImageKey = ConnectionImageHandler.GetTreeviewImageListKey(favorite); this.SelectedImageKey = this.ImageKey; try { new System.Threading.Thread(new System.Threading.ThreadStart(new MethodInvoker(delegate { this.ToolTipText = favorite.GetToolTipText(); }))).Start(); } catch (System.OutOfMemoryException ex) { Kohl.Framework.Logging.Log.Fatal("An out of memory exception has occured while trying to load the tool tip texts for each active favorite in the favorites tree view.", ex); return; } }
public FavoritesTreeView() { // This prevents SharpDevelop and Visual Studio from both an exception in design mode for controls using this HistoryTreeView and from crashing when opening the // designer for this class. if (LicenseManager.UsageMode == LicenseUsageMode.Runtime) { this.ImageList = ConnectionImageHandler.GetProtocolImageList(); this.ImageIndex = 0; this.LineColor = Color.Black; this.SelectedImageIndex = 0; this.ShowNodeToolTips = true; this.AfterExpand += this.OnTreeViewExpand; this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight); this.ImageList = ConnectionImageHandler.GetProtocolImageList(); this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight); this.Font = FontParser.FromString(Settings.FavoritesFont); this.BackColor = ColorParser.FromString(Settings.FavoritesFontBackColor); this.ForeColor = ColorParser.FromString(Settings.FavoritesFontForeColor); this.loader = new TreeListLoader(this); } }
public DBTreeView() { this.ImageList = new ImageList(); if (LicenseManager.UsageMode == LicenseUsageMode.Runtime) { this.ImageList = ConnectionImageHandler.GetProtocolImageList(); this.ImageIndex = 0; this.LineColor = Color.Black; this.SelectedImageIndex = 0; this.ShowNodeToolTips = true; this.AfterExpand += this.OnTreeViewExpand; this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight); this.ImageList = ConnectionImageHandler.GetProtocolImageList(); this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight); this.Font = FontParser.FromString(Settings.FavoritesFont); this.BackColor = ColorParser.FromString(Settings.FavoritesFontBackColor); this.ForeColor = ColorParser.FromString(Settings.FavoritesFontForeColor); this.loader = new TreeListLoader(this); } }