コード例 #1
0
ファイル: Plugin.cs プロジェクト: reliefpfeiler42/Fusee
        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);
        }