Example #1
0
        private void AddGnomeIcon(string internal_mime_type, string name)
        {
            int index = -1;

            if (MimeIconEngine.MimeIconIndex.ContainsKey(internal_mime_type))
            {
                return;
            }

            Image image = GnomeUtil.GetIcon(name, 48);

            if (image == null)
            {
                if (internal_mime_type == "unknown/unknown")
                {
                    image = ResourceImageLoader.Get("text-x-generic.png");
                }
                else if (internal_mime_type == "inode/directory")
                {
                    image = ResourceImageLoader.Get("folder.png");
                }
                else if (internal_mime_type == "directory/home")
                {
                    image = ResourceImageLoader.Get("user-home.png");
                }
                else if (internal_mime_type == "desktop/desktop")
                {
                    image = ResourceImageLoader.Get("user-desktop.png");
                }
                else if (internal_mime_type == "recently/recently")
                {
                    image = ResourceImageLoader.Get("document-open.png");
                }
                else if (internal_mime_type == "workplace/workplace")
                {
                    image = ResourceImageLoader.Get("computer.png");
                }
                else if (internal_mime_type == "network/network" || internal_mime_type == "nfs/nfs" || internal_mime_type == "smb/smb")
                {
                    image = ResourceImageLoader.Get("folder-remote.png");
                }
                else if (internal_mime_type == "harddisk/harddisk" || internal_mime_type == "cdrom/cdrom" || internal_mime_type == "removable/removable")
                {
                    image = ResourceImageLoader.Get("text-x-generic.png");
                }
            }

            if (image != null)
            {
                index = MimeIconEngine.SmallIcons.Images.Add(image, Color.Transparent);
                MimeIconEngine.LargeIcons.Images.Add(image, Color.Transparent);
                MimeIconEngine.MimeIconIndex.Add(internal_mime_type, index);
            }
        }
Example #2
0
        public override object AddAndGetIconIndex(string mime_type)
        {
            int index = -1;

            Image image = GnomeUtil.GetIcon(mime_type, 48);

            if (image != null)
            {
                index = MimeIconEngine.SmallIcons.Images.Add(image, Color.Transparent);
                MimeIconEngine.LargeIcons.Images.Add(image, Color.Transparent);
                MimeIconEngine.MimeIconIndex.Add(mime_type, index);
            }

            return(index);
        }