Browse Source

Improved lazy-loading.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@321 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
465e919934
  1. 105
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 9
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  3. 7
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs
  4. 10
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/VBNetCompletionBinding.cs
  5. 3
      src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin
  6. 8
      src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin
  7. 92
      src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin
  8. 2
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlSchemaAssociation.cs
  9. 6
      src/AddIns/Misc/AddinScout/Project/AddInScout.addin
  10. 6
      src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin
  11. 1
      src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin
  12. 2
      src/Libraries/ICSharpCode.TextEditor/Project/Resources/SyntaxModes.xml
  13. 2
      src/Libraries/ICSharpCode.TextEditor/Project/Resources/XML-Mode.xshd
  14. 6
      src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/BrowserDisplayBinding.cs
  15. 34
      src/Main/Base/Project/Src/Services/DisplayBinding/DisplayBindingDescriptor.cs
  16. 4
      src/Main/Base/Project/Src/Services/DisplayBinding/DisplayBindingService.cs
  17. 8
      src/Main/Base/Project/Src/Services/File/FileService.cs
  18. 50
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CodeCompletionBinding.cs
  19. 8
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/Gui/ToolBarCommand.cs
  20. 1
      src/Main/StartUp/Project/SharpDevelopMain.cs

105
AddIns/ICSharpCode.SharpDevelop.addin

