Browse Source

Fixed some resolver bugs.

Added "bookmark" for classes.
Added support for finding references to classes and renaming classes.
Renamed the Erbauer/Auswerter classes.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@260 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
b414c2c33a
  1. 6
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 1832
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs
  3. 12
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG
  4. 2079
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  5. 18
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
  6. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  7. 118
      src/Main/Base/Project/Src/Commands/ClassMemberMenuBuilder.cs
  8. 15
      src/Main/Base/Project/Src/Dom/ResolveResult.cs
  9. 4
      src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/SchemeExtension.cs
  10. 2
      src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/DerivedTypesNode.cs
  11. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/ActiveContentExtensionEvaluator.cs
  12. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/ActiveViewContentUntitledEvaluator.cs
  13. 5
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/ActiveWindowStateEvaluator.cs
  14. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/CombineOpenEvaluator.cs
  15. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/DebuggerSupportsEvaluator.cs
  16. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/IsProcessRunningEvaluator.cs
  17. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/OpenWindowStateEvaluator.cs
  18. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/ProjectActiveEvaluator.cs
  19. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/ProjectOpenEvaluator.cs
  20. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/WindowActiveEvaluator.cs
  21. 2
      src/Main/Base/Project/Src/Internal/ConditionEvaluators/WindowOpenEvaluator.cs
  22. 4
      src/Main/Base/Project/Src/Internal/Doozers/DialogPanelDoozer.cs
  23. 4
      src/Main/Base/Project/Src/Internal/Doozers/PadDoozer.cs
  24. 5
      src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs
  25. 4
      src/Main/Base/Project/Src/Services/DisplayBinding/DisplayBindingDoozer.cs
  26. 4
      src/Main/Base/Project/Src/Services/LanguageBinding/LanguageBindingDoozer.cs
  27. 4
      src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDoozer.cs
  28. 155
      src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs
  29. 30
      src/Main/Base/Project/Src/TextEditor/Bookmarks/ClassMemberBookmark.cs
  30. 5
      src/Main/Base/Project/Src/TextEditor/Codons/EditActionDoozer.cs
  31. 5
      src/Main/Base/Project/Src/TextEditor/Codons/SyntaxModeDoozer.cs
  32. 155
      src/Main/Base/Project/Src/TextEditor/Commands/ClassBookmarkMenuBuilder.cs
  33. 164
      src/Main/Base/Project/Src/TextEditor/Commands/ParserBookmarkMenuBuilderBase.cs
  34. 2
      src/Main/Base/Project/Src/TextEditor/Conditions/TextContentCondition.cs
  35. 8
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs
  36. 14
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/QuickClassBrowserPanel.cs
  37. 43
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs
  38. 6
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/SearchReplaceInFilesManager.cs
  39. 12
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchRootNode.cs
  40. 4
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/SearchResultPanel.cs
  41. 8
      src/Main/Core/Project/Src/AddInTree/AddIn/Codon.cs
  42. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/Condition.cs
  43. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/CompareConditionEvaluator.cs
  44. 14
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/LazyConditionEvaluator.cs
  45. 5
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/OwnerStateConditionEvaluator.cs
  46. 6
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ClassDoozer.cs
  47. 7
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/FileFilterDoozer.cs
  48. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/Icon/IconDoozer.cs
  49. 6
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/IncludeDoozer.cs
  50. 20
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/LazyDoozer.cs
  51. 7
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/MenuItemDoozer.cs
  52. 7
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/ToolBarItemDoozer.cs
  53. 8
      src/Main/Core/Project/Src/AddInTree/AddIn/IBuildItemsModifier.cs
  54. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/IConditionEvaluator.cs
  55. 8
      src/Main/Core/Project/Src/AddInTree/AddIn/IDoozer.cs
  56. 40
      src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs
  57. 28
      src/Main/Core/Project/Src/AddInTree/AddInTree.cs
  58. 28
      src/Main/Core/Test/AddInTreeTests/AddInTreeLoadingTests.cs
  59. 40
      src/Main/StartUp/Project/SharpDevelopMain.cs

6
AddIns/ICSharpCode.SharpDevelop.addin

@ -1461,7 +1461,11 @@ @@ -1461,7 +1461,11 @@
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ClassMemberContextMenu">
<MenuItem id = "MenuBuilder" type="Builder" class = "ICSharpCode.SharpDevelop.Commands.ClassMemberMenuBuilder" />
<MenuItem id = "MenuBuilder" type="Builder" class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ClassMemberMenuBuilder" />
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ClassBookmarkContextMenu">
<MenuItem id = "MenuBuilder" type="Builder" class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ClassBookmarkMenuBuilder" />
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu">

1832
src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs

File diff suppressed because it is too large Load Diff

12
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -713,6 +713,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -713,6 +713,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
templates = newType.Templates;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.StartLocation = t.Location;
newType.Type = Types.Class;
.)
@ -721,7 +722,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -721,7 +722,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
/* .NET 2.0 */
[ TypeParameterList<templates> ]
[ ClassBase<out names> (. newType.BaseTypes = names; .) ] (. newType.StartLocation = t.EndLocation; .)
[ ClassBase<out names> (. newType.BaseTypes = names; .) ]
/* .NET 2.0 */
{ IF (IdentIsWhere()) TypeParameterConstraintsClause<templates> }
@ -733,6 +734,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -733,6 +734,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
| /*--- struct declaration: */ (. m.Check(Modifier.StructsInterfacesEnumsDelegates); .)
( "struct" (. TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
templates = newType.Templates;
newType.StartLocation = t.Location;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Struct;
@ -742,7 +744,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -742,7 +744,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
/* .NET 2.0 */
[ TypeParameterList<templates> ]
[ StructInterfaces<out names> (. newType.BaseTypes = names; .) ] (. newType.StartLocation = t.EndLocation; .)
[ StructInterfaces<out names> (. newType.BaseTypes = names; .) ]
/* .NET 2.0 */
{ IF (IdentIsWhere()) TypeParameterConstraintsClause<templates> }
@ -757,6 +759,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -757,6 +759,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
templates = newType.Templates;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.StartLocation = t.Location;
newType.Type = Types.Interface;
.)
ident (. newType.Name = t.val; .)
@ -764,7 +767,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -764,7 +767,7 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
/* .NET 2.0 */
[ TypeParameterList<templates> ]
[ InterfaceBase<out names> (. newType.BaseTypes = names; .) ] (. newType.StartLocation = t.EndLocation; .)
[ InterfaceBase<out names> (. newType.BaseTypes = names; .) ]
/* .NET 2.0 */
{ IF (IdentIsWhere()) TypeParameterConstraintsClause<templates> }
@ -777,11 +780,12 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes> @@ -777,11 +780,12 @@ TypeDecl<Modifiers m, List<AttributeSection> attributes>
"enum" (. TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.StartLocation = t.Location;
newType.Type = Types.Enum;
.)
ident (. newType.Name = t.val; .)
[ ":" IntegralType<out name> (. newType.BaseTypes.Add(new TypeReference(name)); .)
] (. newType.StartLocation = t.EndLocation; .)
]
EnumBody
[ ";" ] (. newType.EndLocation = t.Location;
compilationUnit.BlockEnd();

2079
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

File diff suppressed because it is too large Load Diff

18
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -597,13 +597,13 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes> @@ -597,13 +597,13 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes>
["Partial" (. m.Add(Modifier.Partial); .)]
"Class"
(. TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
newType.StartLocation = t.Location;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Class;
.)
Identifier (. newType.Name = t.val; newType.StartLocation = t.EndLocation; .)
Identifier (. newType.Name = t.val; .)
TypeParameterList<newType.Templates>
EndOfStmt
[ ClassBaseType<out typeRef> (. newType.BaseTypes.Add(typeRef); .) ]
@ -621,11 +621,10 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes> @@ -621,11 +621,10 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes>
newType.StartLocation = t.Location;
newType.Type = Types.Module;
.)
Identifier (. newType.Name = t.val; newType.StartLocation = t.EndLocation; .)
Identifier (. newType.Name = t.val; .)
EOL
ModuleBody<newType>
(.
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
.)
| "Structure"
@ -637,12 +636,11 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes> @@ -637,12 +636,11 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes>
newType.StartLocation = t.Location;
newType.Type = Types.Struct;
.)
Identifier (. newType.Name = t.val; newType.StartLocation = t.EndLocation; .)
Identifier (. newType.Name = t.val; .)
TypeParameterList<newType.Templates>
EOL { TypeImplementsClause<out baseInterfaces> (. newType.BaseTypes.AddRange(baseInterfaces);.) }
StructureBody<newType>
(.
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
.)
| /* 7.4 */
@ -650,18 +648,18 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes> @@ -650,18 +648,18 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes>
(.
m.Check(Modifier.VBEnums);
TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
newType.StartLocation = t.Location;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Enum;
.)
Identifier (. newType.Name = t.val; newType.StartLocation = t.EndLocation; .)
Identifier (. newType.Name = t.val; .)
[ "As" PrimitiveTypeName<out name> (. newType.BaseTypes.Add(new TypeReference(name)); .) ]
EOL
EnumBody<newType>
(.
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
.)
| /* 7.8 */
@ -669,16 +667,16 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes> @@ -669,16 +667,16 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes>
(.
m.Check(Modifier.VBInterfacs);
TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
newType.StartLocation = t.Location;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Interface;
.)
Identifier (. newType.Name = t.val; newType.StartLocation = t.EndLocation; .)
Identifier (. newType.Name = t.val; .)
TypeParameterList<newType.Templates>
EndOfStmt { InterfaceBase<out baseInterfaces> (. newType.BaseTypes.AddRange(baseInterfaces); .) }
InterfaceBody<newType>
(.
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
.)
| /* 7.10 */

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -683,6 +683,8 @@ @@ -683,6 +683,8 @@
<Compile Include="Src\Dom\CodeCompletionOptions.cs" />
<Compile Include="Src\Services\Debugger\CurrentLineBookmark.cs" />
<Compile Include="Src\Dom\ClassFinder.cs" />
<Compile Include="Src\TextEditor\Commands\ClassBookmarkMenuBuilder.cs" />
<Compile Include="Src\TextEditor\Commands\ParserBookmarkMenuBuilderBase.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj">

