예제 #1
0
        private static void GetPluginDescription(Type t, PluginBaseAttribute attr, out string name, out BaseBitmap bmp)
        {
            name = attr.Name;
            if (string.IsNullOrEmpty(name))
            {
                name = t.Name;
            }

            // Falback icon
            String iconFile = null;

            if (!string.IsNullOrEmpty(attr.IconFile))
            {
                iconFile = Path.Combine(Path.GetDirectoryName(t.Assembly.Location), "res", attr.IconFile);
                if (!File.Exists(iconFile))
                {
                    iconFile = null;
                }
            }
            if (string.IsNullOrEmpty(iconFile))
            {
                iconFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                        "res", "CSharp.tif");
            }
            bmp = BaseBitmap.AutoBitmap(iconFile);
        }
예제 #2
0
        private static void GetPluginDescription(Type t, PluginBaseAttribute attr, out string name, out BaseBitmap bmp)
        {
            name = attr.Name;
            if (string.IsNullOrEmpty(name))
                name = t.Name;

            // Falback icon
            String iconFile = null;
            if (!string.IsNullOrEmpty(attr.IconFile))
            {
                iconFile = Path.Combine(Path.GetDirectoryName(t.Assembly.Location), "res", attr.IconFile);
                if (!File.Exists(iconFile))
                    iconFile = null;
            }
            if (string.IsNullOrEmpty(iconFile))
                iconFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                                        "res", "CSharp.tif");
            bmp = BaseBitmap.AutoBitmap(iconFile);
        }