Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        private static ToolStripMenuItem CreateFavoriteMenuItem(FavoriteConfigurationElement favorite)
        {
            ToolStripMenuItem item = new ToolStripMenuItem(favorite.Name)
            {
                Tag   = FAVORITE,
                Image = ConnectionImageHandler.GetFavoriteIcon(favorite)
            };

            return(item);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        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);
            }
        }