118
src/Main/Base/Project/Src/Commands/ClassMemberMenuBuilder.cs

@ -20,12 +20,12 @@ using ICSharpCode.SharpDevelop.Gui; @@ -20,12 +20,12 @@ using ICSharpCode.SharpDevelop.Gui;
using SearchAndReplace;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
namespace ICSharpCode.SharpDevelop.Commands
namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
{
/// <summary>
/// Build context menu for class members in the text editor.
/// </summary>
public class ClassMemberMenuBuilder : ISubmenuBuilder
public class ClassMemberMenuBuilder : ParserBookmarkMenuBuilderBase, ISubmenuBuilder
{
public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
{
@ -82,42 +82,6 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -82,42 +82,6 @@ namespace ICSharpCode.SharpDevelop.Commands
return list.ToArray();
}
TextEditorControl JumpToDefinition(IMember member)
{
IViewContent viewContent = null;
ICompilationUnit cu = member.DeclaringType.CompilationUnit;
if (cu != null) {
string fileName = cu.FileName;
if (fileName != null) {
if (member.Region != null && member.Region.BeginLine > 0) {
viewContent = FileService.JumpToFilePosition(fileName, member.Region.BeginLine - 1, member.Region.BeginColumn - 1);
} else {
FileService.OpenFile(fileName);
}
}
}
ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider tecp = viewContent as ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider;
return (tecp == null) ? null : tecp.TextEditorControl;
}
TextEditorControl JumpBehindDefinition(IMember member)
{
IViewContent viewContent = null;
ICompilationUnit cu = member.DeclaringType.CompilationUnit;
if (cu != null) {
string fileName = cu.FileName;
if (fileName != null) {
if (member.Region != null && member.Region.EndLine > 0) {
viewContent = FileService.JumpToFilePosition(fileName, member.Region.EndLine, 0);
} else {
FileService.OpenFile(fileName);
}
}
}
ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider tecp = viewContent as ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider;
return (tecp == null) ? null : tecp.TextEditorControl;
}
void CreateProperty(object sender, EventArgs e)
{
CreateProperty(sender, e, true);
@ -174,69 +138,23 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -174,69 +138,23 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
private struct Modification {
public IDocument Document;
public int Offset;
public int LengthDifference;
public Modification(IDocument Document, int Offset, int LengthDifference)
{
this.Document = Document;
this.Offset = Offset;
this.LengthDifference = LengthDifference;
}
}
void Rename(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IMember member = (IMember)item.Tag;
string newName = MessageService.ShowInputBox("Rename", "Enter the new name of the member", member.Name);
if (newName == null || newName.Length == 0) return;
if (!CheckName(newName)) return;
List<Reference> list = RefactoringService.FindReferences(member, null);
if (list == null) return;
List<IViewContent> modifiedContents = new List<IViewContent>();
List<Modification> modifications = new List<Modification>();
foreach (Reference r in list) {
FileService.OpenFile(r.FileName);
IViewContent viewContent = FileService.GetOpenFile(r.FileName).ViewContent;
if (!modifiedContents.Contains(viewContent)) {
modifiedContents.Add(viewContent);
}
ITextEditorControlProvider p = viewContent as ITextEditorControlProvider;
if (p != null) {
IDocument doc = p.TextEditorControl.Document;
int offset = r.Offset;
foreach (Modification m in modifications) {
if (m.Document != doc) continue;
if (m.Offset < offset) offset += m.LengthDifference;
}
int lengthDifference = newName.Length - r.Length;
doc.Replace(offset, r.Length, newName);
if (lengthDifference != 0) {
for (int i = 0; i < modifications.Count; ++i) {
Modification m = modifications[i];
if (m.Document != doc) continue;
if (m.Offset > offset) {
m.Offset += lengthDifference;
modifications[i] = m; // Modification is a value type
}
}
modifications.Add(new Modification(doc, offset, lengthDifference));
}
}
}
foreach (IViewContent viewContent in modifiedContents) {
ParserService.ParseViewContent(viewContent);
}
RenameReferences(list, newName);
}
void FindOverrides(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IMember member = (IMember)item.Tag;
List<IClass> derivedClasses = RefactoringService.FindDerivedClasses(member.DeclaringType, ParserService.AllProjectContents);
List<IClass> derivedClasses = RefactoringService.FindDerivedClasses(member.DeclaringType, ParserService.AllProjectContents, false);
List<SearchResult> results = new List<SearchResult>();
foreach (IClass derivedClass in derivedClasses) {
if (derivedClass.CompilationUnit == null) continue;
@ -248,36 +166,14 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -248,36 +166,14 @@ namespace ICSharpCode.SharpDevelop.Commands
results.Add(res);
}
}
SearchReplaceInFilesManager.ShowSearchResults(results);
SearchReplaceInFilesManager.ShowSearchResults("Overrides of " + member.Name, results);
}
void FindReferences(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IMember member = (IMember)item.Tag;
List<Reference> list = RefactoringService.FindReferences(member, null);
if (list == null) return;
List<SearchResult> results = new List<SearchResult>();
foreach (Reference r in list) {
SearchResult res = new SearchResult(r.Offset, r.Length);
res.ProvidedDocumentInformation = GetDocumentInformation(r.FileName);
results.Add(res);
}
SearchReplaceInFilesManager.ShowSearchResults(results);
}
ProvidedDocumentInformation GetDocumentInformation(string fileName)
{
foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
if (content is ITextEditorControlProvider &&
content.FileName != null &&
FileUtility.IsEqualFileName(content.FileName, fileName))
{
return new ProvidedDocumentInformation(((ITextEditorControlProvider)content).TextEditorControl.Document, fileName, 0);
}
}
ITextBufferStrategy strategy = StringTextBufferStrategy.CreateTextBufferFromFile(fileName);
return new ProvidedDocumentInformation(strategy, fileName, 0);
ShowAsSearchResults("References to " + member.Name, RefactoringService.FindReferences(member, null));
}
}
}

15
src/Main/Base/Project/Src/Dom/ResolveResult.cs

@ -355,6 +355,11 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -355,6 +355,11 @@ namespace ICSharpCode.SharpDevelop.Dom
}
public override FilePosition GetDefinitionPosition()
{
return GetDefinitionPosition(resolvedMember);
}
public static FilePosition GetDefinitionPosition(IMember resolvedMember)
{
IClass declaringType = resolvedMember.DeclaringType;
if (declaringType == null) {
@ -424,6 +429,16 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -424,6 +429,16 @@ namespace ICSharpCode.SharpDevelop.Dom
return containingType;
}
}
public override FilePosition GetDefinitionPosition()
{
List<IMethod> methods = containingType.GetMethods();
methods = methods.FindAll(delegate(IMethod m) { return m.Name == this.Name; });
if (methods.Count == 1) {
return MemberResolveResult.GetDefinitionPosition(methods[0]);
}
return base.GetDefinitionPosition();
}
}
#endregion
}

4
src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/SchemeExtension.cs

@ -49,10 +49,10 @@ namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding @@ -49,10 +49,10 @@ namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
}
}
public class SchemeExtensionErbauer : IErbauer
public class SchemeExtensionDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

2
src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/DerivedTypesNode.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -67,7 +67,7 @@ namespace ICSharpCode.SharpDevelop.Gui
IProjectContent projectContent = ParserService.GetProjectContent(project);
if (projectContent != null) {
contentList[0] = projectContent;
foreach (IClass derivedClass in RefactoringService.FindDerivedClasses(c, contentList)) {
foreach (IClass derivedClass in RefactoringService.FindDerivedClasses(c, contentList, true)) {
new ClassNode(project, derivedClass).AddTo(this);
}
}

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/ActiveContentExtensionEvaluator.cs

@ -13,7 +13,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -13,7 +13,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class ActiveContentExtensionAuswerter : IAuswerter
public class ActiveContentExtensionConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/ActiveViewContentUntitledEvaluator.cs

@ -14,7 +14,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -14,7 +14,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class ActiveViewContentUntitledAuswerter : IAuswerter
public class ActiveViewContentUntitledConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

5
src/Main/Base/Project/Src/Internal/ConditionEvaluators/ActiveWindowStateEvaluator.cs

@ -19,10 +19,7 @@ namespace ICSharpCode.Core @@ -19,10 +19,7 @@ namespace ICSharpCode.Core
ViewOnly = 4
}
/// <summary>
/// Description of WindowStateCondition.
/// </summary>
public class ActiveWindowStateAuswerter : IAuswerter
public class ActiveWindowStateConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/CombineOpenEvaluator.cs

@ -14,7 +14,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -14,7 +14,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class CombineOpenAuswerter : IAuswerter
public class CombineOpenConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/DebuggerSupportsEvaluator.cs