@ -6,8 +6,8 @@
version = "1.0.0"> version = "1.0.0">
<Runtime> <Runtime>
<Import assembly="../bin/ICSharpCode.SharpDevelop.dll"/> <Import assembly="/ICSharpCode.SharpDevelop"/>
<Import assembly="../bin/ICSharpCode.TextEditor.dll"/> <Import assembly="/ICSharpCode.TextEditor"/>
</Runtime> </Runtime>
<Path name = "/SharpDevelop/Workbench/Ambiences"> <Path name = "/SharpDevelop/Workbench/Ambiences">
@ -281,7 +281,7 @@
label = "Clea&amp;n" label = "Clea&amp;n"
class = "ICSharpCode.SharpDevelop.Project.Commands.CleanProject"/> class = "ICSharpCode.SharpDevelop.Project.Commands.CleanProject"/>
<MenuItem id = "Publish project" <MenuItem id = "Publish project"
label = "Publis ${CurrentProjectName}h" label = "Publish ${CurrentProjectName}"
class = "ICSharpCode.SharpDevelop.Project.Commands.PublishProject"/> class = "ICSharpCode.SharpDevelop.Project.Commands.PublishProject"/>
<MenuItem id = "CombineBuildGroupSeparator" type = "Separator"/> <MenuItem id = "CombineBuildGroupSeparator" type = "Separator"/>
@ -703,8 +703,7 @@
<And> <And>
<Or> <Or>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/> <Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.CSharpDesignerDisplayBindingWrapper"/> <Condition name = "WindowActive" activewindow="ICSharpCode.FormDesigner.FormDesignerViewContent"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.VBNetDesignerDisplayBindingWrapper"/>
</Or> </Or>
<Condition name = "ActiveViewContentUntitled" activewindowuntitled="False"/> <Condition name = "ActiveViewContentUntitled" activewindowuntitled="False"/>
</And> </And>
@ -1125,7 +1124,7 @@
class = "ICSharpCode.SharpDevelop.Commands.ToggleFullscreenCommand" /> class = "ICSharpCode.SharpDevelop.Commands.ToggleFullscreenCommand" />
</MenuItem> <!-- end VIEW menu --> </MenuItem> <!-- end VIEW menu -->
<Condition name = "CombineOpen" iscombineopen="True"> <Condition name = "ProjectActive" activeproject="*">
<MenuItem id = "Project" label = "${res:XML.MainMenu.ProjectMenu}" type="Menu"> <MenuItem id = "Project" label = "${res:XML.MainMenu.ProjectMenu}" type="Menu">
<MenuItem id = "AddReference" <MenuItem id = "AddReference"
label = "${res:ProjectComponent.ContextMenu.AddReference}" label = "${res:ProjectComponent.ContextMenu.AddReference}"
@ -1133,7 +1132,9 @@
<MenuItem id = "SetAsStartupProject" <MenuItem id = "SetAsStartupProject"
label = "${res:ProjectComponent.ContextMenu.SetAsStartupProject}" label = "${res:ProjectComponent.ContextMenu.SetAsStartupProject}"
class = "ICSharpCode.SharpDevelop.Project.Commands.SetAsStartupProject"/> class = "ICSharpCode.SharpDevelop.Project.Commands.SetAsStartupProject"/>
<MenuItem id = "ExportToHtml"
label = "${res:ProjectComponent.ContextMenu.HtmlExport}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ExportProjectToHtml"/>
<MenuItem id = "Separator2" type = "Separator" /> <MenuItem id = "Separator2" type = "Separator" />
<MenuItem id = "Options" <MenuItem id = "Options"
label = "${res:XML.MainMenu.ProjectMenu.Options}" label = "${res:XML.MainMenu.ProjectMenu.Options}"
@ -1147,8 +1148,7 @@
<And> <And>
<Or> <Or>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/> <Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.CSharpDesignerDisplayBindingWrapper"/> <Condition name = "WindowActive" activewindow="ICSharpCode.FormDesigner.FormDesignerViewContent"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.VBNetDesignerDisplayBindingWrapper"/>
</Or> </Or>
<Condition name = "ActiveViewContentUntitled" activewindowuntitled="False"/> <Condition name = "ActiveViewContentUntitled" activewindowuntitled="False"/>
</And> </And>
@ -1193,8 +1193,7 @@
<And> <And>
<Or> <Or>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/> <Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.CSharpDesignerDisplayBindingWrapper"/> <Condition name = "WindowActive" activewindow="ICSharpCode.FormDesigner.FormDesignerViewContent"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.VBNetDesignerDisplayBindingWrapper"/>
</Or> </Or>
<Condition name = "ActiveViewContentUntitled" activewindowuntitled="False"/> <Condition name = "ActiveViewContentUntitled" activewindowuntitled="False"/>
</And> </And>
@ -1274,13 +1273,12 @@
<MenuItem id = "Tools" label = "${res:XML.MainMenu.ToolMenu}" type="Menu"> <MenuItem id = "Tools" label = "${res:XML.MainMenu.ToolMenu}" type="Menu">
<MenuItem id = "ToolBuilder" type="Builder" class = "ICSharpCode.SharpDevelop.Commands.ToolMenuBuilder" /> <MenuItem id = "ToolBuilder" type="Builder" class = "ICSharpCode.SharpDevelop.Commands.ToolMenuBuilder" />
<MenuItem id = "Separator1" type = "Separator" /> <MenuItem id = "Separator1" type = "Separator" />
<MenuItem id = "Separator2" type = "Separator" />
<MenuItem id = "Separator4" type = "Separator" />
<ComplexCondition action = "Disable"> <ComplexCondition action = "Disable">
<Or> <Or>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.FormDesignerDisplayBindingWrapper"/> <Condition name = "WindowActive" activewindow="ICSharpCode.FormDesigner.FormDesignerViewContent"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.FormDesigner.CSharpDesignerDisplayBindingWrapper"/> <Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider"/>
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.TextEditorDisplayBindingWrapper"/>
</Or> </Or>
<Condition name="ActiveContentExtension" activeextension=".cs" action = "Disable"> <Condition name="ActiveContentExtension" activeextension=".cs" action = "Disable">
<MenuItem id = "ConvertBuffer" <MenuItem id = "ConvertBuffer"
@ -1293,7 +1291,30 @@
class = "ICSharpCode.SharpDevelop.Commands.CSharpConvertBuffer"/> class = "ICSharpCode.SharpDevelop.Commands.CSharpConvertBuffer"/>
</Condition> </Condition>
</ComplexCondition> </ComplexCondition>
<MenuItem id = "Separator5" type = "Separator" />
<MenuItem id = "Separator3" type = "Separator" />
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
<MenuItem id = "InsertColor"
label = "${res:XML.MainMenu.ToolMenu.InsColor}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ShowColorDialog"/>
<MenuItem id = "InsertGuid"
shortcut = "Control|Shift|G"
label = "${res:XML.MainMenu.ToolMenu.InsGUID}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.InsertGuidCommand"/>
<MenuItem id = "Separator4" type = "Separator" />
<MenuItem id = "GenerateCodeAction"
label = "${res:XML.MainMenu.ToolMenu.GenerateCode}"
shortcut = "Alt|Insert"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.GenerateCodeAction"/>
<MenuItem id = "ShowQuickHelp"
label = "${res:XML.MainMenu.ToolMenu.QuickXmlDoc}"
shortcut = "Control|Q"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.QuickDocumentation"/>
</Condition>
<MenuItem id = "LastSeparator" type = "Separator" />
<MenuItem id = "Options" <MenuItem id = "Options"
label = "${res:XML.MainMenu.ToolMenu.Options}" label = "${res:XML.MainMenu.ToolMenu.Options}"
@ -1331,7 +1352,7 @@
<MenuItem id = "Help" <MenuItem id = "Help"
label = "${res:XML.MainMenu.HelpMenu.Topics}" label = "${res:XML.MainMenu.HelpMenu.Topics}"
shortcut = "Alt|F1" shortcut = "Alt|F1"
class = "ICSharpCode.SharpDevelop.Commands.ShowHelp"/> link = "browser://ms-help://corsavy/"/>
<MenuItem id = "TipOfTheDay" <MenuItem id = "TipOfTheDay"
label = "${res:XML.MainMenu.HelpMenu.Tips}" label = "${res:XML.MainMenu.HelpMenu.Tips}"
icon = "Icons.16x16.TipOfTheDay" icon = "Icons.16x16.TipOfTheDay"
@ -1394,32 +1415,10 @@
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.CodeTemplatePanel"/> class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.CodeTemplatePanel"/>
</Path> </Path>
<Path name = "/SharpDevelop/Views/ProjectBrowser/ContextMenu">
<!-- AddIn to the Project Add Menu -->
<Condition name = "Ownerstate" ownerstate="ProjectSelected">
<MenuItem id = "ExportToHtml"
insertafter = "GenerateDocumentation"
insertbefore = "Separator5"
label = "${res:ProjectComponent.ContextMenu.HtmlExport}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ExportProjectToHtml"/>
</Condition>
</Path>
<Path name = "/AddIns/DefaultTextEditor/Formatter/XML"> <Path name = "/AddIns/DefaultTextEditor/Formatter/XML">
<Class id ="XmlFormatter" class = "ICSharpCode.SharpDevelop.DefaultEditor.XmlFormattingStrategy"/> <Class id ="XmlFormatter" class = "ICSharpCode.SharpDevelop.DefaultEditor.XmlFormattingStrategy"/>
</Path> </Path>
<Path name = "/SharpDevelop/Workbench/MainMenu/Project">
<!-- AddIn to the Project Add Menu -->
<Condition name = "ProjectActive" activeproject="*">
<MenuItem id = "ExportToHtml"
insertafter = "GenerateDocumentation"
insertbefore = "Separator2"
label = "${res:ProjectComponent.ContextMenu.HtmlExport}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ExportProjectToHtml"/>
</Condition>
</Path>
<Path name = "/SharpDevelop/Views/ProjectBrowser/ContextMenu/ProjectBrowserNode"> <Path name = "/SharpDevelop/Views/ProjectBrowser/ContextMenu/ProjectBrowserNode">
<!-- AddIn to the project browser context menu --> <!-- AddIn to the project browser context menu -->
<Condition name = "ProjectActive" activeproject="*"> <Condition name = "ProjectActive" activeproject="*">
@ -1751,34 +1750,6 @@
</DialogPanel> </DialogPanel>
</Path> </Path>
<Path name = "/SharpDevelop/Workbench/MainMenu/Tools">
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
<MenuItem id = "InsertColor"
insertafter = "Separator1" insertbefore = "InsertGuid"
label = "${res:XML.MainMenu.ToolMenu.InsColor}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.ShowColorDialog"/>
<MenuItem id = "InsertGuid"
insertafter = "InsertColor"
insertbefore = "Separator2"
shortcut = "Control|Shift|G"
label = "${res:XML.MainMenu.ToolMenu.InsGUID}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.InsertGuidCommand"/>
<MenuItem id = "Separator2" type = "Separator" />
<MenuItem id = "GenerateCodeAction"
insertafter = "Separator2"
label = "${res:XML.MainMenu.ToolMenu.GenerateCode}"
shortcut = "Alt|Insert"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.GenerateCodeAction"/>
<MenuItem id = "ShowQuickHelp"
insertafter = "GenerateCodeAction"
insertbefore = "Separator5"
label = "${res:XML.MainMenu.ToolMenu.QuickXmlDoc}"
shortcut = "Control|Q"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.QuickDocumentation"/>
</Condition>
</Path>
<Path name = "/SharpDevelop/DefaultEditor/SearchAndReplace/WildcardHelpPath"> <Path name = "/SharpDevelop/DefaultEditor/SearchAndReplace/WildcardHelpPath">
<MenuItem id = "*Char" <MenuItem id = "*Char"
label = "* Zero or more of any character" /> label = "* Zero or more of any character" />

