ところで、Rory が "Refactor_Resolver" プラグインのいくつかのバグを修正したようで、現在は機能しています。あなたの質問については、ここに簡単な回答があります:
再 #1:
CodeRush には、ソリューションの解析中に構築されるすべてのタイプ、プロジェクト参照などの組み込みキャッシュがあります。しかし、現時点では内部で使用されており、プラグイン開発者には公開されていません。申し訳ありません。ただし、開始するのに役立ついくつかの API を次に示します。
// Using the source code cache...
// gets the active Solution object
SolutionElement activeSolution = CodeRush.Source.ActiveSolution;
if (activeSolution == null)
return;
// iterate thought all projects in the solution
foreach (ProjectElement project in activeSolution.AllProjects)
{
string assemblyName = project.AssemblyName;
// iterate inside source code symbols cache...
Hashtable projectSymbols = activeProject.ProjectSymbols;
foreach (object item in projectSymbols.Values)
{
ITypeElement typeElement = item as ITypeElement;
if (typeElement == null)
continue;
// TODO: ...
}
}
アセンブリ参照キャッシュを取得するには、ScopeManager (DevExpress.DXCore.MetaData.dll にあります) を使用します。
IEnumerable<IMetaDataScope> allMetaDataScopes = ScopeManager.All;
foreach (IMetaDataScope scope in allMetaDataScopes)
{
IAssemblyInfo assembly = scope.Assembly;
if (assembly != null)
{
ITypeInfo[] types = assembly.GetTypes();
for (int i = 0; i < types.Length; i++)
{
ITypeInfo typeInfo = types[i];
if (typeInfo == null)
continue;
// TODO: ...
}
}
}
RE #2: CodeProvider をポップアップに追加するには、「CodeIssueMessage」プロパティを修正するコードの問題の名前に設定します。
myCodeProvider.CodeIssueMessage = "宣言されていない要素";
さらにサポートが必要な場合はお知らせください。