ユーザ用ツール

サイト用ツール


appendix:他プラグイン

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
appendix:他プラグイン [2022/01/17 16:01]
fumble
appendix:他プラグイン [2022/03/05 16:07] (現在)
fumble
行 1: 行 1:
-=====シー判定方法=====+=====他プラグイの存在確認方法===== 
 +汎用的に行うならばアセンブリを列挙して探す。 
 +<code csharp>
 AppDomain.CurrentDomain.GetAssemblies() AppDomain.CurrentDomain.GetAssemblies()
 +</code>
 +
 +?????.plugin.dllはプラグイン用の属性持ちなのでそれを見ると名前とバージョンがわかる。
 +<code csharp>
 +foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
 +{
 +    if (String.IsNullOrEmpty(assembly.Location))
 +        continue;
 +    foreach (var type in assembly.GetTypes())
 +    {
 +        // プラグイン名を取る
 +        var attributesName = type.GetCustomAttributes(typeof(PluginNameAttribute), false);
 +        if (attributesName != null && attributesName.Count() != 0)
 +        {
 +            // プラグインっぽいのでバージョンも取る
 +            var attributesVertion = type.GetCustomAttributes(typeof(PluginVersionAttribute), false);
 +        }
 +    }
 +}
 +</code>
 +
 +連携用にインターフェースがあるものは、それを使えば・・・\\
appendix/他プラグイン.1642402892.txt.gz · 最終更新: 2022/01/17 16:01 by fumble