Пример #1
0
        public Icon GetResourceIcon(IResource resource)
        {
            if (resource.Type != "ResourceType")
            {
                throw new ArgumentException("Resource of type ResourceType expected");
            }

            string resType = resource.GetStringProp("Name");
            IResourceIconProvider provider = Core.ResourceIconManager.GetResourceIconProvider(resType);

            if (provider == null)
            {
                return(_defaultIcon);
            }
            return(provider.GetDefaultIcon(resType));
        }
Пример #2
0
        /**
         * Returns the default icon index for the specified resource type.
         */

        public int GetDefaultIconIndex(string resType)
        {
            if (Core.ResourceStore == null)
            {
                return(0);
            }

            IResourceIconProvider provider = (IResourceIconProvider)_resourceIconProviders [resType];

            if (provider != null)
            {
                Icon icon = provider.GetDefaultIcon(resType);
                return(AddIconIfNew(icon));
            }

            return(0);
        }