@ -12,7 +12,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -12,7 +12,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class DebuggerSupportsAuswerter : IAuswerter
public class DebuggerSupportsConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/IsProcessRunningEvaluator.cs

@ -12,7 +12,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -12,7 +12,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class IsProcessRunningAuswerter : IAuswerter
public class IsProcessRunningConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/OpenWindowStateEvaluator.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.Core @@ -15,7 +15,7 @@ namespace ICSharpCode.Core
/// <summary>
/// Description of WindowStateCondition.
/// </summary>
public class OpenWindowStateAuswerter : IAuswerter
public class OpenWindowStateConditionEvaluator : IConditionEvaluator
{
WindowState windowState = WindowState.None;
WindowState nowindowState = WindowState.None;

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/ProjectActiveEvaluator.cs

@ -16,7 +16,7 @@ using ICSharpCode.SharpDevelop.Project; @@ -16,7 +16,7 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Core
{
public class ProjectActiveAuswerter : IAuswerter
public class ProjectActiveConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/ProjectOpenEvaluator.cs

@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Project; @@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Core
{
public class ProjectOpenAuswerter : IAuswerter
public class ProjectOpenConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/WindowActiveEvaluator.cs

@ -14,7 +14,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -14,7 +14,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class WindowActiveAuswerter : IAuswerter
public class WindowActiveConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

2
src/Main/Base/Project/Src/Internal/ConditionEvaluators/WindowOpenEvaluator.cs

@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -15,7 +15,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class WindowOpenAuswerter : IAuswerter
public class WindowOpenConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

4
src/Main/Base/Project/Src/Internal/Doozers/DialogPanelDoozer.cs

@ -11,10 +11,10 @@ using System.Reflection; @@ -11,10 +11,10 @@ using System.Reflection;
namespace ICSharpCode.Core
{
public class DialogPanelErbauer : IErbauer
public class DialogPanelDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

4
src/Main/Base/Project/Src/Internal/Doozers/PadDoozer.cs

@ -12,10 +12,10 @@ using ICSharpCode.SharpDevelop.Gui; @@ -12,10 +12,10 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
public class PadErbauer : IErbauer
public class PadDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

5
src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs

@ -341,9 +341,8 @@ namespace ICSharpCode.Core @@ -341,9 +341,8 @@ namespace ICSharpCode.Core
else
b.Append("local variable ");
b.Append(ambience.Convert(rr.Field));
IDebugger debugger = CurrentDebugger;
if (debugger != null) {
string currentValue = debugger.GetValueAsString(rr.Field.Name);
if (currentDebugger != null) {
string currentValue = currentDebugger.GetValueAsString(rr.Field.Name);
if (currentValue != null) {
b.Append(" = ");
b.Append(currentValue);

4
src/Main/Base/Project/Src/Services/DisplayBinding/DisplayBindingDoozer.cs

@ -13,10 +13,10 @@ using ICSharpCode.Core; @@ -13,10 +13,10 @@ using ICSharpCode.Core;
namespace ICSharpCode.Core
{
public class DisplayBindingErbauer : IErbauer
public class DisplayBindingDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

4
src/Main/Base/Project/Src/Services/LanguageBinding/LanguageBindingDoozer.cs

@ -14,10 +14,10 @@ using ICSharpCode.SharpDevelop.Project; @@ -14,10 +14,10 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Core
{
public class LanguageBindingErbauer : IErbauer
public class LanguageBindingDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

4
src/Main/Base/Project/Src/Services/ParserService/Doozer/ParserDoozer.cs

@ -14,10 +14,10 @@ using ICSharpCode.SharpDevelop.Project; @@ -14,10 +14,10 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Core
{
public class ParserErbauer : IErbauer
public class ParserDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

155
src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

@ -19,10 +19,14 @@ namespace ICSharpCode.Core @@ -19,10 +19,14 @@ namespace ICSharpCode.Core
{
#region FindDerivedClasses
/// <summary>
/// Finds all classes deriving directly from baseClass.
/// Finds all classes deriving from baseClass.
/// </summary>
public static List<IClass> FindDerivedClasses(IClass baseClass, IEnumerable<IProjectContent> projectContents)
/// <param name="baseClass">The base class.</param>
/// <param name="projectContents">The project contents in which derived classes should be searched.</param>
/// <param name="directDerivationOnly">If true, gets only the classes that derive directly from <paramref name="baseClass"/>.</param>
public static List<IClass> FindDerivedClasses(IClass baseClass, IEnumerable<IProjectContent> projectContents, bool directDerivationOnly)
{
baseClass = FixClass(baseClass);
string baseClassName = baseClass.Name;
string baseClassFullName = baseClass.FullyQualifiedName;
List<IClass> list = new List<IClass>();
@ -47,6 +51,16 @@ namespace ICSharpCode.Core @@ -47,6 +51,16 @@ namespace ICSharpCode.Core
}
}
}
if (!directDerivationOnly) {
List<IClass> additional = new List<IClass>();
foreach (IClass c in list) {
additional.AddRange(FindDerivedClasses(c, projectContents, directDerivationOnly));
}
foreach (IClass c in additional) {
if (!list.Contains(c))
list.Add(c);
}
}
return list;
}
#endregion
@ -56,12 +70,25 @@ namespace ICSharpCode.Core @@ -56,12 +70,25 @@ namespace ICSharpCode.Core
/// Find all references to the specified member.
/// </summary>
public static List<Reference> FindReferences(IMember member, IProgressMonitor progressMonitor)
{
return RunFindReferences(member.DeclaringType, member, progressMonitor);
}
/// <summary>
/// Find all references to the specified class.
/// </summary>
public static List<Reference> FindReferences(IClass @class, IProgressMonitor progressMonitor)
{
return RunFindReferences(@class, null, progressMonitor);
}
static List<Reference> RunFindReferences(IClass ownerClass, IMember member, IProgressMonitor progressMonitor)
{
if (ParserService.LoadSolutionProjectsThreadRunning) {
MessageService.ShowMessage("Find references cannot be executed until all files have been parsed.");
return null;
}
IClass ownerClass = member.DeclaringType;
ownerClass = FixClass(ownerClass);
List<ProjectItem> files = GetPossibleFiles(ownerClass, member);
ParseableFileContentEnumerator enumerator = new ParseableFileContentEnumerator(files.ToArray());
List<Reference> references = new List<Reference>();
@ -88,25 +115,28 @@ namespace ICSharpCode.Core @@ -88,25 +115,28 @@ namespace ICSharpCode.Core
static void AddReferences(List<Reference> list, IClass parentClass, IMember member, string fileName, string fileContent)
{
string lowerFileContent = fileContent.ToLower();
string searchedText; // the text that is searched for
// The name of the class does not necessarily exist in the file if the name of a
// derived class exists.
//if (lowerFileContent.IndexOf(parentClass.Name.ToLower()) < 0) return;
string lowerMemberName;
if (member is IMethod && ((IMethod)member).IsConstructor)
lowerMemberName = parentClass.Name.ToLower();
else
lowerMemberName = member.Name.ToLower();
if (member == null) {
searchedText = parentClass.Name.ToLower();
} else {
// When looking for a member, the name of the parent class does not always exist
// in the file where the member is accessed.
// (examples: derived classes, partial classes)
if (member is IMethod && ((IMethod)member).IsConstructor)
searchedText = parentClass.Name.ToLower();
else
searchedText = member.Name.ToLower();
}
int pos = -1;
IExpressionFinder expressionFinder = null;
while ((pos = lowerFileContent.IndexOf(lowerMemberName, pos + 1)) >= 0) {
while ((pos = lowerFileContent.IndexOf(searchedText, pos + 1)) >= 0) {
if (pos > 0 && char.IsLetterOrDigit(fileContent, pos - 1)) {
continue; // memberName is not a whole word (a.SomeName cannot reference Name)
}
if (pos < fileContent.Length - lowerMemberName.Length - 1
&& char.IsLetterOrDigit(fileContent, pos + lowerMemberName.Length))
if (pos < fileContent.Length - searchedText.Length - 1
&& char.IsLetterOrDigit(fileContent, pos + searchedText.Length))
{
continue; // memberName is not a whole word (a.Name2 cannot reference Name)
}
@ -120,8 +150,23 @@ namespace ICSharpCode.Core @@ -120,8 +150,23 @@ namespace ICSharpCode.Core
// TODO: Optimize by re-using the same resolver if multiple expressions were
// found in this file (the resolver should parse all methods at once)
ResolveResult rr = ParserService.Resolve(expr, position.Y, position.X, fileName, fileContent);
if (IsReferenceToMember(member, rr)) {
list.Add(new Reference(fileName, pos, lowerMemberName.Length, expr.Expression, rr));
if (member != null) {
if (IsReferenceToMember(member, rr)) {
list.Add(new Reference(fileName, pos, searchedText.Length, expr.Expression, rr));
}
} else {
MemberResolveResult mrr = rr as MemberResolveResult;
if (mrr != null) {
if (mrr.ResolvedMember is IMethod && ((IMethod)mrr.ResolvedMember).IsConstructor) {
if (mrr.ResolvedMember.DeclaringType.FullyQualifiedName == parentClass.FullyQualifiedName) {
list.Add(new Reference(fileName, pos, searchedText.Length, expr.Expression, rr));
}
}
} else {
if (rr is TypeResolveResult && rr.ResolvedType.FullyQualifiedName == parentClass.FullyQualifiedName) {
list.Add(new Reference(fileName, pos, searchedText.Length, expr.Expression, rr));
}
}
}
}
}
@ -142,17 +187,64 @@ namespace ICSharpCode.Core @@ -142,17 +187,64 @@ namespace ICSharpCode.Core
return new Point(column, line);
}
static List<ProjectItem> GetPossibleFiles(IClass ownerClass, IMember member)
/// <summary>
/// Gets the compound class if the class was partial.
/// </summary>
static IClass FixClass(IClass c)
{
return c.DefaultReturnType.GetUnderlyingClass();
}
public static List<string> GetFileNames(IClass c)
{
List<string> list = new List<string>();
CompoundClass cc = c as CompoundClass;
if (cc != null) {
foreach (IClass part in cc.Parts) {
string fileName = part.CompilationUnit.FileName;
if (fileName != null)
list.Add(fileName);
}
} else {
string fileName = c.CompilationUnit.FileName;
if (fileName != null)
list.Add(fileName);
}
return list;
}
/// <summary>
/// Gets the list of files that could have a reference to the specified class.
/// </summary>
static List<ProjectItem> GetPossibleFiles(IClass c)
{
if (c.DeclaringType != null) {
return GetPossibleFiles(c.DeclaringType, c);
}
List<ProjectItem> resultList = new List<ProjectItem>();
GetPossibleFilesInternal(resultList, c.ProjectContent, c.IsInternal);
return resultList;
}
/// <summary>
/// Gets the files of files that could have a reference to the <paramref name="member"/>
/// int the <paramref name="ownerClass"/>.
/// </summary>
static List<ProjectItem> GetPossibleFiles(IClass ownerClass, IDecoration member)
{
if (member == null)
return GetPossibleFiles(ownerClass);
List<ProjectItem> resultList = new List<ProjectItem>();
if (member.IsPrivate) {
string fileName = ownerClass.CompilationUnit.FileName;
foreach (IProject p in ProjectService.OpenSolution.Projects) {
foreach (ProjectItem item in p.Items) {
if (item.ItemType == ItemType.Compile) {
if (FileUtility.IsEqualFileName(fileName, item.FileName)) {
resultList.Add(item);
return resultList;
List<string> fileNames = GetFileNames(ownerClass);
foreach (string fileName in fileNames) {
foreach (IProject p in ProjectService.OpenSolution.Projects) {
foreach (ProjectItem item in p.Items) {
if (item.ItemType == ItemType.Compile) {
if (FileUtility.IsEqualFileName(fileName, item.FileName)) {
resultList.Add(item);
return resultList;
}
}
}
}
@ -163,17 +255,21 @@ namespace ICSharpCode.Core @@ -163,17 +255,21 @@ namespace ICSharpCode.Core
// TODO: Optimize when member is protected
}
bool internalOnly = member.IsInternal && !member.IsProtected;
GetPossibleFilesInternal(resultList, ownerClass.ProjectContent, ownerClass.IsInternal || member.IsInternal && !member.IsProtected);
return resultList;
}
static void GetPossibleFilesInternal(List<ProjectItem> resultList, IProjectContent ownerProjectContent, bool internalOnly)
{
foreach (IProject p in ProjectService.OpenSolution.Projects) {
IProjectContent pc = ParserService.GetProjectContent(p);
if (pc == null) continue;
if (pc != ownerClass.ProjectContent) {
if (pc != ownerProjectContent) {
if (internalOnly) {
// internal = can be only referenced from same project content
continue;
}
if (!pc.HasReferenceTo(ownerClass.ProjectContent)) {
if (!pc.HasReferenceTo(ownerProjectContent)) {
// unreferences project contents cannot reference the class
continue;
}
@ -184,7 +280,6 @@ namespace ICSharpCode.Core @@ -184,7 +280,6 @@ namespace ICSharpCode.Core
}
}
}
return resultList;
}
#endregion

30
src/Main/Base/Project/Src/TextEditor/Bookmarks/ClassMemberBookmark.cs

@ -50,6 +50,36 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -50,6 +50,36 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
}
}
public class ClassBookmark : Bookmark
{
IClass @class;
public IClass Class {
get {
return @class;
}
set {
@class = value;
}
}
public ClassBookmark(IDocument document, IClass @class)
: base(document, @class.Region.BeginLine - 1)
{
this.@class = @class;
}
public override void Click(Control parent, MouseEventArgs e)
{
MenuService.ShowContextMenu(this, "/SharpDevelop/ViewContent/DefaultTextEditor/ClassBookmarkContextMenu", parent, e.X, e.Y);
}
public override void Draw(IconBarMargin margin, Graphics g, Point p)
{
g.DrawImageUnscaled(ClassBrowserIconService.ImageList.Images[ClassBrowserIconService.GetIcon(@class)], p);
}
}
public class PropertyBookmark : ClassMemberBookmark
{
IProperty property;

5
src/Main/Base/Project/Src/TextEditor/Codons/EditActionDoozer.cs

@ -17,11 +17,10 @@ using ICSharpCode.TextEditor.Actions; @@ -17,11 +17,10 @@ using ICSharpCode.TextEditor.Actions;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Codons
{
// [CodonNameAttribute("EditAction")]
public class EditActionErbauer : IErbauer
public class EditActionDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

5
src/Main/Base/Project/Src/TextEditor/Codons/SyntaxModeDoozer.cs

@ -42,11 +42,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Codons @@ -42,11 +42,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Codons
}
}
// [CodonNameAttribute("SyntaxMode")]
public class SyntaxModeErbauer : IErbauer
public class SyntaxModeDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

155
src/Main/Base/Project/Src/TextEditor/Commands/ClassBookmarkMenuBuilder.cs

@ -0,0 +1,155 @@ @@ -0,0 +1,155 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Gui;
using SearchAndReplace;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
{
/// <summary>
/// Build context menu for class members in the text editor.
/// </summary>
public class ClassBookmarkMenuBuilder : ParserBookmarkMenuBuilderBase, ISubmenuBuilder
{
public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
{
MenuCommand cmd;
ClassBookmark bookmark = (ClassBookmark)owner;
IClass c = bookmark.Class;
List<ToolStripItem> list = new List<ToolStripItem>();
cmd = new MenuCommand("&Rename", Rename);
cmd.Tag = c;
list.Add(cmd);
if (c.BaseTypes.Count > 0) {
cmd = new MenuCommand("Go to &base class", GoToBase);
cmd.Tag = c;
list.Add(cmd);
}
if (!c.IsSealed && !c.IsStatic) {
cmd = new MenuCommand("Find &derived classes", FindDerivedClasses);
cmd.Tag = c;
list.Add(cmd);
}
cmd = new MenuCommand("&Find references", FindReferences);
cmd.Tag = c;
list.Add(cmd);
return list.ToArray();
}
void GoToBase(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IClass c = (IClass)item.Tag;
IClass baseClass = c.BaseClass;
if (baseClass != null) {
string fileName = baseClass.CompilationUnit.FileName;
if (fileName != null) {
FileService.JumpToFilePosition(fileName, baseClass.Region.BeginLine - 1, baseClass.Region.BeginColumn - 1);
}
}
}
void Rename(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IClass c = (IClass)item.Tag;
c = c.DefaultReturnType.GetUnderlyingClass(); // get compound class if class is partial
string newName = MessageService.ShowInputBox("Rename", "Enter the new name of the class", c.Name);
if (!CheckName(newName)) return;
List<Reference> list = RefactoringService.FindReferences(c, null);
if (list == null) return;
// Add the class declaration(s)
foreach (IClass part in GetClassParts(c)) {
AddDeclarationAsReference(list, part.CompilationUnit.FileName, part.Region, part.Name);
}
// Add the constructors
foreach (IMethod m in c.Methods) {
if (m.IsConstructor) {
AddDeclarationAsReference(list, m.DeclaringType.CompilationUnit.FileName, m.Region, c.Name);
}
}
RenameReferences(list, newName);
}
void AddDeclarationAsReference(List<Reference> list, string fileName, IRegion region, string name)
{
if (fileName == null)
return;
ProvidedDocumentInformation documentInformation = GetDocumentInformation(fileName);
int offset = documentInformation.Document.PositionToOffset(new Point(region.BeginColumn - 1, region.BeginLine - 1));
string text = documentInformation.TextBuffer.GetText(offset, Math.Min(name.Length + 30, documentInformation.TextBuffer.Length - offset - 1));
int offsetChange = text.IndexOf(name);
if (offsetChange < 0)
return;
offset += offsetChange;
foreach (Reference r in list) {
if (r.Offset == offset)
return;
}
list.Add(new Reference(fileName, offset, name.Length, name, null));
}
List<IClass> GetClassParts(IClass c)
{
List<IClass> list;
CompoundClass cc = c as CompoundClass;
if (cc != null) {
list = cc.Parts;
} else {
list = new List<IClass>(1);
list.Add(c);
}
return list;
}
void FindDerivedClasses(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IClass c = (IClass)item.Tag;
List<IClass> derivedClasses = RefactoringService.FindDerivedClasses(c, ParserService.AllProjectContents, false);
List<SearchResult> results = new List<SearchResult>();
foreach (IClass derivedClass in derivedClasses) {
if (derivedClass.CompilationUnit == null) continue;
if (derivedClass.CompilationUnit.FileName == null) continue;
SearchResult res = new SimpleSearchResult(derivedClass.FullyQualifiedName, new Point(derivedClass.Region.BeginColumn - 1, derivedClass.Region.BeginLine - 1));
res.ProvidedDocumentInformation = GetDocumentInformation(derivedClass.CompilationUnit.FileName);
results.Add(res);
}
SearchReplaceInFilesManager.ShowSearchResults("Classes deriving from " + c.Name, results);
}
void FindReferences(object sender, EventArgs e)
{
MenuCommand item = (MenuCommand)sender;
IClass c = (IClass)item.Tag;
ShowAsSearchResults("References to " + c.Name, RefactoringService.FindReferences(c, null));
}
}
}

164
src/Main/Base/Project/Src/TextEditor/Commands/ParserBookmarkMenuBuilderBase.cs

@ -0,0 +1,164 @@ @@ -0,0 +1,164 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Gui;
using SearchAndReplace;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
{
public class ParserBookmarkMenuBuilderBase
{
protected ProvidedDocumentInformation GetDocumentInformation(string fileName)
{
foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
if (content is ITextEditorControlProvider &&
content.FileName != null &&
FileUtility.IsEqualFileName(content.FileName, fileName))
{
return new ProvidedDocumentInformation(((ITextEditorControlProvider)content).TextEditorControl.Document, fileName, 0);
}
}
ITextBufferStrategy strategy = StringTextBufferStrategy.CreateTextBufferFromFile(fileName);
return new ProvidedDocumentInformation(strategy, fileName, 0);
}
protected TextEditorControl JumpToDefinition(IMember member)
{
IViewContent viewContent = null;
ICompilationUnit cu = member.DeclaringType.CompilationUnit;
if (cu != null) {
string fileName = cu.FileName;
if (fileName != null) {
if (member.Region != null && member.Region.BeginLine > 0) {
viewContent = FileService.JumpToFilePosition(fileName, member.Region.BeginLine - 1, member.Region.BeginColumn - 1);
} else {
FileService.OpenFile(fileName);
}
}
}
ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider tecp = viewContent as ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider;
return (tecp == null) ? null : tecp.TextEditorControl;
}
protected TextEditorControl JumpBehindDefinition(IMember member)
{
IViewContent viewContent = null;
ICompilationUnit cu = member.DeclaringType.CompilationUnit;
if (cu != null) {
string fileName = cu.FileName;
if (fileName != null) {
if (member.Region != null && member.Region.EndLine > 0) {
viewContent = FileService.JumpToFilePosition(fileName, member.Region.EndLine, 0);
} else {
FileService.OpenFile(fileName);
}
}
}
ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider tecp = viewContent as ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider;
return (tecp == null) ? null : tecp.TextEditorControl;
}
protected bool CheckName(string name)
{
if (name == null || name.Length == 0)
return false;
if (!char.IsLetter(name, 0) && name[0] != '_') {
MessageService.ShowError("Names must start with a letter or underscore.");
return false;
}
for (int i = 1; i < name.Length; i++) {
if (!char.IsLetterOrDigit(name, i) && name[i] != '_') {
MessageService.ShowError("Names may only contain letters, digits or underscores.");
return false;
}
}
return true;
}
protected struct Modification
{
public IDocument Document;
public int Offset;
public int LengthDifference;
public Modification(IDocument document, int offset, int lengthDifference)
{
this.Document = document;
this.Offset = offset;
this.LengthDifference = lengthDifference;
}
}
protected void ModifyDocument(List<Modification> modifications, IDocument doc, int offset, int length, string newName)
{
foreach (Modification m in modifications) {
if (m.Document == doc) {
if (m.Offset < offset)
offset += m.LengthDifference;
}
}
int lengthDifference = newName.Length - length;
doc.Replace(offset, length, newName);
if (lengthDifference != 0) {
for (int i = 0; i < modifications.Count; ++i) {
Modification m = modifications[i];
if (m.Document == doc) {
if (m.Offset > offset) {
m.Offset += lengthDifference;
modifications[i] = m; // Modification is a value type
}
}
}
modifications.Add(new Modification(doc, offset, lengthDifference));
}
}
protected void ShowAsSearchResults(string pattern, List<Reference> list)
{
if (list == null) return;
List<SearchResult> results = new List<SearchResult>(list.Count);
foreach (Reference r in list) {
SearchResult res = new SearchResult(r.Offset, r.Length);
res.ProvidedDocumentInformation = GetDocumentInformation(r.FileName);
results.Add(res);
}
SearchReplaceInFilesManager.ShowSearchResults(pattern, results);
}
protected void RenameReferences(List<Reference> list, string newName)
{
List<IViewContent> modifiedContents = new List<IViewContent>();
List<Modification> modifications = new List<Modification>();
foreach (Reference r in list) {
FileService.OpenFile(r.FileName);
IViewContent viewContent = FileService.GetOpenFile(r.FileName).ViewContent;
if (!modifiedContents.Contains(viewContent)) {
modifiedContents.Add(viewContent);
}
ITextEditorControlProvider p = viewContent as ITextEditorControlProvider;
if (p != null) {
ModifyDocument(modifications, p.TextEditorControl.Document, r.Offset, r.Length, newName);
}
}
foreach (IViewContent viewContent in modifiedContents) {
ParserService.ParseViewContent(viewContent);
}
}
}
}

2
src/Main/Base/Project/Src/TextEditor/Conditions/TextContentCondition.cs

@ -16,7 +16,7 @@ using ICSharpCode.TextEditor; @@ -16,7 +16,7 @@ using ICSharpCode.TextEditor;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Conditions
{
public class TextContentAuswerter : IAuswerter
public class TextContentConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

8
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs

@ -131,7 +131,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -131,7 +131,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
{
ambience = AmbienceService.CurrentAmbience;
ambience.ConversionFlags |= ConversionFlags.ShowReturnType;
ambience.ConversionFlags = ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames | ConversionFlags.ShowModifiers;
imageIndex = ClassBrowserIconService.GetIcon(method);
text = method.Name;
description = ambience.Convert(method);
@ -143,7 +143,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -143,7 +143,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
{
ambience = AmbienceService.CurrentAmbience;
ambience.ConversionFlags |= ConversionFlags.ShowReturnType;
ambience.ConversionFlags = ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames | ConversionFlags.ShowModifiers;
imageIndex = ClassBrowserIconService.GetIcon(field);
text = field.Name;
description = ambience.Convert(field);
@ -155,7 +155,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -155,7 +155,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
{
ambience = AmbienceService.CurrentAmbience;
ambience.ConversionFlags |= ConversionFlags.ShowReturnType;
ambience.ConversionFlags = ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames | ConversionFlags.ShowModifiers;
imageIndex = ClassBrowserIconService.GetIcon(property);
text = property.Name;
description = ambience.Convert(property);
@ -167,7 +167,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -167,7 +167,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
{
ambience = AmbienceService.CurrentAmbience;
ambience.ConversionFlags |= ConversionFlags.ShowReturnType;
ambience.ConversionFlags = ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames | ConversionFlags.ShowModifiers;
imageIndex = ClassBrowserIconService.GetIcon(e);
text = e.Name;
description = ambience.Convert(e);

14
src/Main/Base/Project/Src/TextEditor/Gui/Editor/QuickClassBrowserPanel.cs

@ -281,9 +281,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -281,9 +281,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
if (currentCompilationUnit != null) {
//// Alex: when changing between files in different compilation units whole process must be restarted
//// happens usually when files are opened from different project(s)
if (classComboBox.Items == null || classComboBox.Items.Count == 0) {
FillClassComboBox(false);
}
for (int i = 0; i < classComboBox.Items.Count; ++i) {
if (((ComboBoxItem)classComboBox.Items[i]).IsInside(textAreaControl.ActiveTextAreaControl.Caret.Line)) {
bool innerClassContainsCaret = false;
@ -391,10 +388,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -391,10 +388,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
membersComboBox.Items.AddRange(items.ToArray());
membersComboBox.EndUpdate();
UpdateMembersComboBox();
} else {
if (membersComboBox.Items.Count > 0) {
membersComboBox.Items.Clear();
}
}
}
@ -408,17 +401,20 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -408,17 +401,20 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
void FillClassComboBox(bool isUpdateRequired)
{
Console.WriteLine("FILL CLASS");
ArrayList items = new ArrayList();
AddClasses(items, currentCompilationUnit.Classes);
if (isUpdateRequired) {
classComboBox.BeginUpdate();
}
classComboBox.Items.Clear();
membersComboBox.Items.Clear();
classComboBox.Items.AddRange(items.ToArray());
if (items.Count == 1) {
try {
autoselect = false;
classComboBox.SelectedIndex = 0;
FillMembersComboBox();
} finally {
autoselect = true;
}
@ -487,9 +483,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -487,9 +483,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
void ComboBoxSelectedIndexChanged(object sender, System.EventArgs e)
{
ComboBox comboBox = (ComboBox)sender;
if (comboBox.SelectedIndex < 0) {
membersComboBox.Items.Clear();
} else if (autoselect) {
if (autoselect) {
ComboBoxItem item = (ComboBoxItem)comboBox.Items[comboBox.SelectedIndex];
if (item.IsInCurrentPart) {
textAreaControl.ActiveTextAreaControl.Caret.Position = new Point(item.Column, item.Line);

43
src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

@ -456,22 +456,33 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -456,22 +456,33 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
bm.RemoveMarks(new Predicate<Bookmark>(IsClassMemberBookmark));
if (parseInfo == null) return;
foreach (IClass c in parseInfo.MostRecentCompilationUnit.Classes) {
foreach (IMethod m in c.Methods) {
if (m.Region == null || m.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.MethodBookmark(textAreaControl.Document, m));
}
foreach (IProperty m in c.Properties) {
if (m.Region == null || m.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.PropertyBookmark(textAreaControl.Document, m));
}
foreach (IField f in c.Fields) {
if (f.Region == null || f.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.FieldBookmark(textAreaControl.Document, f));
}
foreach (IEvent e in c.Events) {
if (e.Region == null || e.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.EventBookmark(textAreaControl.Document, e));
}
AddClassMemberBookmarks(bm, c);
}
}
void AddClassMemberBookmarks(BookmarkManager bm, IClass c)
{
if (c.Region != null && c.Region.BeginLine > 0) {
bm.AddMark(new Bookmarks.ClassBookmark(textAreaControl.Document, c));
}
foreach (IClass innerClass in c.InnerClasses) {
AddClassMemberBookmarks(bm, innerClass);
}
foreach (IMethod m in c.Methods) {
if (m.Region == null || m.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.MethodBookmark(textAreaControl.Document, m));
}
foreach (IProperty m in c.Properties) {
if (m.Region == null || m.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.PropertyBookmark(textAreaControl.Document, m));
}
foreach (IField f in c.Fields) {
if (f.Region == null || f.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.FieldBookmark(textAreaControl.Document, f));
}
foreach (IEvent e in c.Events) {
if (e.Region == null || e.Region.BeginLine <= 0) continue;
bm.AddMark(new Bookmarks.EventBookmark(textAreaControl.Document, e));
}
}

6
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/SearchReplaceInFilesManager.cs

@ -57,15 +57,15 @@ namespace SearchAndReplace @@ -57,15 +57,15 @@ namespace SearchAndReplace
static void FinishSearchInFiles(List<SearchResult> results)
{
ShowSearchResults(results);
ShowSearchResults(SearchOptions.FindPattern, results);
}
public static void ShowSearchResults(List<SearchResult> results)
public static void ShowSearchResults(string pattern, List<SearchResult> results)
{
PadDescriptor searchResultPanel = WorkbenchSingleton.Workbench.GetPad(typeof(SearchResultPanel));
if (searchResultPanel != null) {
searchResultPanel.BringPadToFront();
SearchResultPanel.Instance.ShowSearchResults(SearchOptions.FindPattern, results);
SearchResultPanel.Instance.ShowSearchResults(pattern, results);
} else {
MessageService.ShowError("SearchResultPanel can't be created.");
}

12
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/Nodes/SearchRootNode.cs

@ -21,6 +21,7 @@ namespace SearchAndReplace @@ -21,6 +21,7 @@ namespace SearchAndReplace
{
List<SearchResult> results;
string pattern;
int fileCount;
public List<SearchResult> Results {
get {
@ -28,26 +29,27 @@ namespace SearchAndReplace @@ -28,26 +29,27 @@ namespace SearchAndReplace
}
}
public SearchRootNode(string pattern, List<SearchResult> results)
public SearchRootNode(string pattern, List<SearchResult> results, int fileCount)
{
drawDefault = false;
this.results = results;
this.pattern = pattern;
this.fileCount = fileCount;
Text = GetText();
}
string GetText()
{
if (results.Count == 1) {
if (Nodes.Count == 1) {
if (fileCount == 1) {
return "Occurrences of '" + pattern + "' (1 occurence in 1 file)";
} else {
return "Occurrences of '" + pattern + "' (1 occurence in " + Nodes.Count + " files)";
return "Occurrences of '" + pattern + "' (1 occurence in " + fileCount + " files)";
}
} else {
if (Nodes.Count == 1) {
if (fileCount == 1) {
return "Occurrences of '" + pattern + "' (" + results.Count + " occurences in 1 file)";
} else {
return "Occurrences of '" + pattern + "' (" + results.Count + " occurences in " + Nodes.Count + " files)";
return "Occurrences of '" + pattern + "' (" + results.Count + " occurences in " + fileCount + " files)";
}
}
}

4
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Pad/SearchResultPanel.cs

@ -104,7 +104,7 @@ namespace SearchAndReplace @@ -104,7 +104,7 @@ namespace SearchAndReplace
folderNodes[result.FileName].Results.Add(result);
}
SearchRootNode searchRootNode = new SearchRootNode(curPattern, curResults);
SearchRootNode searchRootNode = new SearchRootNode(curPattern, curResults, folderNodes.Count);
foreach (SearchFolderNode folderNode in folderNodes.Values) {
folderNode.SetText();
searchRootNode.Nodes.Add(folderNode);
@ -124,7 +124,7 @@ namespace SearchAndReplace @@ -124,7 +124,7 @@ namespace SearchAndReplace
folderNodes[result.FileName].Results.Add(result);
}
SearchRootNode searchRootNode = new SearchRootNode(curPattern, curResults);
SearchRootNode searchRootNode = new SearchRootNode(curPattern, curResults, folderNodes.Count);
foreach (SearchFolderNode folderNode in folderNodes.Values) {
folderNode.PerformInitialization();
foreach (SearchResultNode node in folderNode.Nodes) {

8
src/Main/Core/Project/Src/AddInTree/AddIn/Codon.cs

@ -120,16 +120,16 @@ namespace ICSharpCode.Core @@ -120,16 +120,16 @@ namespace ICSharpCode.Core
public object BuildItem(object owner, ArrayList subItems)
{
try {
IErbauer erbauer = AddInTree.Erbauer[Name];
if (!erbauer.HandleConditions && conditions.Length > 0) {
IDoozer doozer = AddInTree.Doozers[Name];
if (!doozer.HandleConditions && conditions.Length > 0) {
ConditionFailedAction action = GetFailedAction(owner);
if (action != ConditionFailedAction.Nothing) {
return null;
}
}
return erbauer.BuildItem(owner, this, subItems);
return doozer.BuildItem(owner, this, subItems);
} catch (KeyNotFoundException) {
throw new CoreException("Erbauer " + Name + " not found!");
throw new CoreException("Doozer " + Name + " not found!");
}
}

4
src/Main/Core/Project/Src/AddInTree/AddIn/Condition.cs

@ -58,9 +58,9 @@ namespace ICSharpCode.Core @@ -58,9 +58,9 @@ namespace ICSharpCode.Core
public bool IsValid(object caller)
{
try {
return AddInTree.Auswerter[name].IsValid(caller, this);
return AddInTree.ConditionEvaluators[name].IsValid(caller, this);
} catch (KeyNotFoundException) {
throw new CoreException("Auswerter " + name + " not found!");
throw new CoreException("Condition evaluator " + name + " not found!");
}
}

4
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/CompareConditionEvaluator.cs

@ -11,9 +11,9 @@ using System.Collections; @@ -11,9 +11,9 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// Condition evaluator that compares two strings.
/// </summary>
public class CompareAuswerter : IAuswerter
public class CompareConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

14
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/LazyConditionEvaluator.cs

@ -11,9 +11,9 @@ using System.Collections; @@ -11,9 +11,9 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// Condition evaluator that lazy-loads another condition evaluator and executes it.
/// </summary>
public class LazyLoadAuswerter : IAuswerter
public class LazyConditionEvaluator : IConditionEvaluator
{
AddIn addIn;
string name;
@ -31,7 +31,7 @@ namespace ICSharpCode.Core @@ -31,7 +31,7 @@ namespace ICSharpCode.Core
}
}
public LazyLoadAuswerter(AddIn addIn, Properties properties)
public LazyConditionEvaluator(AddIn addIn, Properties properties)
{
this.addIn = addIn;
this.name = properties["name"];
@ -40,14 +40,14 @@ namespace ICSharpCode.Core @@ -40,14 +40,14 @@ namespace ICSharpCode.Core
public bool IsValid(object caller, Condition condition)
{
IAuswerter auswerter = (IAuswerter)addIn.CreateObject(className);
AddInTree.Auswerter[name] = auswerter;
return auswerter.IsValid(caller, condition);
IConditionEvaluator evaluator = (IConditionEvaluator)addIn.CreateObject(className);
AddInTree.ConditionEvaluators[name] = evaluator;
return evaluator.IsValid(caller, condition);
}
public override string ToString()
{
return String.Format("[LazyLoadAuswerter: className = {0}, name = {1}]",
return String.Format("[LazyLoadConditionEvaluator: className = {0}, name = {1}]",
className,
name);
}

5
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultConditionEvaluators/OwnerStateConditionEvaluator.cs

@ -17,9 +17,10 @@ namespace ICSharpCode.Core @@ -17,9 +17,10 @@ namespace ICSharpCode.Core
}
/// <summary>
/// Description of ClassErbauer.
/// Condition evaluator that compares the state of the caller/owner with a specified value.
/// The caller/owner has to implement <see cref="IOwnerState"/>.
/// </summary>
public class OwnerStateAuswerter : IAuswerter
public class OwnerStateConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{

6
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ClassDoozer.cs

@ -11,12 +11,12 @@ using System.Collections; @@ -11,12 +11,12 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// Builds an object using Reflection. The class name is specified in the addin tree.
/// </summary>
public class ClassErbauer : IErbauer
public class ClassDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

7
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/FileFilterDoozer.cs

@ -10,13 +10,10 @@ using System.Collections; @@ -10,13 +10,10 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// </summary>
public class FileFilterErbauer : IErbauer
public class FileFilterDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

4
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/Icon/IconDoozer.cs

@ -12,10 +12,10 @@ using System.Windows.Forms; @@ -12,10 +12,10 @@ using System.Windows.Forms;
namespace ICSharpCode.Core
{
public class IconErbauer : IErbauer
public class IconDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

6
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/IncludeDoozer.cs

@ -13,10 +13,10 @@ namespace ICSharpCode.Core @@ -13,10 +13,10 @@ namespace ICSharpCode.Core
/// <summary>
/// Includes the content of one path into another path.
/// </summary>
public class IncludeErbauer : IErbauer
public class IncludeDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {
@ -36,7 +36,7 @@ namespace ICSharpCode.Core @@ -36,7 +36,7 @@ namespace ICSharpCode.Core
// include path (=multiple items)
return new IncludeReturnItem(caller, path);
} else {
Console.WriteLine("<Include> requires the attribute 'item' (to include one item) or the attribute 'path' (to include multiple items)");
MessageService.ShowMessage("<Include> requires the attribute 'item' (to include one item) or the attribute 'path' (to include multiple items)");
return null;
}
}

20
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/LazyDoozer.cs

@ -11,9 +11,9 @@ using System.Collections; @@ -11,9 +11,9 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// This doozer lazy-loads another doozer when it has to build an item.
/// </summary>
public class LazyLoadErbauer : IErbauer
public class LazyLoadDoozer : IDoozer
{
AddIn addIn;
string name;
@ -31,7 +31,7 @@ namespace ICSharpCode.Core @@ -31,7 +31,7 @@ namespace ICSharpCode.Core
}
}
public LazyLoadErbauer(AddIn addIn, Properties properties)
public LazyLoadDoozer(AddIn addIn, Properties properties)
{
this.addIn = addIn;
this.name = properties["name"];
@ -40,25 +40,27 @@ namespace ICSharpCode.Core @@ -40,25 +40,27 @@ namespace ICSharpCode.Core
}
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {
get {
return false;
IDoozer doozer = (IDoozer)addIn.CreateObject(className);
AddInTree.Doozers[name] = doozer;
return doozer.HandleConditions;
}
}
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
IErbauer erbauer = (IErbauer)addIn.CreateObject(className);
AddInTree.Erbauer[name] = erbauer;
return erbauer.BuildItem(caller, codon, subItems);
IDoozer doozer = (IDoozer)addIn.CreateObject(className);
AddInTree.Doozers[name] = doozer;
return doozer.BuildItem(caller, codon, subItems);
}
public override string ToString()
{
return String.Format("[LazyLoadErbauer: className = {0}, name = {1}]",
return String.Format("[LazyLoadDoozer: className = {0}, name = {1}]",
className,
name);
}

7
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/MenuItemDoozer.cs

@ -11,13 +11,10 @@ using System.Collections; @@ -11,13 +11,10 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// </summary>
public class MenuItemErbauer : IErbauer
public class MenuItemDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

7
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/ToolBarItemDoozer.cs

@ -11,13 +11,10 @@ using System.Collections; @@ -11,13 +11,10 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of ClassErbauer.
/// </summary>
public class ToolbarItemErbauer : IErbauer
public class ToolbarItemDoozer : IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
public bool HandleConditions {

8
src/Main/Core/Project/Src/AddInTree/AddIn/IBuildItemsModifier.cs

@ -11,13 +11,13 @@ using System.Collections; @@ -11,13 +11,13 @@ using System.Collections;
namespace ICSharpCode.Core
{
/// <summary>
/// When a <see cref="IErbauer">Erbauer</see> returns an object implementing
/// When a <see cref="IDoozer">doozer</see> returns an object implementing
/// this interface, the <see cref="Apply"/> method is called on the list of items
/// that has been built.
/// This interface can be used to support special <see cref="IErbauer">Erbauer</see>
/// This interface can be used to support special <see cref="IDoozer">doozers</see>
/// that do not simply build one item but want to modify the list of items built so far.
/// Example use is the IncludeErbauer which uses this interface to return multiple items
/// instead of one.
/// Example use is the <see cref="IncludeDoozer"/> which uses this interface to return
/// multiple items instead of one.
/// </summary>
public interface IBuildItemsModifier
{

4
src/Main/Core/Project/Src/AddInTree/AddIn/IConditionEvaluator.cs

@ -10,9 +10,9 @@ using System; @@ -10,9 +10,9 @@ using System;
namespace ICSharpCode.Core
{
/// <summary>
/// Description of Erbauer.
/// Interface for classes that can evaluate conditions defined in the addin tree.
/// </summary>
public interface IAuswerter
public interface IConditionEvaluator
{
bool IsValid(object caller, Condition condition);
}

8
src/Main/Core/Project/Src/AddInTree/AddIn/IDoozer.cs

@ -10,10 +10,14 @@ using System.Collections; @@ -10,10 +10,14 @@ using System.Collections;
namespace ICSharpCode.Core
{
public interface IErbauer
/// <summary>
/// Interface for classes that can build objects out of codons.
/// </summary>
/// <remarks>http://en.wikipedia.org/wiki/Fraggle_Rock#Doozers</remarks>
public interface IDoozer
{
/// <summary>
/// Gets if the erbauer handles codon conditions on its own.
/// Gets if the doozer handles codon conditions on its own.
/// If this property return false, the item is excluded when the condition is not met.
/// </summary>
bool HandleConditions { get; }

40
src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs

@ -18,8 +18,8 @@ namespace ICSharpCode.Core @@ -18,8 +18,8 @@ namespace ICSharpCode.Core
string hintPath;
string assembly;
Assembly loadedAssembly = null;
List<Properties> definedErbauer = new List<Properties>(1);
List<Properties> definedConditions = new List<Properties>(1);
List<Properties> definedDoozers = new List<Properties>(1);
List<Properties> definedConditionEvaluators = new List<Properties>(1);
public Runtime(string assembly, string hintPath)
{
@ -62,15 +62,15 @@ namespace ICSharpCode.Core @@ -62,15 +62,15 @@ namespace ICSharpCode.Core
}
}
public List<Properties> DefinedErbauer {
public List<Properties> DefinedDoozers {
get {
return definedErbauer;
return definedDoozers;
}
}
public List<Properties> DefinedConditions {
public List<Properties> DefinedConditionEvaluators {
get {
return definedConditions;
return definedConditionEvaluators;
}
}
@ -100,28 +100,28 @@ namespace ICSharpCode.Core @@ -100,28 +100,28 @@ namespace ICSharpCode.Core
string nodeName = reader.LocalName;
Properties properties = Properties.ReadFromAttributes(reader);
switch (nodeName) {
case "Erbauer":
case "Doozer":
if (!reader.IsEmptyElement) {
throw new AddInLoadException("Erbauer nodes must be empty!");
throw new AddInLoadException("Doozer nodes must be empty!");
}
LazyLoadErbauer lazyLoadErbauer = new LazyLoadErbauer(addIn, properties);
LazyLoadDoozer lazyLoadDoozer = new LazyLoadDoozer(addIn, properties);
if (AddInTree.Erbauer.ContainsKey(lazyLoadErbauer.Name)) {
throw new AddInLoadException("Duplicate erbauer: " + lazyLoadErbauer.Name);
if (AddInTree.Doozers.ContainsKey(lazyLoadDoozer.Name)) {
throw new AddInLoadException("Duplicate doozer: " + lazyLoadDoozer.Name);
}
AddInTree.Erbauer.Add(lazyLoadErbauer.Name, lazyLoadErbauer);
runtime.definedErbauer.Add(properties);
AddInTree.Doozers.Add(lazyLoadDoozer.Name, lazyLoadDoozer);
runtime.definedDoozers.Add(properties);
break;
case "Auswerter":
case "ConditionEvaluator":
if (!reader.IsEmptyElement) {
throw new AddInLoadException("Auswerter nodes must be empty!");
throw new AddInLoadException("ConditionEvaluator nodes must be empty!");
}
LazyLoadAuswerter lazyLoadAuswerter = new LazyLoadAuswerter(addIn, properties);
if (AddInTree.Auswerter.ContainsKey(lazyLoadAuswerter.Name)) {
throw new AddInLoadException("Duplicate auswerter: " + lazyLoadAuswerter.Name);
LazyConditionEvaluator lazyLoadConditionEvaluator = new LazyConditionEvaluator(addIn, properties);
if (AddInTree.ConditionEvaluators.ContainsKey(lazyLoadConditionEvaluator.Name)) {
throw new AddInLoadException("Duplicate condition evaluator: " + lazyLoadConditionEvaluator.Name);
}
AddInTree.Auswerter.Add(lazyLoadAuswerter.Name, lazyLoadAuswerter);
runtime.definedConditions.Add(properties);
AddInTree.ConditionEvaluators.Add(lazyLoadConditionEvaluator.Name, lazyLoadConditionEvaluator);
runtime.definedConditionEvaluators.Add(properties);
break;
default:
throw new AddInLoadException("Unknown node in Import section:" + nodeName);

28
src/Main/Core/Project/Src/AddInTree/AddInTree.cs

@ -23,22 +23,22 @@ namespace ICSharpCode.Core @@ -23,22 +23,22 @@ namespace ICSharpCode.Core
static List<AddIn> addIns = new List<AddIn>();
static AddInTreeNode rootNode = new AddInTreeNode();
static Dictionary<string, IErbauer> erbauer = new Dictionary<string, IErbauer>();
static Dictionary<string, IAuswerter> auswerter = new Dictionary<string, IAuswerter>();
static Dictionary<string, IDoozer> doozers = new Dictionary<string, IDoozer>();
static Dictionary<string, IConditionEvaluator> conditionEvaluators = new Dictionary<string, IConditionEvaluator>();
static AddInTree()
{
defaultCoreDirectory = FileUtility.Combine(FileUtility.SharpDevelopRootPath, "AddIns");
erbauer.Add("Class", new ClassErbauer());
erbauer.Add("FileFilter", new FileFilterErbauer());
erbauer.Add("Icon", new IconErbauer());
erbauer.Add("MenuItem", new MenuItemErbauer());
erbauer.Add("ToolbarItem", new ToolbarItemErbauer());
erbauer.Add("Include", new IncludeErbauer());
doozers.Add("Class", new ClassDoozer());
doozers.Add("FileFilter", new FileFilterDoozer());
doozers.Add("Icon", new IconDoozer());
doozers.Add("MenuItem", new MenuItemDoozer());
doozers.Add("ToolbarItem", new ToolbarItemDoozer());
doozers.Add("Include", new IncludeDoozer());
auswerter.Add("Compare", new CompareAuswerter());
auswerter.Add("Ownerstate", new OwnerStateAuswerter());
conditionEvaluators.Add("Compare", new CompareConditionEvaluator());
conditionEvaluators.Add("Ownerstate", new OwnerStateConditionEvaluator());
}
public static List<AddIn> AddIns {
@ -47,15 +47,15 @@ namespace ICSharpCode.Core @@ -47,15 +47,15 @@ namespace ICSharpCode.Core
}
}
public static Dictionary<string, IErbauer> Erbauer {
public static Dictionary<string, IDoozer> Doozers {
get {
return erbauer;
return doozers;
}
}
public static Dictionary<string, IAuswerter> Auswerter {
public static Dictionary<string, IConditionEvaluator> ConditionEvaluators {
get {
return auswerter;
return conditionEvaluators;
}
}

28
src/Main/Core/Test/AddInTreeTests/AddInTreeLoadingTests.cs

@ -78,29 +78,29 @@ namespace ICSharpCode.Core.Tests.AddInTreeTests.Tests @@ -78,29 +78,29 @@ namespace ICSharpCode.Core.Tests.AddInTreeTests.Tests
<AddIn>
<Runtime>
<Import assembly = '../bin/SharpDevelop.Base.dll'>
<Erbauer name='MyErbauer' class = 'ICSharpCode.Core.ClassErbauer'/>
<Auswerter name='MyCompare' class = 'ICSharpCode.Core.CompareCondition'/>
<Erbauer name='Test' class = 'ICSharpCode.Core.ClassErbauer2'/>
<Auswerter name='Condition2' class = 'Condition2Class'/>
<Doozer name='MyDoozer' class = 'ICSharpCode.Core.ClassDoozer'/>
<ConditionEvaluator name='MyCompare' class = 'ICSharpCode.Core.CompareCondition'/>
<Doozer name='Test' class = 'ICSharpCode.Core.ClassDoozer2'/>
<ConditionEvaluator name='Condition2' class = 'Condition2Class'/>
</Import>
</Runtime>
</AddIn>";
AddIn addIn = AddIn.Load(new StringReader(addInText));
Assert.AreEqual(1, addIn.Runtimes.Count);
Assert.AreEqual(addIn.Runtimes[0].Assembly, "../bin/SharpDevelop.Base.dll");
Assert.AreEqual(addIn.Runtimes[0].DefinedErbauer.Count, 2);
Assert.AreEqual(addIn.Runtimes[0].DefinedErbauer[0]["name"], "MyErbauer");
Assert.AreEqual(addIn.Runtimes[0].DefinedErbauer[0]["class"], "ICSharpCode.Core.ClassErbauer");
Assert.AreEqual(addIn.Runtimes[0].DefinedDoozers.Count, 2);
Assert.AreEqual(addIn.Runtimes[0].DefinedDoozers[0]["name"], "MyDoozer");
Assert.AreEqual(addIn.Runtimes[0].DefinedDoozers[0]["class"], "ICSharpCode.Core.ClassDoozer");
Assert.AreEqual(addIn.Runtimes[0].DefinedErbauer[1]["name"], "Test");
Assert.AreEqual(addIn.Runtimes[0].DefinedErbauer[1]["class"], "ICSharpCode.Core.ClassErbauer2");
Assert.AreEqual(addIn.Runtimes[0].DefinedDoozers[1]["name"], "Test");
Assert.AreEqual(addIn.Runtimes[0].DefinedDoozers[1]["class"], "ICSharpCode.Core.ClassDoozer2");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditions.Count, 2);
Assert.AreEqual(addIn.Runtimes[0].DefinedConditions[0]["name"], "MyCompare");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditions[0]["class"], "ICSharpCode.Core.CompareCondition");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditionEvaluators.Count, 2);
Assert.AreEqual(addIn.Runtimes[0].DefinedConditionEvaluators[0]["name"], "MyCompare");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditionEvaluators[0]["class"], "ICSharpCode.Core.CompareCondition");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditions[1]["name"], "Condition2");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditions[1]["class"], "Condition2Class");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditionEvaluators[1]["name"], "Condition2");
Assert.AreEqual(addIn.Runtimes[0].DefinedConditionEvaluators[1]["class"], "Condition2Class");
}
#endregion

40
src/Main/StartUp/Project/SharpDevelopMain.cs

@ -145,27 +145,27 @@ namespace ICSharpCode.SharpDevelop @@ -145,27 +145,27 @@ namespace ICSharpCode.SharpDevelop
// string [] addInDirs = ICSharpCode.SharpDevelop.AddInSettingsHandler.GetAddInDirectories(out ignoreDefaultPath);
// SetAddInDirectories(addInDirs, ignoreDefaultPath);
AddInTree.Auswerter.Add("ActiveContentExtension", new ActiveContentExtensionAuswerter());
AddInTree.Auswerter.Add("ActiveViewContentUntitled", new ActiveViewContentUntitledAuswerter());
AddInTree.Auswerter.Add("ActiveWindowState", new ActiveWindowStateAuswerter());
AddInTree.Auswerter.Add("CombineOpen", new CombineOpenAuswerter());
AddInTree.Auswerter.Add("DebuggerSupports", new DebuggerSupportsAuswerter());
AddInTree.Auswerter.Add("IsProcessRunning", new IsProcessRunningAuswerter());
AddInTree.Auswerter.Add("OpenWindowState", new OpenWindowStateAuswerter());
AddInTree.Auswerter.Add("WindowActive", new WindowActiveAuswerter());
AddInTree.Auswerter.Add("WindowOpen", new WindowOpenAuswerter());
AddInTree.Auswerter.Add("ProjectActive", new ProjectActiveAuswerter());
AddInTree.Auswerter.Add("ProjectOpen", new ProjectOpenAuswerter());
AddInTree.Auswerter.Add("TextContent", new ICSharpCode.SharpDevelop.DefaultEditor.Conditions.TextContentAuswerter());
AddInTree.ConditionEvaluators.Add("ActiveContentExtension", new ActiveContentExtensionConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ActiveViewContentUntitled", new ActiveViewContentUntitledConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ActiveWindowState", new ActiveWindowStateConditionEvaluator());
AddInTree.ConditionEvaluators.Add("CombineOpen", new CombineOpenConditionEvaluator());
AddInTree.ConditionEvaluators.Add("DebuggerSupports", new DebuggerSupportsConditionEvaluator());
AddInTree.ConditionEvaluators.Add("IsProcessRunning", new IsProcessRunningConditionEvaluator());
AddInTree.ConditionEvaluators.Add("OpenWindowState", new OpenWindowStateConditionEvaluator());
AddInTree.ConditionEvaluators.Add("WindowActive", new WindowActiveConditionEvaluator());
AddInTree.ConditionEvaluators.Add("WindowOpen", new WindowOpenConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ProjectActive", new ProjectActiveConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ProjectOpen", new ProjectOpenConditionEvaluator());
AddInTree.ConditionEvaluators.Add("TextContent", new ICSharpCode.SharpDevelop.DefaultEditor.Conditions.TextContentConditionEvaluator());
AddInTree.Erbauer.Add("DialogPanel", new DialogPanelErbauer());
AddInTree.Erbauer.Add("DisplayBinding", new DisplayBindingErbauer());
AddInTree.Erbauer.Add("Pad", new PadErbauer());
AddInTree.Erbauer.Add("LanguageBinding", new LanguageBindingErbauer());
AddInTree.Erbauer.Add("Parser", new ParserErbauer());
AddInTree.Erbauer.Add("EditAction", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.EditActionErbauer());
AddInTree.Erbauer.Add("SyntaxMode", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.SyntaxModeErbauer());
AddInTree.Erbauer.Add("BrowserSchemeExtension", new ICSharpCode.SharpDevelop.BrowserDisplayBinding.SchemeExtensionErbauer());
AddInTree.Doozers.Add("DialogPanel", new DialogPanelDoozer());
AddInTree.Doozers.Add("DisplayBinding", new DisplayBindingDoozer());
AddInTree.Doozers.Add("Pad", new PadDoozer());
AddInTree.Doozers.Add("LanguageBinding", new LanguageBindingDoozer());
AddInTree.Doozers.Add("Parser", new ParserDoozer());
AddInTree.Doozers.Add("EditAction", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.EditActionDoozer());
AddInTree.Doozers.Add("SyntaxMode", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.SyntaxModeDoozer());
AddInTree.Doozers.Add("BrowserSchemeExtension", new ICSharpCode.SharpDevelop.BrowserDisplayBinding.SchemeExtensionDoozer());
PropertyService.Load();

Loading…
Cancel
Save