9
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin

@ -24,14 +24,13 @@
<Path name = "/Workspace/Parser"> <Path name = "/Workspace/Parser">
<Parser id = "C#" <Parser id = "C#"
supportedextensions = ".cs" supportedextensions = ".cs"
projectfileextension = ".csproj" projectfileextension = ".csproj"
class = "CSharpBinding.Parser.TParser"/> class = "CSharpBinding.Parser.TParser"/>
</Path> </Path>
<Path name = "/AddIns/DefaultTextEditor/CodeCompletion"> <Path name = "/AddIns/DefaultTextEditor/CodeCompletion">
<Class id = "CSharpCompletionBinding" <CodeCompletionBinding id = "CSharp" extensions = ".cs" class = "CSharpBinding.CSharpCompletionBinding"/>
class = "CSharpBinding.CSharpCompletionBinding"/>
</Path> </Path>
<Path path = "/SharpDevelop/BackendBindings/ProjectOptions/C#"> <Path path = "/SharpDevelop/BackendBindings/ProjectOptions/C#">

7
src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs

@ -20,15 +20,8 @@ namespace CSharpBinding
{ {
public class CSharpCompletionBinding : DefaultCodeCompletionBinding public class CSharpCompletionBinding : DefaultCodeCompletionBinding
{ {
public CSharpCompletionBinding() : base(".cs")
{
this.EnableXmlCommentCompletion = true;
}
public override bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch) public override bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch)
{ {
if (!CheckExtension(editor))
return false;
Parser.ExpressionFinder ef = new Parser.ExpressionFinder(editor.FileName); Parser.ExpressionFinder ef = new Parser.ExpressionFinder(editor.FileName);
int cursor = editor.ActiveTextAreaControl.Caret.Offset; int cursor = editor.ActiveTextAreaControl.Caret.Offset;
ExpressionContext context = null; ExpressionContext context = null;

10
src/AddIns/BackendBindings/VBNetBinding/Project/Src/VBNetCompletionBinding.cs

@ -21,18 +21,8 @@ namespace VBNetBinding
{ {
public class VBNetCompletionBinding : DefaultCodeCompletionBinding public class VBNetCompletionBinding : DefaultCodeCompletionBinding
{ {
public VBNetCompletionBinding() : base(".vb")
{
this.EnableXmlCommentCompletion = true;
}
public override bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch) public override bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch)
{ {
if (!CheckExtension(editor))
{
return false;
}
VBNetBinding.Parser.ExpressionFinder ef = new VBNetBinding.Parser.ExpressionFinder(); VBNetBinding.Parser.ExpressionFinder ef = new VBNetBinding.Parser.ExpressionFinder();
int cursor = editor.ActiveTextAreaControl.Caret.Offset; int cursor = editor.ActiveTextAreaControl.Caret.Offset;
ExpressionContext context = null; ExpressionContext context = null;

3
src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin

@ -54,8 +54,7 @@
</Path> </Path>
<Path name = "/AddIns/DefaultTextEditor/CodeCompletion"> <Path name = "/AddIns/DefaultTextEditor/CodeCompletion">
<Class id = "VBNetCompletionBinding" <CodeCompletionBinding id = "VBNet" extensions = ".vb" class = "VBNetBinding.VBNetCompletionBinding"/>
class = "VBNetBinding.VBNetCompletionBinding"/>
</Path> </Path>
<Path name = "/AddIns/DefaultTextEditor/Formatter/VBNET"> <Path name = "/AddIns/DefaultTextEditor/Formatter/VBNET">

8
src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin

@ -12,7 +12,6 @@
<Path name = "/SharpDevelop/Workbench/DisplayBindings"> <Path name = "/SharpDevelop/Workbench/DisplayBindings">
<DisplayBinding id = "FormDesigner" <DisplayBinding id = "FormDesigner"
type = "Secondary" type = "Secondary"
insertbefore = "Browser,Text"
supportedformats = "Forms/UserControls" supportedformats = "Forms/UserControls"
class = "ICSharpCode.FormDesigner.FormDesignerSecondaryDisplayBinding" /> class = "ICSharpCode.FormDesigner.FormDesignerSecondaryDisplayBinding" />
</Path> </Path>
@ -150,10 +149,7 @@
</Path> </Path>
<Path name = "/SharpDevelop/Workbench/MainMenu"> <Path name = "/SharpDevelop/Workbench/MainMenu">
<ComplexCondition> <Condition name = "WindowActive" activewindow="ICSharpCode.FormDesigner.FormDesignerViewContent">
<Or>
<Condition name = "WindowActive" activewindow="ICSharpCode.FormDesigner.FormDesignerViewContent"/>
</Or>
<MenuItem id = "Format" <MenuItem id = "Format"
label = "${res:XML.MainMenu.FormatMenu}" label = "${res:XML.MainMenu.FormatMenu}"
insertafter = "Debug" insertafter = "Debug"
@ -282,7 +278,7 @@
icon = "Icons.16x16.FormsDesigner.LockControls" icon = "Icons.16x16.FormsDesigner.LockControls"
class = "ICSharpCode.FormDesigner.Commands.LockControls"/> class = "ICSharpCode.FormDesigner.Commands.LockControls"/>
</MenuItem> </MenuItem>
</ComplexCondition> </Condition>
</Path> </Path>
<Path name = "/SharpDevelop/Workbench/SharpDevelopSideBar/ContextMenu"> <Path name = "/SharpDevelop/Workbench/SharpDevelopSideBar/ContextMenu">

92
src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin

@ -10,61 +10,63 @@
</Runtime> </Runtime>
<Path name = "/SharpDevelop/Workbench/DisplayBindings"> <Path name = "/SharpDevelop/Workbench/DisplayBindings">
<DisplayBinding id = "ResourceEditor" <DisplayBinding id = "ResourceEditor"
insertbefore = "Text" class = "ResourceEditor.ResourceEditorDisplayBinding"
class = "ResourceEditor.ResourceEditorDisplayBinding" /> insertbefore = "Text"
fileNamePattern = "\.res(x|ources)$"
languagePattern = "^ResourceFiles$"/>
</Path> </Path>
<Path name="/SharpDevelop/ResourceEdtior/ResourceList/ContextMenu"> <Path name="/SharpDevelop/ResourceEdtior/ResourceList/ContextMenu">
<MenuItem id="AddStringEntry" <MenuItem id="AddStringEntry"
label="${res:ResourceEditor.ResourceEdit.ContextMenu.AddStringEntry}" label="${res:ResourceEditor.ResourceEdit.ContextMenu.AddStringEntry}"
class="ResourceEditor.AddStringCommand" class="ResourceEditor.AddStringCommand"
shortcut = "Ins" /> shortcut = "Ins" />
<MenuItem id="AddFile" <MenuItem id="AddFile"
label="${res:ResourceEditor.ResourceEdit.ContextMenu.AddFiles}" label="${res:ResourceEditor.ResourceEdit.ContextMenu.AddFiles}"
class="ResourceEditor.AddNewFileCommand" /> class="ResourceEditor.AddNewFileCommand" />
<MenuItem id="Separator1" <MenuItem id="Separator1"
type = "Separator" /> type = "Separator" />
<Condition name = "Ownerstate" ownerstate="ItemsSelected" action="Disable"> <Condition name = "Ownerstate" ownerstate="ItemsSelected" action="Disable">
<MenuItem id="SaveAs" <MenuItem id="SaveAs"
label="${res:XML.MainMenu.FileMenu.SaveAs}" label="${res:XML.MainMenu.FileMenu.SaveAs}"
class="ResourceEditor.SaveEntryAsCommand" /> class="ResourceEditor.SaveEntryAsCommand" />
<MenuItem id="Rename" <MenuItem id="Rename"
label="${res:ResourceEditor.ResourceEdit.ContextMenu.Rename}" label="${res:ResourceEditor.ResourceEdit.ContextMenu.Rename}"
class="ResourceEditor.RenameEntryCommand" class="ResourceEditor.RenameEntryCommand"
shortcut="F2" /> shortcut="F2" />
<MenuItem id="CopyResourceName" <MenuItem id="CopyResourceName"
label="${res:ResourceEditor.ResourceEdit.ContextMenu.CopyResourceName}" label="${res:ResourceEditor.ResourceEdit.ContextMenu.CopyResourceName}"
class="ResourceEditor.CopyResourceNameCommand" /> class="ResourceEditor.CopyResourceNameCommand" />
<MenuItem id="Delete" <MenuItem id="Delete"
label="${res:ResourceEditor.ResourceEdit.ContextMenu.Delete}" label="${res:ResourceEditor.ResourceEdit.ContextMenu.Delete}"
class="ResourceEditor.DeleteEntryCommand" class="ResourceEditor.DeleteEntryCommand"
shortcut="Del" /> shortcut="Del" />
<MenuItem id="Separator2" <MenuItem id="Separator2"
type = "Separator" /> type = "Separator" />
<MenuItem id="Cut" <MenuItem id="Cut"
label="${res:XML.MainMenu.EditMenu.Cut}" label="${res:XML.MainMenu.EditMenu.Cut}"
class="ICSharpCode.SharpDevelop.Commands.Cut" /> class="ICSharpCode.SharpDevelop.Commands.Cut" />
<MenuItem id="Copy" <MenuItem id="Copy"
label="${res:XML.MainMenu.EditMenu.Copy}" label="${res:XML.MainMenu.EditMenu.Copy}"
class="ICSharpCode.SharpDevelop.Commands.Copy" /> class="ICSharpCode.SharpDevelop.Commands.Copy" />
</Condition> </Condition>
<MenuItem id="Paste" <MenuItem id="Paste"
label="${res:XML.MainMenu.EditMenu.Paste}" label="${res:XML.MainMenu.EditMenu.Paste}"
class="ICSharpCode.SharpDevelop.Commands.Paste" /> class="ICSharpCode.SharpDevelop.Commands.Paste" />
<MenuItem id="Separator3" <MenuItem id="Separator3"
type = "Separator" /> type = "Separator" />
<MenuItem id="SelectAll" <MenuItem id="SelectAll"
label="${res:XML.MainMenu.EditMenu.SelectAll}" label="${res:XML.MainMenu.EditMenu.SelectAll}"
class="ICSharpCode.SharpDevelop.Commands.SelectAll" class="ICSharpCode.SharpDevelop.Commands.SelectAll"
shortcut="Ctrl|A" /> shortcut="Ctrl|A" />
</Path> </Path>
</AddIn> </AddIn>

2
src/AddIns/DisplayBindings/XmlEditor/Project/XmlSchemaAssociation.cs

@ -20,8 +20,6 @@ namespace ICSharpCode.XmlEditor
string extension = String.Empty; string extension = String.Empty;
string namespacePrefix = String.Empty; string namespacePrefix = String.Empty;
static readonly string schemaAssociationElementName = "SchemaAssociation";
public XmlSchemaAssociation(string extension) public XmlSchemaAssociation(string extension)
: this(extension, String.Empty, String.Empty) : this(extension, String.Empty, String.Empty)
{ {

6
src/AddIns/Misc/AddinScout/Project/AddInScout.addin

@ -12,9 +12,9 @@
<Path name = "/SharpDevelop/Workbench/MainMenu/Tools"> <Path name = "/SharpDevelop/Workbench/MainMenu/Tools">
<MenuItem id = "ShowAddInScout" <MenuItem id = "ShowAddInScout"
insertafter = "Separator3" insertbefore = "Separator4" insertafter = "Separator1" insertbefore = "Separator2"
label = "AddIn Scout" label = "AddIn Scout"
class = "AddInScout.AddInScoutCommand"/> class = "AddInScout.AddInScoutCommand"/>
</Path> </Path>

6
src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin

@ -11,9 +11,9 @@
<Path name = "/SharpDevelop/Workbench/MainMenu/Tools"> <Path name = "/SharpDevelop/Workbench/MainMenu/Tools">
<MenuItem id = "RegExpTk" <MenuItem id = "RegExpTk"
insertafter = "ShowObjectBrowser" insertbefore = "Separator4" insertafter = "Separator1" insertbefore = "Separator2"
label = "${res:XML.MainMenu.ToolsMenu.RegularExpressionToolkit}" label = "${res:XML.MainMenu.ToolsMenu.RegularExpressionToolkit}"
class = "Plugins.RegExpTk.RegExpTkCommand" class = "Plugins.RegExpTk.RegExpTkCommand"
/> />
</Path> </Path>
</AddIn> </AddIn>

1
src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin

@ -11,7 +11,6 @@
<Path name = "/Workspace/Autostart"> <Path name = "/Workspace/Autostart">
<Class id = "ICSharpCode.Svn.Commands.RegisterEventsCommand" <Class id = "ICSharpCode.Svn.Commands.RegisterEventsCommand"
insertbefore = "StartWorkbenchCommand"
class = "ICSharpCode.Svn.Commands.RegisterEventsCommand"/> class = "ICSharpCode.Svn.Commands.RegisterEventsCommand"/>
</Path> </Path>

2
src/Libraries/ICSharpCode.TextEditor/Project/Resources/SyntaxModes.xml

@ -45,5 +45,5 @@
<Mode file = "XML-Mode.xshd" <Mode file = "XML-Mode.xshd"
name = "XML" name = "XML"
extensions = ".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs"/> extensions = ".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.build;.xfrm"/>
</SyntaxModes> </SyntaxModes>

2
src/Libraries/ICSharpCode.TextEditor/Project/Resources/XML-Mode.xshd

@ -1,6 +1,6 @@
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- syntaxdefinition for XML 2000 by Mike Krueger --> <!-- syntaxdefinition for XML 2000 by Mike Krueger -->
<SyntaxDefinition name="XML" extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs"> <SyntaxDefinition name="XML" extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.build;.xfrm">
<Digits name="Digits" bold="false" italic="false" color="DarkBlue" /> <Digits name="Digits" bold="false" italic="false" color="DarkBlue" />
<RuleSets> <RuleSets>

6
src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/BrowserDisplayBinding.cs

@ -24,7 +24,7 @@ namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
return fileName.StartsWith("http:") return fileName.StartsWith("http:")
|| fileName.StartsWith("https:") || fileName.StartsWith("https:")
|| fileName.StartsWith("ftp:") || fileName.StartsWith("ftp:")
|| fileName.StartsWith("browser:"); || fileName.StartsWith("browser://");
} }
public bool CanCreateContentForLanguage(string language) public bool CanCreateContentForLanguage(string language)
@ -35,8 +35,8 @@ namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
public IViewContent CreateContentForFile(string fileName) public IViewContent CreateContentForFile(string fileName)
{ {
BrowserPane browserPane = new BrowserPane(); BrowserPane browserPane = new BrowserPane();
if (fileName.StartsWith("browser:")) { if (fileName.StartsWith("browser://")) {
browserPane.Load(fileName.Substring("browser:".Length)); browserPane.Load(fileName.Substring("browser://".Length));
} else { } else {
browserPane.Load(fileName); browserPane.Load(fileName);
} }

34
src/Main/Base/Project/Src/Services/DisplayBinding/DisplayBindingDescriptor.cs

@ -11,6 +11,7 @@ using System.IO;
using System.Collections; using System.Collections;
using System.Reflection; using System.Reflection;
using System.CodeDom.Compiler; using System.CodeDom.Compiler;
using System.Text.RegularExpressions;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
@ -56,5 +57,38 @@ namespace ICSharpCode.Core
this.codon = codon; this.codon = codon;
} }
/// <summary>
/// Gets if the display binding can possibly attach to the file.
/// If this method returns false, it cannot attach to it; if the method returns
/// true, it *might* attach to it.
/// </summary>
/// <remarks>
/// This method is used to skip loading addins like the ResourceEditor which cannot
/// attach to a certain file name for sure.
/// </remarks>
public bool CanAttachToFile(string fileName)
{
string fileNameRegex = codon.Properties["fileNamePattern"];
if (fileNameRegex == null || fileNameRegex.Length == 0) // no regex specified
return true;
return Regex.IsMatch(fileName, fileNameRegex, RegexOptions.IgnoreCase);
}
/// <summary>
/// Gets if the display binding can possibly attach to the language.
/// If this method returns false, it cannot attach to it; if the method returns
/// true, it *might* attach to it.
/// </summary>
/// <remarks>
/// This method is used to skip loading addins like the ResourceEditor which cannot
/// attach to a most languages.
/// </remarks>
public bool CanAttachToLanguage(string language)
{
string languageRegex = codon.Properties["languagePattern"];
if (languageRegex == null || languageRegex.Length == 0) // no regex specified
return true;
return Regex.IsMatch(language, languageRegex, RegexOptions.IgnoreCase);
}
} }
} }

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

@ -43,7 +43,7 @@ namespace ICSharpCode.Core
static DisplayBindingDescriptor GetCodonPerFileName(string filename) static DisplayBindingDescriptor GetCodonPerFileName(string filename)
{ {
foreach (DisplayBindingDescriptor binding in bindings) { foreach (DisplayBindingDescriptor binding in bindings) {
if (!binding.IsSecondary && binding.Binding.CanCreateContentForFile(filename)) { if (!binding.IsSecondary && binding.CanAttachToFile(filename) && binding.Binding.CanCreateContentForFile(filename)) {
return binding; return binding;
} }
} }
@ -53,7 +53,7 @@ namespace ICSharpCode.Core
static DisplayBindingDescriptor GetCodonPerLanguageName(string languagename) static DisplayBindingDescriptor GetCodonPerLanguageName(string languagename)
{ {
foreach (DisplayBindingDescriptor binding in bindings) { foreach (DisplayBindingDescriptor binding in bindings) {
if (binding.Binding != null && binding.Binding.CanCreateContentForLanguage(languagename)) { if (binding.Binding != null && binding.CanAttachToLanguage(languagename) && binding.Binding.CanCreateContentForLanguage(languagename)) {
return binding; return binding;
} }
} }

8
src/Main/Base/Project/Src/Services/File/FileService.cs

@ -84,7 +84,8 @@ namespace ICSharpCode.Core
public static IWorkbenchWindow OpenFile(string fileName) public static IWorkbenchWindow OpenFile(string fileName)
{ {
// test, if file fileName exists // test, if file fileName exists
if (!fileName.StartsWith("http://")) { bool isURL = fileName.IndexOf("://") > 0;
if (!isURL) {
System.Diagnostics.Debug.Assert(FileUtility.IsValidFileName(fileName)); System.Diagnostics.Debug.Assert(FileUtility.IsValidFileName(fileName));
// test, if an untitled file should be opened // test, if an untitled file should be opened
@ -103,7 +104,7 @@ namespace ICSharpCode.Core
foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) { foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
if (content.FileName != null) { if (content.FileName != null) {
try { try {
if (fileName.StartsWith("http://") ? content.FileName == fileName : FileUtility.IsEqualFileName(content.FileName, fileName)) { if (isURL ? content.FileName == fileName : FileUtility.IsEqualFileName(content.FileName, fileName)) {
content.WorkbenchWindow.SelectWindow(); content.WorkbenchWindow.SelectWindow();
return content.WorkbenchWindow; return content.WorkbenchWindow;
} }
@ -117,8 +118,7 @@ namespace ICSharpCode.Core
IViewContent viewContent = subViewContent as IViewContent; IViewContent viewContent = subViewContent as IViewContent;
if (viewContent != null && viewContent.FileName != null) { if (viewContent != null && viewContent.FileName != null) {
try { try {
if (fileName.StartsWith("http://") ? viewContent.FileName == fileName : if (isURL ? viewContent.FileName == fileName : FileUtility.IsEqualFileName(viewContent.FileName, fileName)) {
Path.GetFullPath(viewContent.FileName.ToUpper()) == Path.GetFullPath(fileName.ToUpper())) {
viewContent.WorkbenchWindow.SelectWindow(); viewContent.WorkbenchWindow.SelectWindow();
return content.WorkbenchWindow; return content.WorkbenchWindow;
} }

50
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CodeCompletionBinding.cs

@ -6,7 +6,9 @@
// </file> // </file>
using System; using System;
using System.Collections;
using System.IO; using System.IO;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
@ -20,24 +22,56 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch); bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch);
} }
public class DefaultCodeCompletionBinding : ICodeCompletionBinding public class CodeCompletionBindingDoozer : IDoozer
{
public bool HandleConditions {
get {
return false;
}
}
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
string ext = codon.Properties["extensions"];
if (ext != null && ext.Length > 0)
return new LazyCodeCompletionBinding(codon, ext.Split(';'));
else
return codon.AddIn.CreateObject(codon.Properties["class"]);
}
}
public sealed class LazyCodeCompletionBinding : ICodeCompletionBinding
{ {
string extension; Codon codon;
string[] extensions;
ICodeCompletionBinding binding;
public DefaultCodeCompletionBinding(string extension) public LazyCodeCompletionBinding(Codon codon, string[] extensions)
{ {
this.extension = extension; this.codon = codon;
this.extensions = extensions;
} }
public bool CheckExtension(SharpDevelopTextAreaControl editor) public bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch)
{ {
string ext = Path.GetExtension(editor.FileName); string ext = Path.GetExtension(editor.FileName);
return string.Compare(ext, extension, true) == 0; foreach (string extension in extensions) {
if (ext.Equals(extension, StringComparison.InvariantCultureIgnoreCase)) {
if (binding == null) {
binding = (ICodeCompletionBinding)codon.AddIn.CreateObject(codon.Properties["class"]);
}
return binding.HandleKeyPress(editor, ch);
}
}
return false;
} }
}
public class DefaultCodeCompletionBinding : ICodeCompletionBinding
{
bool enableMethodInsight = true; bool enableMethodInsight = true;
bool enableIndexerInsight = true; bool enableIndexerInsight = true;
bool enableXmlCommentCompletion = false; bool enableXmlCommentCompletion = true;
bool enableDotCompletion = true; bool enableDotCompletion = true;
public bool EnableMethodInsight { public bool EnableMethodInsight {
@ -78,8 +112,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
public virtual bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch) public virtual bool HandleKeyPress(SharpDevelopTextAreaControl editor, char ch)
{ {
if (!CheckExtension(editor))
return false;
switch (ch) { switch (ch) {
case '(': case '(':
if (enableMethodInsight && CodeCompletionOptions.InsightEnabled) { if (enableMethodInsight && CodeCompletionOptions.InsightEnabled) {

8
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/ToolBarItem/Gui/ToolBarCommand.cs

@ -45,17 +45,17 @@ namespace ICSharpCode.Core
Image = ResourceService.GetBitmap(codon.Properties["icon"]); Image = ResourceService.GetBitmap(codon.Properties["icon"]);
} }
menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]);
if (menuCommand != null)
menuCommand.Owner = caller;
UpdateStatus(); UpdateStatus();
} }
protected override void OnClick(System.EventArgs e) protected override void OnClick(System.EventArgs e)
{ {
base.OnClick(e); base.OnClick(e);
if (menuCommand == null) {
menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]);
}
if (menuCommand != null) { if (menuCommand != null) {
menuCommand.Owner = caller;
menuCommand.Run(); menuCommand.Run();
} }
} }

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

@ -167,6 +167,7 @@ namespace ICSharpCode.SharpDevelop
AddInTree.Doozers.Add("EditAction", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.EditActionDoozer()); AddInTree.Doozers.Add("EditAction", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.EditActionDoozer());
AddInTree.Doozers.Add("SyntaxMode", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.SyntaxModeDoozer()); AddInTree.Doozers.Add("SyntaxMode", new ICSharpCode.SharpDevelop.DefaultEditor.Codons.SyntaxModeDoozer());
AddInTree.Doozers.Add("BrowserSchemeExtension", new ICSharpCode.SharpDevelop.BrowserDisplayBinding.SchemeExtensionDoozer()); AddInTree.Doozers.Add("BrowserSchemeExtension", new ICSharpCode.SharpDevelop.BrowserDisplayBinding.SchemeExtensionDoozer());
AddInTree.Doozers.Add("CodeCompletionBinding", new ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionBindingDoozer());
MenuCommand.LinkCommandCreator = delegate(string link) { return new LinkCommand(link); }; MenuCommand.LinkCommandCreator = delegate(string link) { return new LinkCommand(link); };

Loading…
Cancel
Save