Browse Source

Merge remote-tracking branch 'remotes/sd/master'

pull/584/head
jkuehner 11 years ago
parent
commit
181349f813
  1. 119
      data/resources/StringResources.de.resx
  2. 18
      data/resources/StringResources.es-mx.resx
  3. 18
      data/resources/StringResources.es.resx
  4. 5102
      data/resources/StringResources.jp.resx
  5. 209
      data/resources/StringResources.resx
  6. 642
      data/resources/StringResources.ru.resx
  7. 4
      data/resources/languages/LanguageDefinition.xml
  8. 5
      src/AddIns/Analysis/CodeAnalysis/Src/AnalysisIdeOptionsPanel.xaml
  9. 2
      src/AddIns/Analysis/CodeAnalysis/Src/AnalysisProjectOptionsPanel.xaml.cs
  10. 2
      src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.addin
  11. 10
      src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj
  12. 170
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpCompletionBinding.cs
  13. 26
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpDotCompletionDataProvider.cs
  14. 58
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpExpressionFinder.cs
  15. 62
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpModelTypeLocater.cs
  16. 68
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpParser.cs
  17. 119
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpResolver.cs
  18. 50
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCompilationUnit.cs
  19. 6
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  20. 1
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
  21. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd
  22. 29
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpLanguageBinding.cs
  23. 8
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighterVisitor.cs
  24. 13
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs
  25. 24
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionContext.cs
  26. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs
  27. 3
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CompletionData.cs
  28. 5
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs
  29. 34
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EnumMemberCompletionData.cs
  30. 50
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EventCreationCompletionData.cs
  31. 7
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/TypeCompletionData.cs
  32. 17
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/ExtensionMethods.cs
  33. 6
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs
  34. 11
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs
  35. 28
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpEventBindingService.cs
  36. 1
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/ICSharpDesignerLoaderContext.cs
  37. 36
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/Parser.cs
  38. 29
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/CSharpCodeGenerator.cs
  39. 59
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/EditorScript.cs
  40. 37
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertionCursorLayer.cs
  41. 9
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs
  42. 8
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesDialog.xaml
  43. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.xaml.cs
  44. 49
      src/AddIns/BackendBindings/Python/PyWalker/AssemblyInfo.cs
  45. 441
      src/AddIns/BackendBindings/Python/PyWalker/CodeDomVisitor.cs
  46. 46
      src/AddIns/BackendBindings/Python/PyWalker/Indentation.cs
  47. 210
      src/AddIns/BackendBindings/Python/PyWalker/MainForm.Designer.cs
  48. 157
      src/AddIns/BackendBindings/Python/PyWalker/MainForm.cs
  49. 123
      src/AddIns/BackendBindings/Python/PyWalker/MainForm.resx
  50. 678
      src/AddIns/BackendBindings/Python/PyWalker/NRefactoryAstVisitor.cs
  51. 84
      src/AddIns/BackendBindings/Python/PyWalker/PyWalker.csproj
  52. 237
      src/AddIns/BackendBindings/Python/PyWalker/ResolveWalker.cs
  53. 31
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Configuration/AssemblyInfo.cs
  54. 79
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Python.Build.Tasks.csproj
  55. 105
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/SharpDevelop.Build.Python.targets
  56. 83
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/IPythonCompiler.cs
  57. 282
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/PythonCompiler.cs
  58. 313
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/PythonCompilerTask.cs
  59. 58
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/ResourceFile.cs
  60. 49
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/AssemblyInfo.cs
  61. 90
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/CompileResourcesTestFixture.cs
  62. 120
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/CompileSingleSourceFileTestFixture.cs
  63. 84
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/DifferentTargetTypesTestFixture.cs
  64. 109
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/DummyPythonCompilerTask.cs
  65. 72
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/IOErrorTestFixture.cs
  66. 77
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/IncludeDebugInfoTestFixture.cs
  67. 59
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/LogicalResourceNamesTests.cs
  68. 72
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/MainEntryPointTestFixture.cs
  69. 67
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/MissingMainEntryPointTestFixture.cs
  70. 160
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/MockPythonCompiler.cs
  71. 116
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/PlatformTestFixture.cs
  72. 90
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/Python.Build.Tasks.Tests.csproj
  73. 57
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/PythonCompilerTests.cs
  74. 69
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/RelativeReferenceTestFixture.cs
  75. 69
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/RelativeResourceFileTestFixture.cs
  76. 79
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorFileNameWithDotCharTestFixture.cs
  77. 71
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorNullFileNameTestFixture.cs
  78. 119
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorTestFixture.cs
  79. 78
      src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorUnknownFileNameTestFixture.cs
  80. 206
      src/AddIns/BackendBindings/Python/PythonBinding.sln
  81. 31
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Configuration/AssemblyInfo.cs
  82. 25
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/__future__.py
  83. 31
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/runpy.py
  84. 14
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/site.py
  85. 227
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.addin
  86. 319
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj
  87. 138
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/ApplicationSettingsPanel.xfrm
  88. 71
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm
  89. 135
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/Python.xshd
  90. 100
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/AddInOptions.cs
  91. 154
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ApplicationSettingsPanel.cs
  92. 108
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs
  93. 68
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConstructorInfo.cs
  94. 170
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertProjectToPythonProjectCommand.cs
  95. 66
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertToPythonMenuCommand.cs
  96. 28
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonResolver.cs
  97. 90
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/MemberName.cs
  98. 2074
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs
  99. 159
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonAstWalker.cs
  100. 37
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonBuiltInModuleMemberName.cs
  101. Some files were not shown because too many files have changed in this diff Show More

119
data/resources/StringResources.de.resx

@ -294,7 +294,7 @@ Laden Sie ein AddIn aus dem Internet herunter, klicken Sie auf "AddIn installier
{1} {1}
Sie werden nicht mehr funktionieren nachdem dieses AddIn deaktiviert wurde! Sind Sie sicher, dass Sie fortfahren möchten?</value> Sie werden nicht mehr funktionieren, nachdem dieses AddIn deaktiviert wurde! Sind Sie sicher, dass Sie fortfahren möchten?</value>
</data> </data>
<data name="AddInManager2.InstallDependentMessage" xml:space="preserve"> <data name="AddInManager2.InstallDependentMessage" xml:space="preserve">
<value>Das Paket "{0}" benötigt noch mindestens ein zusätzliches Paket: <value>Das Paket "{0}" benötigt noch mindestens ein zusätzliches Paket:
@ -332,6 +332,9 @@ Wenn Sie den Lizenzbedingungen nicht zustimmen, klicken Sie auf "Ablehnen".</val
<data name="AddInManager2.OptionPanel.Add" xml:space="preserve"> <data name="AddInManager2.OptionPanel.Add" xml:space="preserve">
<value>Hinzufügen</value> <value>Hinzufügen</value>
</data> </data>
<data name="AddInManager2.OptionPanel.AutoCheckForUpdates" xml:space="preserve">
<value>Automatisch nach Updates suchen</value>
</data>
<data name="AddInManager2.OptionPanel.MoveDown" xml:space="preserve"> <data name="AddInManager2.OptionPanel.MoveDown" xml:space="preserve">
<value>Nach unten</value> <value>Nach unten</value>
</data> </data>
@ -350,6 +353,9 @@ Wenn Sie den Lizenzbedingungen nicht zustimmen, klicken Sie auf "Ablehnen".</val
<data name="AddInManager2.OptionPanel.Tree.AddIns" xml:space="preserve"> <data name="AddInManager2.OptionPanel.Tree.AddIns" xml:space="preserve">
<value>AddIns</value> <value>AddIns</value>
</data> </data>
<data name="AddInManager2.OptionPanel.Tree.General" xml:space="preserve">
<value>Allgemein</value>
</data>
<data name="AddInManager2.OptionPanel.Tree.Repositories" xml:space="preserve"> <data name="AddInManager2.OptionPanel.Tree.Repositories" xml:space="preserve">
<value>Quellen</value> <value>Quellen</value>
</data> </data>
@ -1201,9 +1207,7 @@ Ein Ausführungskommando kann in den Projektoptionen eingestellt werden.</value>
<value>Ink</value> <value>Ink</value>
</data> </data>
<data name="ComponentInspector.EventLogList.NoEventsBeingLoggedMessage" xml:space="preserve"> <data name="ComponentInspector.EventLogList.NoEventsBeingLoggedMessage" xml:space="preserve">
<value>Sie protokollieren keine Ereignisse. <value>Sie protokollieren keine Ereignisse. Wählen Sie ein Objekt oder ein Ereignis im Objekte-Panel und klicken Sie mit der rechten Maustaste oder benutzen Sie das "Aktion"-Menü um mit dem Protokollieren von Ereignissen zu beginnen.</value>
Wählen Sie ein Objekt oder ein Ereignis im Objekte-Panel und klicken Sie mit der rechten Maustaste oder benutzen Sie das "Aktion"-Menü um mit dem Protokollieren von Ereignissen zu beginnen.</value>
</data> </data>
<data name="ComponentInspector.EventLogList.ParametersColumnHeader" xml:space="preserve"> <data name="ComponentInspector.EventLogList.ParametersColumnHeader" xml:space="preserve">
<value>Parameter</value> <value>Parameter</value>
@ -1534,6 +1538,30 @@ Um ActiveX/COM-Objekte zu generieren, ziehen sie eine Klasse aus einer Typbiblio
<data name="CQA.MainWindow.FormTitle" xml:space="preserve"> <data name="CQA.MainWindow.FormTitle" xml:space="preserve">
<value>Code-Qualitätsanalyse</value> <value>Code-Qualitätsanalyse</value>
</data> </data>
<data name="CSharpBinding.Formatting.AutoFormat" xml:space="preserve">
<value>Code automatisch formatieren</value>
</data>
<data name="CSharpBinding.Formatting.DefaultOptionReference" xml:space="preserve">
<value>(Standard)</value>
</data>
<data name="CSharpBinding.Formatting.GlobalOptionReference" xml:space="preserve">
<value>(Global)</value>
</data>
<data name="CSharpBinding.Formatting.NoPresetSelectedMessage" xml:space="preserve">
<value>Keine Formatierungsvoreinstellung ausgewählt!</value>
</data>
<data name="CSharpBinding.Formatting.PresetOverwriteQuestion" xml:space="preserve">
<value>Sind Sie sicher, dass Sie alle Formatierungseinstellungen zurücksetzen wollen?</value>
</data>
<data name="CSharpBinding.Formatting.ProjectOptionReference" xml:space="preserve">
<value>(Projekt)</value>
</data>
<data name="CSharpBinding.Formatting.ResetTo" xml:space="preserve">
<value>Zurücksetzen auf:</value>
</data>
<data name="CSharpBinding.Formatting.SolutionOptionReference" xml:space="preserve">
<value>(Projektmappe)</value>
</data>
<data name="CSharpBinding.GenerateNewHandlerInstructions" xml:space="preserve"> <data name="CSharpBinding.GenerateNewHandlerInstructions" xml:space="preserve">
<value>Füge Reference zu Methode ein; drücke Tab oder Enter zweimal, um eine neue Methode anzulegen.</value> <value>Füge Reference zu Methode ein; drücke Tab oder Enter zweimal, um eine neue Methode anzulegen.</value>
</data> </data>
@ -1650,6 +1678,9 @@ Beispiele: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.HighlightingEditor.ColorDlg.Italic" xml:space="preserve"> <data name="Dialog.HighlightingEditor.ColorDlg.Italic" xml:space="preserve">
<value>Kursiv</value> <value>Kursiv</value>
</data> </data>
<data name="Dialog.HighlightingEditor.ColorDlg.Underline" xml:space="preserve">
<value>Unterstrichen</value>
</data>
<data name="Dialog.HighlightingEditor.Export" xml:space="preserve"> <data name="Dialog.HighlightingEditor.Export" xml:space="preserve">
<value>Hervorhebungsfarben exportieren</value> <value>Hervorhebungsfarben exportieren</value>
</data> </data>
@ -1954,6 +1985,12 @@ Wollen Sie die neue Datei zum Projekt ${CurrentProjectName} hinzufügen?</value>
<data name="Dialog.Options.IDEOptions.CodeCompletion.ClearCache" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.ClearCache" xml:space="preserve">
<value>Cache leeren</value> <value>Cache leeren</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnCharacters" xml:space="preserve">
<value>Den gewählten Code completion-Eintrag bei Eingabe der folgenden Zeichen einfügen:</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnTabEnterOnly" xml:space="preserve">
<value>Den gewählten Code completion-Eintrag nur bei &lt;Tab&gt; oder &lt;Enter&gt; einfügen.</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping" xml:space="preserve">
<value>Zeige Code Completion, wenn ein Buchstabe eingegeben wird</value> <value>Zeige Code Completion, wenn ein Buchstabe eingegeben wird</value>
</data> </data>
@ -1975,6 +2012,18 @@ Wollen Sie die neue Datei zum Projekt ${CurrentProjectName} hinzufügen?</value>
<data name="Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber" xml:space="preserve">
<value>Speichere</value> <value>Speichere</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLabel" xml:space="preserve">
<value>Tooltip-Einstellungen</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget" xml:space="preserve">
<value>Links in Tooltips führen zur</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTargetDefinition" xml:space="preserve">
<value>Definition im Code</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTargetDocumentation" xml:space="preserve">
<value>Dokumentation (falls verfügbar)</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.UseDataUsageCache" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.UseDataUsageCache" xml:space="preserve">
<value>Häufig benutzte Einträge bevorzugt markieren</value> <value>Häufig benutzte Einträge bevorzugt markieren</value>
</data> </data>
@ -2029,12 +2078,24 @@ Wollen Sie die neue Datei zum Projekt ${CurrentProjectName} hinzufügen?</value>
<data name="Dialog.Options.IDEOptions.Debugging.BreakAtBeginning" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.BreakAtBeginning" xml:space="preserve">
<value>Auf erster Anweisung des Programmes anhalten.</value> <value>Auf erster Anweisung des Programmes anhalten.</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.ChooseExceptions" xml:space="preserve">
<value>Ausnahmen auswählen</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Decompiler aktivieren</value> <value>Decompiler aktivieren</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Bearbeiten und Fortfahren (EnC) aktivieren</value> <value>Bearbeiten und Fortfahren (EnC) aktivieren</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.Debugging.ExceptionFilter.ColumnExpression" xml:space="preserve">
<value>Voller Name der Ausnahme</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.ExceptionFilter.ColumnIsActive" xml:space="preserve">
<value>Unterbrechen bei</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.ExceptionFilterTitle" xml:space="preserve">
<value>Wählen Sie Ausnahmen aus, bei denen der Debugger anhalten soll</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Ausnahmen</value> <value>Ausnahmen</value>
</data> </data>
@ -2347,6 +2408,9 @@ Wollen Sie die neue Datei zum Projekt ${CurrentProjectName} hinzufügen?</value>
<data name="Dialog.Options.IDEOptions.TextEditor.Markers.HighlightBracketCheckBox" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.TextEditor.Markers.HighlightBracketCheckBox" xml:space="preserve">
<value>&amp;Passende Klammer markieren</value> <value>&amp;Passende Klammer markieren</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.TextEditor.Markers.HighlightCurrentLineCheckBox" xml:space="preserve">
<value>Aktuelle Zeile hervorheben</value>
</data>
<data name="Dialog.Options.IDEOptions.TextEditor.Markers.HighlightSymbolCheckBox" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.TextEditor.Markers.HighlightSymbolCheckBox" xml:space="preserve">
<value>Symbole hervorheben</value> <value>Symbole hervorheben</value>
</data> </data>
@ -2608,6 +2672,9 @@ Wollen Sie die neue Datei zum Projekt ${CurrentProjectName} hinzufügen?</value>
<data name="Dialog.ProjectOptions.BuildOptions.VBOptionsDefaultValues" xml:space="preserve"> <data name="Dialog.ProjectOptions.BuildOptions.VBOptionsDefaultValues" xml:space="preserve">
<value>Standardwerte für VB Optionen:</value> <value>Standardwerte für VB Optionen:</value>
</data> </data>
<data name="Dialog.ProjectOptions.CodeFormatting" xml:space="preserve">
<value>Codeformatierung</value>
</data>
<data name="Dialog.ProjectOptions.Configuration" xml:space="preserve"> <data name="Dialog.ProjectOptions.Configuration" xml:space="preserve">
<value>Konfiguration</value> <value>Konfiguration</value>
</data> </data>
@ -3314,6 +3381,9 @@ Bitte einen anderen Dateinamen wählen.</value>
<data name="ICSharpCode.CodeCoverage.CodeNotCovered" xml:space="preserve"> <data name="ICSharpCode.CodeCoverage.CodeNotCovered" xml:space="preserve">
<value>Nicht abgedeckter Code</value> <value>Nicht abgedeckter Code</value>
</data> </data>
<data name="ICSharpCode.CodeCoverage.CodePartCovered" xml:space="preserve">
<value>Code teilweise abgedeckt</value>
</data>
<data name="ICSharpCode.CodeCoverage.Column" xml:space="preserve"> <data name="ICSharpCode.CodeCoverage.Column" xml:space="preserve">
<value>Spalte</value> <value>Spalte</value>
</data> </data>
@ -3586,6 +3656,9 @@ Bitte stellen Sie den Pfad zur NAnt-Anwendung in den SharpDevelop-Optionen ein.<
<data name="ICSharpCode.PythonBinding.UnknownTypeName" xml:space="preserve"> <data name="ICSharpCode.PythonBinding.UnknownTypeName" xml:space="preserve">
<value>Konnte Typ '{0}' nicht finden. Fehlt eine Assembly-Referenz?</value> <value>Konnte Typ '{0}' nicht finden. Fehlt eine Assembly-Referenz?</value>
</data> </data>
<data name="ICSharpCode.Refactoring.NoClassOrMemberUnderCursorError" xml:space="preserve">
<value>Es konnte keine Typ- oder Member-Definition an der Cursor-Position gefunden werden.</value>
</data>
<data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve"> <data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve">
<value>Das gewählte Element ist keine Klasse oder überschreibbares Mitglied, daher können keine Symbole angezeigt werden.</value> <value>Das gewählte Element ist keine Klasse oder überschreibbares Mitglied, daher können keine Symbole angezeigt werden.</value>
</data> </data>
@ -4305,6 +4378,9 @@ Grund: Der Wert zu dem zurückgesetzt werden soll ist ungültig weil sich eine a
<data name="ICSharpCode.SharpDevelop.Project.SolutionAlteredExternallyMessage" xml:space="preserve"> <data name="ICSharpCode.SharpDevelop.Project.SolutionAlteredExternallyMessage" xml:space="preserve">
<value>Die Projektmappe wurde extern geändert.</value> <value>Die Projektmappe wurde extern geändert.</value>
</data> </data>
<data name="ICSharpCode.SharpDevelop.Project.SolutionFormattingOptions.Title" xml:space="preserve">
<value>Formatierungsoptionen der Projektmappe</value>
</data>
<data name="ICSharpCode.SharpDevelop.Project.UpgradeView.ChangeCompilerVersionLabel" xml:space="preserve"> <data name="ICSharpCode.SharpDevelop.Project.UpgradeView.ChangeCompilerVersionLabel" xml:space="preserve">
<value>Neue &amp;Compilerversion:</value> <value>Neue &amp;Compilerversion:</value>
</data> </data>
@ -5026,6 +5102,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="MainWindow.Windows.ClassBrowser.OpenAssemblyFromGAC" xml:space="preserve"> <data name="MainWindow.Windows.ClassBrowser.OpenAssemblyFromGAC" xml:space="preserve">
<value>Assembly aus GAC öffnen...</value> <value>Assembly aus GAC öffnen...</value>
</data> </data>
<data name="MainWindow.Windows.ClassBrowser.OpenInClassBrowser" xml:space="preserve">
<value>Im Klassenbrowser anzeigen</value>
</data>
<data name="MainWindow.Windows.ClassBrowser.SearchButton.ToolTip" xml:space="preserve"> <data name="MainWindow.Windows.ClassBrowser.SearchButton.ToolTip" xml:space="preserve">
<value>Suche nach Klassenname</value> <value>Suche nach Klassenname</value>
</data> </data>
@ -5044,6 +5123,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="MainWindow.Windows.CompilerMessageView.ToggleWordWrapButton.ToolTip" xml:space="preserve"> <data name="MainWindow.Windows.CompilerMessageView.ToggleWordWrapButton.ToolTip" xml:space="preserve">
<value>Zeilenumbruch aktivieren/deaktivieren</value> <value>Zeilenumbruch aktivieren/deaktivieren</value>
</data> </data>
<data name="MainWindow.Windows.Debug.AddWatchExpression" xml:space="preserve">
<value>Ausdruck zur Überwachung hinzufügen</value>
</data>
<data name="MainWindow.Windows.Debug.Breakpoints" xml:space="preserve"> <data name="MainWindow.Windows.Debug.Breakpoints" xml:space="preserve">
<value>Haltepunkte</value> <value>Haltepunkte</value>
</data> </data>
@ -5146,6 +5228,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="MainWindow.Windows.Debug.ExceptionForm.Break" xml:space="preserve"> <data name="MainWindow.Windows.Debug.ExceptionForm.Break" xml:space="preserve">
<value>Unterbrechen</value> <value>Unterbrechen</value>
</data> </data>
<data name="MainWindow.Windows.Debug.ExceptionForm.BreakOnHandled" xml:space="preserve">
<value>Unterbrechen bei behandelter ${ExceptionName}</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.Continue" xml:space="preserve"> <data name="MainWindow.Windows.Debug.ExceptionForm.Continue" xml:space="preserve">
<value>Fortsetzen</value> <value>Fortsetzen</value>
</data> </data>
@ -5689,6 +5774,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="ProjectComponent.ContextMenu.AddReference" xml:space="preserve"> <data name="ProjectComponent.ContextMenu.AddReference" xml:space="preserve">
<value>Referenz hinzufügen</value> <value>Referenz hinzufügen</value>
</data> </data>
<data name="ProjectComponent.ContextMenu.AddServiceReference" xml:space="preserve">
<value>Service-Referenz hinzufügen</value>
</data>
<data name="ProjectComponent.ContextMenu.AddWebReference" xml:space="preserve"> <data name="ProjectComponent.ContextMenu.AddWebReference" xml:space="preserve">
<value>Web Referenz hinzufügen</value> <value>Web Referenz hinzufügen</value>
</data> </data>
@ -6086,6 +6174,9 @@ Bitte einen anderen verwenden.</value>
<data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve"> <data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve">
<value>Basisklassen von ${Name}</value> <value>Basisklassen von ${Name}</value>
</data> </data>
<data name="SharpDevelop.Refactoring.BaseMembersOf" xml:space="preserve">
<value>Basis-Member von ${Name}</value>
</data>
<data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve"> <data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve">
<value>Die Operation kann nicht ausgeführt werden, weil Ihr Sourcecode Fehler enthält:</value> <value>Die Operation kann nicht ausgeführt werden, weil Ihr Sourcecode Fehler enthält:</value>
</data> </data>
@ -6098,6 +6189,12 @@ Bitte einen anderen verwenden.</value>
<data name="SharpDevelop.Refactoring.ClassesDerivingFrom" xml:space="preserve"> <data name="SharpDevelop.Refactoring.ClassesDerivingFrom" xml:space="preserve">
<value>Klassen, die von ${Name} erben</value> <value>Klassen, die von ${Name} erben</value>
</data> </data>
<data name="SharpDevelop.Refactoring.ClipboardRingCommand" xml:space="preserve">
<value>Aus Zwischenablagering</value>
</data>
<data name="SharpDevelop.Refactoring.ClipboardRingEmpty" xml:space="preserve">
<value>Der Zwischenablagering ist leer</value>
</data>
<data name="SharpDevelop.Refactoring.ConvertToAutomaticProperty" xml:space="preserve"> <data name="SharpDevelop.Refactoring.ConvertToAutomaticProperty" xml:space="preserve">
<value>In automatische Eigenschaft konvertieren</value> <value>In automatische Eigenschaft konvertieren</value>
</data> </data>
@ -6128,6 +6225,9 @@ Bitte einen anderen verwenden.</value>
<data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve">
<value>Finde Basisklassen</value> <value>Finde Basisklassen</value>
</data> </data>
<data name="SharpDevelop.Refactoring.FindBaseClassesOrMembersCommand" xml:space="preserve">
<value>Finde Basissymbole</value>
</data>
<data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve">
<value>Abgeleitete Typen finden</value> <value>Abgeleitete Typen finden</value>
</data> </data>
@ -6234,7 +6334,7 @@ Bitte einen anderen verwenden.</value>
<value>Alle bekannten Projektformate</value> <value>Alle bekannten Projektformate</value>
</data> </data>
<data name="SharpDevelop.Solution.CannotLoadOldSolution" xml:space="preserve"> <data name="SharpDevelop.Solution.CannotLoadOldSolution" xml:space="preserve">
<value>Diese Version von SharpDevelop kann keine Projekte, die mit Visual Studio .NET 2003 (oder früher) erstellt wurden. <value>Diese Version von SharpDevelop kann keine Projekte laden, die mit Visual Studio .NET 2003 (oder früher) erstellt wurden.
Versuchen Sie das Projekt mit SharpDevelop 3.2 zu konvertieren, oder erstellen Sie ein neues Projekt und fügen Sie ihm die existierenden Quellcodedateien hinzu.</value> Versuchen Sie das Projekt mit SharpDevelop 3.2 zu konvertieren, oder erstellen Sie ein neues Projekt und fügen Sie ihm die existierenden Quellcodedateien hinzu.</value>
</data> </data>
<data name="SharpDevelop.Solution.CannotSave.IOException" xml:space="preserve"> <data name="SharpDevelop.Solution.CannotSave.IOException" xml:space="preserve">
@ -6563,6 +6663,9 @@ SharpDevelop 2 kompiliert Ressourcendateien anders: der Ressourcenname ist nicht
<data name="StartPage.StartMenu.OpenCombineButton" xml:space="preserve"> <data name="StartPage.StartMenu.OpenCombineButton" xml:space="preserve">
<value>Projektmappe öffnen</value> <value>Projektmappe öffnen</value>
</data> </data>
<data name="StartPage.StartMenu.RemoveRecentProject" xml:space="preserve">
<value>Aus der Liste der kürzlich verwendeten Projekte entfernen</value>
</data>
<data name="StartPage.StartPageContentName" xml:space="preserve"> <data name="StartPage.StartPageContentName" xml:space="preserve">
<value>Startseite</value> <value>Startseite</value>
</data> </data>
@ -6575,6 +6678,12 @@ SharpDevelop 2 kompiliert Ressourcendateien anders: der Ressourcenname ist nicht
<data name="StatusBarService.CursorStatusBarPanelText" xml:space="preserve"> <data name="StatusBarService.CursorStatusBarPanelText" xml:space="preserve">
<value>Z ${Line} S ${Column} Zei ${Character}</value> <value>Z ${Line} S ${Column} Zei ${Character}</value>
</data> </data>
<data name="StatusBarService.SelectionStatusBarPanelTextMulti" xml:space="preserve">
<value>Lg ${Rows} * ${Cols} (${Total})</value>
</data>
<data name="StatusBarService.SelectionStatusBarPanelTextSingle" xml:space="preserve">
<value>Lg ${Length}</value>
</data>
<data name="Templates.File.Categories.Misc" xml:space="preserve"> <data name="Templates.File.Categories.Misc" xml:space="preserve">
<value>Sonstiges</value> <value>Sonstiges</value>
</data> </data>

18
data/resources/StringResources.es-mx.resx

@ -1987,6 +1987,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.Options.IDEOptions.CodeCompletion.ClearCache" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.ClearCache" xml:space="preserve">
<value>Borrar caché</value> <value>Borrar caché</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnCharacters" xml:space="preserve">
<value>Inserte entrada de autocompletado de código seleccionado escribiendo los siguientes caracteres:</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnTabEnterOnly" xml:space="preserve">
<value>Inserte solamente entrada de autocompletado de código seleccionado escribiendo &lt;Tab&gt; o &lt;Enter&gt;.</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping" xml:space="preserve">
<value>Mostrar lista de completado después de escribir un carácter</value> <value>Mostrar lista de completado después de escribir un carácter</value>
</data> </data>
@ -2008,6 +2014,9 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber" xml:space="preserve">
<value>Guardar</value> <value>Guardar</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLabel" xml:space="preserve">
<value>Preferencias de Tooltip</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget" xml:space="preserve">
<value>Enlaces en tooltips deben ir en</value> <value>Enlaces en tooltips deben ir en</value>
</data> </data>
@ -3636,6 +3645,9 @@ Por favor configure la ubicación del archivo ejecutable de NAnt en las opciones
<data name="ICSharpCode.PythonBinding.UnknownTypeName" xml:space="preserve"> <data name="ICSharpCode.PythonBinding.UnknownTypeName" xml:space="preserve">
<value>No se pudo encontrar el tipo '{0}'.¿Falta una referencia a un ensamblado?</value> <value>No se pudo encontrar el tipo '{0}'.¿Falta una referencia a un ensamblado?</value>
</data> </data>
<data name="ICSharpCode.Refactoring.NoClassOrMemberUnderCursorError" xml:space="preserve">
<value>No se pudo encontrar una definición de tipo o de miembro en la posición del cursor.</value>
</data>
<data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve"> <data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve">
<value>El elemento seleccionado no es una clase o miembro sobrescribible, así que no se puede mostrar ningún símbolo derivado.</value> <value>El elemento seleccionado no es una clase o miembro sobrescribible, así que no se puede mostrar ningún símbolo derivado.</value>
</data> </data>
@ -6140,6 +6152,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve"> <data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve">
<value>Buscar clases base de ${Name}</value> <value>Buscar clases base de ${Name}</value>
</data> </data>
<data name="SharpDevelop.Refactoring.BaseMembersOf" xml:space="preserve">
<value>Miembros base de ${Name}</value>
</data>
<data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve"> <data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve">
<value>La operación no puede ser realizada debido a que su código fuente contiene errores:</value> <value>La operación no puede ser realizada debido a que su código fuente contiene errores:</value>
</data> </data>
@ -6188,6 +6203,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve">
<value>Buscar clases base</value> <value>Buscar clases base</value>
</data> </data>
<data name="SharpDevelop.Refactoring.FindBaseClassesOrMembersCommand" xml:space="preserve">
<value>Buscar símbolos base</value>
</data>
<data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve">
<value>Buscar clases &amp;derivadas</value> <value>Buscar clases &amp;derivadas</value>
</data> </data>

18
data/resources/StringResources.es.resx

@ -1984,6 +1984,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib
<data name="Dialog.Options.IDEOptions.CodeCompletion.ClearCache" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.ClearCache" xml:space="preserve">
<value>Limpiar caché</value> <value>Limpiar caché</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnCharacters" xml:space="preserve">
<value>Inserte la entrada de autocompletado de código seleccionada escribiendo los siguientes caracteres:</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnTabEnterOnly" xml:space="preserve">
<value>Inserte solamente la entrada de autocompletado de código seleccionado escribiendo &lt;Tab&gt; o &lt;Enter&gt;</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping" xml:space="preserve">
<value>Mostrar lista de completado después de escribir un carácter</value> <value>Mostrar lista de completado después de escribir un carácter</value>
</data> </data>
@ -2005,6 +2011,9 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib
<data name="Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber" xml:space="preserve">
<value>Guardar</value> <value>Guardar</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLabel" xml:space="preserve">
<value>Preferencias de Tooltip</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget" xml:space="preserve"> <data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget" xml:space="preserve">
<value>Enlaces en tooltips deben ir a</value> <value>Enlaces en tooltips deben ir a</value>
</data> </data>
@ -3637,6 +3646,9 @@ Por favor configure la ubicación del archivo ejecutable de NAnt en las opciones
<data name="ICSharpCode.PythonBinding.UnknownTypeName" xml:space="preserve"> <data name="ICSharpCode.PythonBinding.UnknownTypeName" xml:space="preserve">
<value>No se pudo encontrar el tipo '{0}'.¿Falta una referencia a un ensamblado?</value> <value>No se pudo encontrar el tipo '{0}'.¿Falta una referencia a un ensamblado?</value>
</data> </data>
<data name="ICSharpCode.Refactoring.NoClassOrMemberUnderCursorError" xml:space="preserve">
<value>No se pudo encontrar definición de tipo o de miembro en la posición del cursor.</value>
</data>
<data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve"> <data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve">
<value>El elemento seleccionado no es una clase o miembro sobrescribible, así que no se puede mostrar ningún símbolo derivado.</value> <value>El elemento seleccionado no es una clase o miembro sobrescribible, así que no se puede mostrar ningún símbolo derivado.</value>
</data> </data>
@ -6146,6 +6158,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve"> <data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve">
<value>Clases base de ${Name}</value> <value>Clases base de ${Name}</value>
</data> </data>
<data name="SharpDevelop.Refactoring.BaseMembersOf" xml:space="preserve">
<value>Miembros base de ${Name}</value>
</data>
<data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve"> <data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve">
<value>La operación no puede ser realizada debido a que su código fuente contiene errores:</value> <value>La operación no puede ser realizada debido a que su código fuente contiene errores:</value>
</data> </data>
@ -6194,6 +6209,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve">
<value>Buscar clases base</value> <value>Buscar clases base</value>
</data> </data>
<data name="SharpDevelop.Refactoring.FindBaseClassesOrMembersCommand" xml:space="preserve">
<value>Buscar símbolos base</value>
</data>
<data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve">
<value>Encontrar clases &amp;derivadas</value> <value>Encontrar clases &amp;derivadas</value>
</data> </data>

5102
data/resources/StringResources.jp.resx

File diff suppressed because it is too large Load Diff

209
data/resources/StringResources.resx

@ -1729,6 +1729,9 @@ Examples: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.HighlightingEditor.ColorDlg.Italic" xml:space="preserve"> <data name="Dialog.HighlightingEditor.ColorDlg.Italic" xml:space="preserve">
<value>Italic</value> <value>Italic</value>
</data> </data>
<data name="Dialog.HighlightingEditor.ColorDlg.Underline" xml:space="preserve">
<value>Underlined</value>
</data>
<data name="Dialog.HighlightingEditor.Export" xml:space="preserve"> <data name="Dialog.HighlightingEditor.Export" xml:space="preserve">
<value>Export highlighting colors</value> <value>Export highlighting colors</value>
</data> </data>
@ -3789,6 +3792,10 @@ Please configure the NAnt executable's location in the SharpDevelop Options.</va
<value>Could not find type definition at the cursor position.</value> <value>Could not find type definition at the cursor position.</value>
<comment>Error message when using Search&gt;Find Base Classes when the cursor is not on a type reference.</comment> <comment>Error message when using Search&gt;Find Base Classes when the cursor is not on a type reference.</comment>
</data> </data>
<data name="ICSharpCode.Refactoring.NoClassOrMemberUnderCursorError" xml:space="preserve">
<value>Could not find type definition or type member at the cursor position.</value>
<comment>Error message when using Search&gt;Find Base Classes when the cursor is not on a type reference or type member.</comment>
</data>
<data name="ICSharpCode.RubyBinding.SendLineToRubyConsole" xml:space="preserve"> <data name="ICSharpCode.RubyBinding.SendLineToRubyConsole" xml:space="preserve">
<value>Send Line to Ruby Console</value> <value>Send Line to Ruby Console</value>
</data> </data>
@ -6324,7 +6331,7 @@ Removed the end part of the original message ", reason '${Message}'" since this
</data> </data>
<data name="ResourceEditor.BitmapView.UpdateBitmap" xml:space="preserve"> <data name="ResourceEditor.BitmapView.UpdateBitmap" xml:space="preserve">
<value>Update bitmap ...</value> <value>Update bitmap ...</value>
<comment>Text for the link label that make it possible to update the stored bitmap</comment> <comment>Text for the button that makes it possible to update the stored bitmap</comment>
</data> </data>
<data name="ResourceEditor.DeleteEntry.Confirm" xml:space="preserve"> <data name="ResourceEditor.DeleteEntry.Confirm" xml:space="preserve">
<value>Do you really want to delete the selected resource(s)?</value> <value>Do you really want to delete the selected resource(s)?</value>
@ -6473,6 +6480,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
<data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve"> <data name="SharpDevelop.Refactoring.BaseClassesOf" xml:space="preserve">
<value>Base classes of ${Name}</value> <value>Base classes of ${Name}</value>
</data> </data>
<data name="SharpDevelop.Refactoring.BaseMembersOf" xml:space="preserve">
<value>Base members of ${Name}</value>
</data>
<data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve"> <data name="SharpDevelop.Refactoring.CannotPerformOperationBecauseOfSyntaxErrors" xml:space="preserve">
<value>The operation cannot be performed because your source code contains errors:</value> <value>The operation cannot be performed because your source code contains errors:</value>
</data> </data>
@ -6525,6 +6535,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
<data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindBaseClassesCommand" xml:space="preserve">
<value>Find base classes</value> <value>Find base classes</value>
</data> </data>
<data name="SharpDevelop.Refactoring.FindBaseClassesOrMembersCommand" xml:space="preserve">
<value>Find base symbols</value>
</data>
<data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve"> <data name="SharpDevelop.Refactoring.FindDerivedClassesCommand" xml:space="preserve">
<value>Find &amp;derived classes</value> <value>Find &amp;derived classes</value>
</data> </data>
@ -6843,17 +6856,14 @@ The resources files have been renamed/moved accordingly.</value>
<value>Base settings</value> <value>Base settings</value>
</data> </data>
<data name="SharpReport.Wizard.BaseSettings,ReportType" xml:space="preserve"> <data name="SharpReport.Wizard.BaseSettings,ReportType" xml:space="preserve">
<value>Report Type</value> <value>Report Type :</value>
</data> </data>
<data name="SharpReport.Wizard.BaseSettings.FileName" xml:space="preserve"> <data name="SharpReport.Wizard.BaseSettings.FileName" xml:space="preserve">
<value>File Name</value> <value>File Name :</value>
</data> </data>
<data name="SharpReport.Wizard.BaseSettings.GraphicsUnit" xml:space="preserve"> <data name="SharpReport.Wizard.BaseSettings.GraphicsUnit" xml:space="preserve">
<value>Graphics Unit</value> <value>Graphics Unit</value>
</data> </data>
<data name="SharpReport.Wizard.BaseSettings.Group" xml:space="preserve">
<value>Basic report settings</value>
</data>
<data name="SharpReport.Wizard.BaseSettings.ReportModel" xml:space="preserve"> <data name="SharpReport.Wizard.BaseSettings.ReportModel" xml:space="preserve">
<value>Report Model</value> <value>Report Model</value>
</data> </data>
@ -6867,10 +6877,10 @@ The resources files have been renamed/moved accordingly.</value>
<value>Push Data</value> <value>Push Data</value>
</data> </data>
<data name="SharpReport.Wizard.BaseSettings.ReportName" xml:space="preserve"> <data name="SharpReport.Wizard.BaseSettings.ReportName" xml:space="preserve">
<value>Report Name</value> <value>Report Name :</value>
</data> </data>
<data name="SharpReport.Wizard.BaseSettings.ReportType" xml:space="preserve"> <data name="SharpReport.Wizard.BaseSettings.ReportType" xml:space="preserve">
<value>Report Type</value> <value>Report Type :</value>
</data> </data>
<data name="SharpReport.Wizard.Layout.Column" xml:space="preserve"> <data name="SharpReport.Wizard.Layout.Column" xml:space="preserve">
<value>Select the GroupColumn</value> <value>Select the GroupColumn</value>
@ -6902,17 +6912,6 @@ The resources files have been renamed/moved accordingly.</value>
<data name="SharpReport.Wizard.PushModel.AvailableFields" xml:space="preserve"> <data name="SharpReport.Wizard.PushModel.AvailableFields" xml:space="preserve">
<value>Available Fields</value> <value>Available Fields</value>
</data> </data>
<data name="SharpReport.Wizard.PushModel.Path" xml:space="preserve">
<value>Path to Schema (.xsd) File</value>
</data>
<data name="SharpReport.Wizard.ResultPanel.SaveXsdComplete" xml:space="preserve">
<value>Save Result (Schema and Data)</value>
<comment>Save displayed Data to *.xsd File</comment>
</data>
<data name="SharpReport.Wizard.ResultPanel.SaveXsdSchemaOnly" xml:space="preserve">
<value>Save Result (Schema only)</value>
<comment>Save only the Schema to *.xsd File</comment>
</data>
<data name="SharpReport.Wizard.ShowQueryResult" xml:space="preserve"> <data name="SharpReport.Wizard.ShowQueryResult" xml:space="preserve">
<value>Show Query result</value> <value>Show Query result</value>
</data> </data>
@ -8182,4 +8181,176 @@ Error while starting:
<value>This resource is not being used. Its purpose is to test the translation database and has <value>This resource is not being used. Its purpose is to test the translation database and has
a line break</value> a line break</value>
</data> </data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.TooltipLabel" xml:space="preserve">
<value>Tooltip settings</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnCharacters" xml:space="preserve">
<value>Insert selected code completion entry by typing the following characters:</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.CommitOnTabEnterOnly" xml:space="preserve">
<value>Only insert selected code completion entry by typing &lt;Tab&gt; or &lt;Enter&gt;.</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.ExceptionFilterTitle" xml:space="preserve">
<value>Choose exceptions you want the debugger to break on</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.ExceptionFilter.ColumnIsActive" xml:space="preserve">
<value>Break on</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.ExceptionFilter.ColumnExpression" xml:space="preserve">
<value>Full exception name</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.ChooseExceptions" xml:space="preserve">
<value>Choose exceptions</value>
</data>
<data name="MainWindow.Windows.Debug.ExceptionForm.BreakOnHandled" xml:space="preserve">
<value>Break on handled ${ExceptionName}</value>
</data>
<data name="MainWindow.Windows.TaskList.Solution" xml:space="preserve">
<value>Solution</value>
</data>
<data name="MainWindow.Windows.TaskList.Project" xml:space="preserve">
<value>Project</value>
</data>
<data name="MainWindow.Windows.TaskList.AllOpenedFiles" xml:space="preserve">
<value>All opened files</value>
</data>
<data name="MainWindow.Windows.TaskList.CurrentFile" xml:space="preserve">
<value>File</value>
</data>
<data name="MainWindow.Windows.TaskList.Namespace" xml:space="preserve">
<value>Namespace</value>
</data>
<data name="MainWindow.Windows.TaskList.CurrentClass" xml:space="preserve">
<value>Class/Module</value>
</data>
<data name="ResourceEditor.BitmapView.UpdateIcon" xml:space="preserve">
<value>Update icon ...</value>
<comment>Text for the button that makes it possible to update the stored icon</comment>
</data>
<data name="ResourceEditor.Messages.CantLoadResourceFromFile" xml:space="preserve">
<value>Can't load resource from file: {0}</value>
</data>
<data name="ResourceEditor.ResourceEdit.ContextMenu.AddBooleanEntry" xml:space="preserve">
<value>Add &amp;boolean entry</value>
</data>
<data name="ResourceEditor.Filter" xml:space="preserve">
<value>Filter:</value>
</data>
<data name="ResourceEditor.BitmapView.UpdateCursor" xml:space="preserve">
<value>Update cursor ...</value>
<comment>Text for the button that makes it possible to update the stored cursor</comment>
</data>
<data name="XML.MainMenu.SearchMenu.SearchForIssues" xml:space="preserve">
<value>Search For Issues...</value>
</data>
<data name="Dialog.SearchForIssues.AutoFix" xml:space="preserve">
<value>Automatically fix issues if possible</value>
</data>
<data name="Dialog.Options.ServicesReferencesText" xml:space="preserve">
<value>Service References</value>
</data>
<data name="XML.TextAreaContextMenu.Reformat" xml:space="preserve">
<value>Reformat</value>
</data>
<data name="Global.Reset" xml:space="preserve">
<value>Reset</value>
</data>
<data name="Dialog.ProjectOptions.CustomTool.RunOnBuild" xml:space="preserve">
<value>Run on Build</value>
</data>
<data name="Dialog.ProjectOptions.CustomTool.Filenames" xml:space="preserve">
<value>Filenames:</value>
</data>
<data name="Debugger.Visualizers.ColumnPickerLabel" xml:space="preserve">
<value>Columns:</value>
</data>
<data name="Global.Shortcuts.Ctrl" xml:space="preserve">
<value>Ctrl</value>
</data>
<data name="Global.Shortcuts.Shift" xml:space="preserve">
<value>Shift</value>
</data>
<data name="Global.Shortcuts.Alt" xml:space="preserve">
<value>Alt</value>
</data>
<data name="Global.Shortcuts.Win" xml:space="preserve">
<value>Win</value>
</data>
<data name="AddIns.Debugger.Console.Clear" xml:space="preserve">
<value>Clear console</value>
</data>
<data name="AddIns.Debugger.Console.DeleteHistory" xml:space="preserve">
<value>Delete history</value>
</data>
<data name="MainWindow.Windows.OutputWindow.TextTooLong" xml:space="preserve">
<value>&lt;Text was truncated because it was too long&gt;</value>
</data>
<data name="MainWindow.CompilerMessages.BuildingProjectIsNotSupported" xml:space="preserve">
<value>Building project ${Name} is not supported.</value>
</data>
<data name="Dialog.AddServiceReference.ServicesLabel" xml:space="preserve">
<value>Services:</value>
</data>
<data name="Dialog.AddServiceReference.OperationsLabel" xml:space="preserve">
<value>Operations:</value>
</data>
<data name="AddIns.PackageManagement.Menu.ManagePackages" xml:space="preserve">
<value>Manage Packages...</value>
</data>
<data name="AddIns.PackageManagement.Menu.RestorePackages" xml:space="preserve">
<value>Restore Packages</value>
</data>
<data name="AddIns.PackageManagement.Options.Title" xml:space="preserve">
<value>Package Management</value>
</data>
<data name="AddIns.PackageManagement.Options.PackageSources" xml:space="preserve">
<value>Package Sources</value>
</data>
<data name="AddIns.PackageManagement.ConsolePad.Title" xml:space="preserve">
<value>Package Management Console</value>
</data>
<data name="Dialog.Options.IDEOptions.CodingOptions.CodeIssues.Title" xml:space="preserve">
<value>Code inspection</value>
</data>
<data name="Dialog.Options.IDEOptions.CodingOptions.CodeFormatting.Title" xml:space="preserve">
<value>Formatting</value>
</data>
<data name="CSharpBinding.Refactoring.InsertWithCursor.Description" xml:space="preserve">
<value>Use Up/Down to move to another location.
Press Enter to select the location.
Press Esc to cancel this operation.</value>
</data>
<data name="Dialog.AdvancedService.ClientHeader" xml:space="preserve">
<value>Client</value>
</data>
<data name="Dialog.AdvancedService.Client.GenerateAsyncOperations" xml:space="preserve">
<value>Generate asynchronous operations</value>
</data>
<data name="Dialog.AdvancedService.Client.AccessLevel.Public" xml:space="preserve">
<value>Public</value>
</data>
<data name="Dialog.AdvancedService.Client.AccessLevel.Internal" xml:space="preserve">
<value>Internal</value>
</data>
<data name="Dialog.AdvancedService.Client.AccessLevelLabel" xml:space="preserve">
<value>Access level for generated classes:</value>
</data>
<data name="SharpReport.Wizard.Welcome" xml:space="preserve">
<value>Welcome to the SharpReport Wizard</value>
</data>
<data name="SharpReport.Wizard.BaseSettings.Description" xml:space="preserve">
<value>Basic report settings</value>
</data>
<data name="SharpReport.Wizard.PushModel.SelectProject" xml:space="preserve">
<value>Classes in selected Project</value>
</data>
<data name="SharpReport.Wizard.PageLayout" xml:space="preserve">
<value>Page Layout </value>
</data>
<data name="SharpReport.Wizard.PushModel.NoProject" xml:space="preserve">
<value>No project selected, please enter FieldNames</value>
</data>
<data name="CSharpBinding.Refactoring.EventCreation.EventHandlerText" xml:space="preserve">
<value>&lt;Create ${HandlerName}&gt;</value>
</data>
</root> </root>

642
data/resources/StringResources.ru.resx

File diff suppressed because it is too large Load Diff

4
data/resources/languages/LanguageDefinition.xml

@ -14,9 +14,9 @@
<Languages name="French" code="fr" icon="france.png" /> <Languages name="French" code="fr" icon="france.png" />
<Languages name="German" code="de" icon="germany.png" /> <Languages name="German" code="de" icon="germany.png" />
<!--<Languages name="Greek" code="el" icon="notyetdone.png" />--> <!--<Languages name="Greek" code="el" icon="notyetdone.png" />-->
<!--<Languages name="Hungarian" code="hu" icon="hungary.png" />--> <Languages name="Hungarian" code="hu" icon="hungary.png" />
<Languages name="Italian" code="it" icon="italy.png" /> <Languages name="Italian" code="it" icon="italy.png" />
<!--<Languages name="Japanese" code="jp" icon="japan.png" />--> <Languages name="Japanese" code="jp" icon="japan.png" />
<Languages name="Korean" code="kr" icon="south_korea.png" /> <Languages name="Korean" code="kr" icon="south_korea.png" />
<!--<Languages name="Lithuanian" code="lt" icon="lithuania.png" />--> <!--<Languages name="Lithuanian" code="lt" icon="lithuania.png" />-->
<Languages name="Norwegian" code="no" icon="norway.png" /> <Languages name="Norwegian" code="no" icon="norway.png" />

5
src/AddIns/Analysis/CodeAnalysis/Src/AnalysisIdeOptionsPanel.xaml

@ -7,12 +7,11 @@
<GroupBox Header="{core:Localize ICSharpCode.CodeAnalysis.IdeOptions.FxCopPath}"> <GroupBox Header="{core:Localize ICSharpCode.CodeAnalysis.IdeOptions.FxCopPath}">
<StackPanel> <StackPanel>
<TextBlock Margin="3,5,3,20" x:Name="status" <TextBlock Margin="3,5,3,20" x:Name="status"
HorizontalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Center" TextWrapping="Wrap" />
Text="(showing current FxCop path)"></TextBlock>
<Button Content="{core:Localize ICSharpCode.CodeAnalysis.IdeOptions.FindFxCopPath}" <Button Content="{core:Localize ICSharpCode.CodeAnalysis.IdeOptions.FindFxCopPath}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Click="FindFxCopPath_Click" Click="FindFxCopPath_Click"
Style="{x:Static core:GlobalStyles.ButtonStyle}"></Button> Style="{x:Static core:GlobalStyles.ButtonStyle}" />
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>
</gui:OptionPanel> </gui:OptionPanel>

2
src/AddIns/Analysis/CodeAnalysis/Src/AnalysisProjectOptionsPanel.xaml.cs

@ -276,7 +276,7 @@ namespace ICSharpCode.CodeAnalysis
private void ChangeRuleAssembliesButtonClick( object sender, RoutedEventArgs e) private void ChangeRuleAssembliesButtonClick( object sender, RoutedEventArgs e)
{ {
var stringListDialog = new StringListEditorDialog(); var stringListDialog = new StringListEditorDialog();
stringListDialog.BrowseForDirectory = true; stringListDialog.ShowBrowse = true;
stringListDialog.TitleText = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.ChooseRuleAssemblyDirectory}"); stringListDialog.TitleText = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.ChooseRuleAssemblyDirectory}");
stringListDialog.LoadList(GetRuleAssemblyList(false)); stringListDialog.LoadList(GetRuleAssemblyList(false));
stringListDialog.ShowDialog(); stringListDialog.ShowDialog();

2
src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.addin

@ -130,7 +130,7 @@
</ComplexCondition> </ComplexCondition>
</Path> </Path>
<Path name = "/AddIns/DefaultTextEditor/CodeCompletion"> <Path name = "/SharpDevelop/ViewContent/TextEditor/CodeCompletion">
<CodeCompletionBinding id = "RazorCSharp" extensions = ".cshtml" class = "ICSharpCode.AspNet.Mvc.Completion.RazorCSharpCompletionBinding"/> <CodeCompletionBinding id = "RazorCSharp" extensions = ".cshtml" class = "ICSharpCode.AspNet.Mvc.Completion.RazorCSharpCompletionBinding"/>
</Path> </Path>

10
src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj

@ -134,14 +134,9 @@
<Compile Include="Src\AddMvcViewToProjectViewModel.cs" /> <Compile Include="Src\AddMvcViewToProjectViewModel.cs" />
<Compile Include="Src\BooleanToVisibilityConverter.cs" /> <Compile Include="Src\BooleanToVisibilityConverter.cs" />
<Compile Include="Src\CloseDialogBehaviour.cs" /> <Compile Include="Src\CloseDialogBehaviour.cs" />
<Compile Include="Src\Completion\RazorCompilationUnit.cs" />
<Compile Include="Src\Completion\RazorCSharpCompletionBinding.cs" /> <Compile Include="Src\Completion\RazorCSharpCompletionBinding.cs" />
<Compile Include="Src\Completion\RazorCSharpDotCompletionDataProvider.cs" />
<Compile Include="Src\Completion\RazorCSharpExpressionFinder.cs" />
<Compile Include="Src\Completion\RazorCSharpModelTypeLocater.cs" /> <Compile Include="Src\Completion\RazorCSharpModelTypeLocater.cs" />
<Compile Include="Src\Completion\RazorCSharpParser.cs" />
<Compile Include="Src\Completion\RazorCSharpParserModelTypeVisitor.cs" /> <Compile Include="Src\Completion\RazorCSharpParserModelTypeVisitor.cs" />
<Compile Include="Src\Completion\RazorCSharpResolver.cs" />
<Compile Include="Src\CurrentAppDomain.cs" /> <Compile Include="Src\CurrentAppDomain.cs" />
<Compile Include="Src\CurrentAppDomainFactory.cs" /> <Compile Include="Src\CurrentAppDomainFactory.cs" />
<Compile Include="Src\Folding\CharacterReader.cs" /> <Compile Include="Src\Folding\CharacterReader.cs" />
@ -285,6 +280,11 @@
<Name>ICSharpCode.AvalonEdit</Name> <Name>ICSharpCode.AvalonEdit</Name>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
<Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
<Name>ICSharpCode.NRefactory.CSharp</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj"> <ProjectReference Include="..\..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project> <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name> <Name>ICSharpCode.NRefactory</Name>

170
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpCompletionBinding.cs

@ -16,27 +16,149 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
//using System; using System;
//using ICSharpCode.SharpDevelop.Editor; using System.IO;
//using ICSharpCode.SharpDevelop.Editor.CodeCompletion; using System.Web.Razor;
// using ICSharpCode.NRefactory;
//namespace ICSharpCode.AspNet.Mvc.Completion using ICSharpCode.NRefactory.CSharp;
//{ using ICSharpCode.NRefactory.CSharp.Resolver;
// public class RazorCSharpCompletionBinding : DefaultCodeCompletionBinding using ICSharpCode.NRefactory.CSharp.TypeSystem;
// { using ICSharpCode.NRefactory.Editor;
// public RazorCSharpCompletionBinding() using ICSharpCode.NRefactory.TypeSystem;
// { using ICSharpCode.NRefactory.TypeSystem.Implementation;
// } using ICSharpCode.SharpDevelop;
// using ICSharpCode.SharpDevelop.Editor;
// public override CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch) using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
// {
// if (ch == '.') { namespace ICSharpCode.AspNet.Mvc.Completion
// new RazorCSharpDotCompletionDataProvider().ShowCompletion(editor); {
// return CodeCompletionKeyPressResult.Completed; public class RazorCSharpCompletionBinding : ICodeCompletionBinding
// } else if (ch == '(') { {
// return base.HandleKeyPress(editor, ch); public bool HandleKeyPressed(ITextEditor editor, char ch)
// } {
// return CodeCompletionKeyPressResult.None; if (ch == '.') {
// } var binding = CreateBinding(editor);
// } return binding.HandleKeyPressed(editor, ch);
//} }
return false;
}
public bool CtrlSpace(ITextEditor editor)
{
return false;
}
public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch)
{
// We use HandleKeyPressed instead.
return CodeCompletionKeyPressResult.None;
}
ICodeCompletionBinding CreateBinding(ITextEditor editor)
{
return SD.LanguageService.GetLanguageByExtension(".cs")
.CreateCompletionBinding(FindExpressionToComplete(editor), CreateContext(editor));
}
string FindExpressionToComplete(ITextEditor editor)
{
int endOffset = editor.Caret.Offset;
int startOffset = endOffset;
while (startOffset > 0 && IsValidCharacter(editor.Document.GetCharAt(startOffset - 1)))
startOffset--;
return editor.Document.GetText(startOffset, endOffset - startOffset);
}
bool IsValidCharacter(char ch)
{
return Char.IsLetterOrDigit(ch) ||
(ch == '.') ||
(ch == '_');
}
ICodeContext CreateContext(ITextEditor editor)
{
var compilation = SD.ParserService.GetCompilationForFile(editor.FileName);
var project = SD.ProjectService.FindProjectContainingFile(editor.FileName);
var resolveContext = new SimpleTypeResolveContext(compilation.MainAssembly);
var currentTypeDefinition = new DefaultUnresolvedTypeDefinition(project.RootNamespace, Path.GetFileNameWithoutExtension(editor.FileName));
ITypeReference baseTypeReference = new GetClassTypeReference("System.Web.Mvc", "WebViewPage", 1);
baseTypeReference = new ParameterizedTypeReference(baseTypeReference, new[] { FindModelType(editor) });
currentTypeDefinition.BaseTypes.Add(baseTypeReference);
var currentMethod = new DefaultUnresolvedMethod(currentTypeDefinition, "__ContextStub__");
currentMethod.ReturnType = KnownTypeReference.Void;
currentTypeDefinition.Members.Add(currentMethod);
var currentResolvedTypeDef = new DefaultResolvedTypeDefinition(resolveContext, currentTypeDefinition);
var projectContent = compilation.MainAssembly.UnresolvedAssembly as IProjectContent;
var currentFile = new CSharpUnresolvedFile();
currentFile.RootUsingScope.AddSimpleUsing("System.Web.Mvc");
currentFile.RootUsingScope.AddSimpleUsing("System.Web.Mvc.Ajax");
currentFile.RootUsingScope.AddSimpleUsing("System.Web.Mvc.Html");
currentFile.RootUsingScope.AddSimpleUsing("System.Web.Routing");
currentFile.TopLevelTypeDefinitions.Add(currentTypeDefinition);
if (projectContent != null) {
compilation = projectContent.AddOrUpdateFiles(currentFile).CreateCompilation(SD.ParserService.GetCurrentSolutionSnapshot());
}
var context = new CSharpTypeResolveContext(compilation.MainAssembly,
currentFile.RootUsingScope.Resolve(compilation),
currentResolvedTypeDef,
currentMethod.CreateResolved(resolveContext.WithCurrentTypeDefinition(currentResolvedTypeDef)));
return new CSharpResolver(context);
}
ITypeReference FindModelType(ITextEditor editor)
{
ParserResults results = ParseTemplate(editor.Document);
string typeName = GetModelTypeName(results);
if (string.IsNullOrWhiteSpace(typeName))
return KnownTypeReference.Object;
return new CSharpParser().ParseTypeReference(typeName)
.ToTypeReference(NameLookupMode.BaseTypeReference);
}
ParserResults ParseTemplate(ITextSource textBuffer)
{
var host = new RazorEngineHost(new CSharpRazorCodeLanguage());
var engine = new RazorTemplateEngine(host);
return engine.ParseTemplate(textBuffer.CreateReader());
}
string GetModelTypeName(ParserResults results)
{
var visitor = new RazorCSharpParserModelTypeVisitor();
results.Document.Accept(visitor);
return visitor.ModelTypeName;
}
}
static class NRUtils
{
/// <remarks>Does not support type arguments!</remarks>
public static void AddSimpleUsing(this UsingScope scope, string fullName)
{
if (scope == null)
throw new ArgumentNullException("scope");
string[] parts = fullName.Trim().Split('.');
TypeOrNamespaceReference reference = null;
foreach (var part in parts) {
if (reference != null) {
reference = new MemberTypeOrNamespaceReference(reference, part, EmptyList<ITypeReference>.Instance);
} else {
reference = new SimpleTypeOrNamespaceReference(part, EmptyList<ITypeReference>.Instance);
}
}
scope.Usings.AddIfNotNull(reference);
}
}
}

26
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpDotCompletionDataProvider.cs

@ -1,26 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//using System;
//
//namespace ICSharpCode.AspNet.Mvc.Completion
//{
// public class RazorCSharpDotCompletionDataProvider : DotCodeCompletionItemProvider
// {
// }
//}

58
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpExpressionFinder.cs

@ -1,58 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//using System;
//using ICSharpCode.SharpDevelop.Dom;
//
//namespace ICSharpCode.AspNet.Mvc.Completion
//{
// public class RazorCSharpExpressionFinder : IExpressionFinder
// {
// public RazorCSharpExpressionFinder()
// {
// }
//
// public ExpressionResult FindExpression(string text, int offset)
// {
// int position = offset - 1;
// while (position > 0 && IsValidCharacter(text[position])) {
// position--;
// }
// position++;
// string expression = text.Substring(position, offset - position);
// return new ExpressionResult(expression);
// }
//
// bool IsValidCharacter(char ch)
// {
// return Char.IsLetterOrDigit(ch) ||
// (ch == '.') ||
// (ch == '_');
// }
//
// public ExpressionResult FindFullExpression(string text, int offset)
// {
// return ExpressionResult.Empty;
// }
//
// public string RemoveLastPart(string expression)
// {
// return expression;
// }
// }
//}

62
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpModelTypeLocater.cs

@ -16,34 +16,34 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
//using System; using System;
//using System.Web.Razor; using System.Web.Razor;
//using ICSharpCode.SharpDevelop; using ICSharpCode.NRefactory.Editor;
//
//namespace ICSharpCode.AspNet.Mvc.Completion namespace ICSharpCode.AspNet.Mvc.Completion
//{ {
// public class RazorCSharpModelTypeLocater public class RazorCSharpModelTypeLocater
// { {
// public RazorCSharpModelTypeLocater(ITextBuffer textBuffer) public RazorCSharpModelTypeLocater(ITextSource textBuffer)
// { {
// ParserResults results = ParseTemplate(textBuffer); ParserResults results = ParseTemplate(textBuffer);
// ModelTypeName = GetModelTypeName(results); ModelTypeName = GetModelTypeName(results);
// } }
//
// ParserResults ParseTemplate(ITextBuffer textBuffer) ParserResults ParseTemplate(ITextSource textBuffer)
// { {
// var host = new RazorEngineHost(new CSharpRazorCodeLanguage()); var host = new RazorEngineHost(new CSharpRazorCodeLanguage());
// var engine = new RazorTemplateEngine(host); var engine = new RazorTemplateEngine(host);
// return engine.ParseTemplate(textBuffer.CreateReader()); return engine.ParseTemplate(textBuffer.CreateReader());
// } }
//
// string GetModelTypeName(ParserResults results) string GetModelTypeName(ParserResults results)
// { {
// var visitor = new RazorCSharpParserModelTypeVisitor(); var visitor = new RazorCSharpParserModelTypeVisitor();
// results.Document.Accept(visitor); results.Document.Accept(visitor);
// return visitor.ModelTypeName; return visitor.ModelTypeName;
// } }
//
// public string ModelTypeName { get; private set; } public string ModelTypeName { get; private set; }
// } }
//} }

68
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpParser.cs

@ -1,68 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//using System;
//using System.IO;
//using ICSharpCode.SharpDevelop;
//using ICSharpCode.SharpDevelop.Dom;
//using ICSharpCode.SharpDevelop.Dom.CSharp;
//using ICSharpCode.SharpDevelop.Project;
//
//namespace ICSharpCode.AspNet.Mvc.Completion
//{
// public class RazorCSharpParser : IParser
// {
// public RazorCSharpParser()
// {
// }
//
// public string[] LexerTags { get; set; }
//
// public LanguageProperties Language {
// get { return LanguageProperties.CSharp; }
// }
//
// public IExpressionFinder CreateExpressionFinder(string fileName)
// {
// return new RazorCSharpExpressionFinder();
// }
//
// public bool CanParse(string fileName)
// {
// return Path.GetExtension(fileName).Equals(".cshtml", StringComparison.OrdinalIgnoreCase);
// }
//
// public bool CanParse(IProject project)
// {
// return project.Language == "C#";
// }
//
// public ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent)
// {
// var modelTypeLocater = new RazorCSharpModelTypeLocater(fileContent);
// return new RazorCompilationUnit(projectContent) {
// ModelTypeName = modelTypeLocater.ModelTypeName
// };
// }
//
// public IResolver CreateResolver()
// {
// return new RazorCSharpResolver();
// }
// }
//}

119
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCSharpResolver.cs

@ -1,119 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//using System;
//using System.Collections.Generic;
//using ICSharpCode.NRefactory.TypeSystem;
//
//namespace ICSharpCode.AspNet.Mvc.Completion
//{
// public class RazorCSharpResolver : IResolver
// {
// NRefactoryResolver resolver = new NRefactoryResolver(LanguageProperties.CSharp);
//
// public ResolveResult Resolve(ExpressionResult expressionResult, ParseInformation parseInfo, string fileContent)
// {
// ParseInformation parseInfoWithWebViewPageClass = CreateParseInformationWithWebViewPageClass(parseInfo);
// expressionResult.Region = GetRegionInMiddleOfWebViewPageClass();
// return resolver.Resolve(expressionResult, parseInfoWithWebViewPageClass, fileContent);
// }
//
// ParseInformation CreateParseInformationWithWebViewPageClass(ParseInformation parseInfo)
// {
// RazorCompilationUnit compilationUnit = RazorCompilationUnit.CreateFromParseInfo(parseInfo);
// AddDefaultUsings(compilationUnit);
// AddWebViewPageClass(compilationUnit);
// return new ParseInformation(compilationUnit);
// }
//
// void AddDefaultUsings(ICompilationUnit compilationUnit)
// {
// AddUsing("System.Web.Mvc", compilationUnit);
// AddUsing("System.Web.Mvc.Ajax", compilationUnit);
// AddUsing("System.Web.Mvc.Html", compilationUnit);
// AddUsing("System.Web.Routing", compilationUnit);
// }
//
// void AddUsing(string name, ICompilationUnit compilationUnit)
// {
// DefaultUsing defaultUsing = CreateUsing(name, compilationUnit.ProjectContent);
// compilationUnit.UsingScope.Usings.Add(defaultUsing);
// }
//
// DefaultUsing CreateUsing(string namespaceName, IProjectContent projectContent)
// {
// var defaultUsing = new DefaultUsing(projectContent);
// defaultUsing.Usings.Add(namespaceName);
// return defaultUsing;
// }
//
// void AddWebViewPageClass(RazorCompilationUnit compilationUnit)
// {
// DefaultClass webViewPageClass = CreateWebViewPageClass(compilationUnit);
// compilationUnit.Classes.Add(webViewPageClass);
// }
//
// DefaultClass CreateWebViewPageClass(RazorCompilationUnit compilationUnit)
// {
// var webViewPageClass = new DefaultClass(compilationUnit, "RazorWebViewPage") {
// Region = new DomRegion(1, 0, 3, 0)
// };
// IReturnType modelType = GetModelReturnType(compilationUnit);
// AddWebViewPageBaseClass(webViewPageClass, modelType);
// return webViewPageClass;
// }
//
// IReturnType GetModelReturnType(RazorCompilationUnit compilationUnit)
// {
// IClass modelType = GetClassIfTypeNameIsNotEmpty(compilationUnit.ProjectContent, compilationUnit.ModelTypeName);
// if (modelType != null) {
// return modelType.DefaultReturnType;
// }
// return new DynamicReturnType(compilationUnit.ProjectContent);
// }
//
// IClass GetClassIfTypeNameIsNotEmpty(IProjectContent projectContent, string modelTypeName)
// {
// if (!String.IsNullOrEmpty(modelTypeName)) {
// return projectContent.GetClass(modelTypeName, 0);
// }
// return null;
// }
//
// void AddWebViewPageBaseClass(DefaultClass webViewPageClass, IReturnType modelType)
// {
// IClass webViewPageBaseClass = webViewPageClass.ProjectContent.GetClass("System.Web.Mvc.WebViewPage", 1);
// if (webViewPageBaseClass != null) {
// IReturnType returnType = GetWebViewPageBaseClassReturnType(webViewPageBaseClass, modelType);
// webViewPageClass.BaseTypes.Add(returnType);
// }
// }
//
// IReturnType GetWebViewPageBaseClassReturnType(IClass webViewPageBaseClass, IReturnType modelType)
// {
// var typeArguments = new List<IReturnType>();
// typeArguments.Add(modelType);
// return new ConstructedReturnType(webViewPageBaseClass.DefaultReturnType, typeArguments);
// }
//
// DomRegion GetRegionInMiddleOfWebViewPageClass()
// {
// return new DomRegion(2, 0, 2, 0);
// }
// }
//}

50
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/Completion/RazorCompilationUnit.cs

@ -1,50 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//using System;
//using ICSharpCode.NRefactory.TypeSystem;
//using ICSharpCode.SharpDevelop.Parser;
//
//namespace ICSharpCode.AspNet.Mvc.Completion
//{
// public class RazorCompilationUnit : DefaultCompilationUnit
// {
// public RazorCompilationUnit(IProjectContent projectContent)
// : base(projectContent)
// {
// }
//
// public static RazorCompilationUnit CreateFromParseInfo(ParseInformation parseInformation)
// {
// return new RazorCompilationUnit(parseInformation.CompilationUnit.ProjectContent) {
// ModelTypeName = GetModelTypeName(parseInformation.CompilationUnit)
// };
// }
//
// static string GetModelTypeName(ICompilationUnit compilationUnit)
// {
// var originalRazorCompilationUnit = compilationUnit as RazorCompilationUnit;
// if (originalRazorCompilationUnit != null) {
// return originalRazorCompilationUnit.ModelTypeName;
// }
// return String.Empty;
// }
//
// public string ModelTypeName { get; set; }
// }
//}

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

@ -148,11 +148,11 @@
insertafter = "Highlighting" insertafter = "Highlighting"
label = "C#"> label = "C#">
<OptionPanel id="Issues" <OptionPanel id="Issues"
label="Code inspection" label="${res:Dialog.Options.IDEOptions.CodingOptions.CodeIssues.Title}"
class="CSharpBinding.Refactoring.IssueOptions"/> class="CSharpBinding.Refactoring.IssueOptions"/>
<ContextActionOptionPanel id="ContextActions" path="/SharpDevelop/ViewContent/TextEditor/C#/ContextActions"/> <ContextActionOptionPanel id="ContextActions" path="/SharpDevelop/ViewContent/TextEditor/C#/ContextActions"/>
<OptionPanel id="Formatting" <OptionPanel id="Formatting"
label="Formatting" label="${res:Dialog.Options.IDEOptions.CodingOptions.CodeFormatting.Title}"
class="CSharpBinding.OptionPanels.CSharpGlobalFormattingOptionPanel"/> class="CSharpBinding.OptionPanels.CSharpGlobalFormattingOptionPanel"/>
</OptionPanel> </OptionPanel>
</Path> </Path>
@ -165,7 +165,7 @@
<Path path = "/SharpDevelop/Workbench/MainMenu/Search"> <Path path = "/SharpDevelop/Workbench/MainMenu/Search">
<MenuItem id = "SearchForIssues" <MenuItem id = "SearchForIssues"
label="Search For Issues..." label="${res:XML.MainMenu.SearchMenu.SearchForIssues}"
class="CSharpBinding.Refactoring.SearchForIssuesCommand"/> class="CSharpBinding.Refactoring.SearchForIssuesCommand"/>
</Path> </Path>

1
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj

@ -78,6 +78,7 @@
<Compile Include="Src\Completion\CSharpCompletionContext.cs" /> <Compile Include="Src\Completion\CSharpCompletionContext.cs" />
<Compile Include="Src\Completion\CSharpInsightItem.cs" /> <Compile Include="Src\Completion\CSharpInsightItem.cs" />
<Compile Include="Src\Completion\CSharpMethodInsight.cs" /> <Compile Include="Src\Completion\CSharpMethodInsight.cs" />
<Compile Include="Src\Completion\EnumMemberCompletionData.cs" />
<Compile Include="Src\Completion\EventCreationCompletionData.cs" /> <Compile Include="Src\Completion\EventCreationCompletionData.cs" />
<Compile Include="Src\Completion\FormatItemCompletionData.cs" /> <Compile Include="Src\Completion\FormatItemCompletionData.cs" />
<Compile Include="Src\Completion\ImportCompletionData.cs" /> <Compile Include="Src\Completion\ImportCompletionData.cs" />

4
src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd

@ -32,7 +32,11 @@
<!-- Colors used for semantic highlighting --> <!-- Colors used for semantic highlighting -->
<Color name="ReferenceTypes" foreground="#004085" exampleText="System.#{#Uri#}# uri;"/> <Color name="ReferenceTypes" foreground="#004085" exampleText="System.#{#Uri#}# uri;"/>
<Color name="InterfaceTypes" foreground="#004085" exampleText="System.#{#IDisposable#}# obj;"/>
<Color name="TypeParameters" foreground="#004085" exampleText="class MyList&lt;#{#T#}#&gt; { }"/>
<Color name="DelegateTypes" foreground="#004085" exampleText="System.#{#Action#}#; action;"/>
<Color name="ValueTypes" fontWeight="bold" foreground="#004085" exampleText="System.#{#DateTime#}# date;"/> <Color name="ValueTypes" fontWeight="bold" foreground="#004085" exampleText="System.#{#DateTime#}# date;"/>
<Color name="EnumTypes" fontWeight="bold" foreground="#004085" exampleText="System.#{#ConsoleKey#}# key;"/>
<Color name="MethodCall" foreground="MidnightBlue" fontWeight="bold" exampleText="o.#{#ToString#}#();"/> <Color name="MethodCall" foreground="MidnightBlue" fontWeight="bold" exampleText="o.#{#ToString#}#();"/>
<Color name="FieldAccess" fontStyle="italic" exampleText="return this.#{#name#}#;"/> <Color name="FieldAccess" fontStyle="italic" exampleText="return this.#{#name#}#;"/>
<Color name="InactiveCode" foreground="Gray" exampleText="#{#Deactivated by #if#}#"/> <Color name="InactiveCode" foreground="Gray" exampleText="#{#Deactivated by #if#}#"/>

29
src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpLanguageBinding.cs

@ -55,35 +55,26 @@ namespace CSharpBinding
this.container.AddService(typeof(System.CodeDom.Compiler.CodeDomProvider), new Microsoft.CSharp.CSharpCodeProvider()); this.container.AddService(typeof(System.CodeDom.Compiler.CodeDomProvider), new Microsoft.CSharp.CSharpCodeProvider());
} }
public override ICodeCompletionBinding CreateCompletionBinding(string expressionToComplete, FileName fileName, TextLocation location, ICodeContext context) public override ICodeCompletionBinding CreateCompletionBinding(string expressionToComplete, ICodeContext context)
{ {
if (fileName == null)
throw new ArgumentNullException("fileName");
if (context == null) if (context == null)
throw new ArgumentNullException("context"); throw new ArgumentNullException("context");
string content = GeneratePartialClassContextStub(fileName, location, context); string content = GeneratePartialClassContextStub(context);
const string caretPoint = "$__Caret_Point__$;"; const string caretPoint = "$__Caret_Point__$;";
int caretOffset = content.IndexOf(caretPoint, StringComparison.Ordinal) + expressionToComplete.Length; int caretOffset = content.IndexOf(caretPoint, StringComparison.Ordinal) + expressionToComplete.Length;
SD.Log.DebugFormatted("context used for dot completion: {0}", content.Replace(caretPoint, "$" + expressionToComplete + "|$")); SD.Log.DebugFormatted("context used for dot completion: {0}", content.Replace(caretPoint, "$" + expressionToComplete + "|$"));
var doc = new ReadOnlyDocument(content.Replace(caretPoint, expressionToComplete)); var doc = new ReadOnlyDocument(content.Replace(caretPoint, expressionToComplete));
return new CSharpCompletionBinding(fileName, doc.GetLocation(caretOffset), doc.CreateSnapshot()); return new CSharpCompletionBinding(context, doc.GetLocation(caretOffset), doc.CreateSnapshot());
} }
static string GeneratePartialClassContextStub(FileName fileName, TextLocation location, ICodeContext context) static string GeneratePartialClassContextStub(ICodeContext context)
{ {
var compilation = SD.ParserService.GetCompilationForFile(fileName); var member = context.CurrentMember;
var file = SD.ParserService.GetExistingUnresolvedFile(fileName);
if (compilation == null || file == null)
return "";
var unresolvedMember = file.GetMember(location);
if (unresolvedMember == null)
return "";
var member = unresolvedMember.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly));
if (member == null) if (member == null)
return ""; return "";
var builder = new TypeSystemAstBuilder(); var builder = new TypeSystemAstBuilder();
MethodDeclaration decl; MethodDeclaration decl;
if (unresolvedMember is IMethod) { if (member.SymbolKind == SymbolKind.Method) {
// If it's a method, convert it directly (including parameters + type parameters) // If it's a method, convert it directly (including parameters + type parameters)
decl = (MethodDeclaration)builder.ConvertEntity(member); decl = (MethodDeclaration)builder.ConvertEntity(member);
} else { } else {
@ -97,11 +88,11 @@ namespace CSharpBinding
} }
decl.Name = "__DebuggerStub__"; decl.Name = "__DebuggerStub__";
decl.ReturnType = builder.ConvertType(member.ReturnType); decl.ReturnType = builder.ConvertType(member.ReturnType);
decl.Modifiers = unresolvedMember.IsStatic ? Modifiers.Static : Modifiers.None; decl.Modifiers = member.IsStatic ? Modifiers.Static : Modifiers.None;
// Make the method look like an explicit interface implementation so that it doesn't appear in CC // Make the method look like an explicit interface implementation so that it doesn't appear in CC
decl.PrivateImplementationType = new SimpleType("__DummyType__"); decl.PrivateImplementationType = new SimpleType("__DummyType__");
decl.Body = GenerateBodyFromContext(builder, context.LocalVariables.ToArray()); decl.Body = GenerateBodyFromContext(builder, context.LocalVariables.ToArray());
return WrapInType(unresolvedMember.DeclaringTypeDefinition, decl).ToString(); return WrapInType(context.CurrentTypeDefinition, decl).ToString();
} }
static BlockStatement GenerateBodyFromContext(TypeSystemAstBuilder builder, IVariable[] variables) static BlockStatement GenerateBodyFromContext(TypeSystemAstBuilder builder, IVariable[] variables)
@ -113,7 +104,7 @@ namespace CSharpBinding
return body; return body;
} }
static AstNode WrapInType(IUnresolvedTypeDefinition entity, EntityDeclaration decl) static AstNode WrapInType(ITypeDefinition entity, EntityDeclaration decl)
{ {
if (entity == null) if (entity == null)
return decl; return decl;
@ -137,7 +128,7 @@ namespace CSharpBinding
}; };
} }
static ClassType GetClassType(IUnresolvedTypeDefinition entity) static ClassType GetClassType(ITypeDefinition entity)
{ {
switch (entity.Kind) { switch (entity.Kind) {
case TypeKind.Interface: case TypeKind.Interface:

8
src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighterVisitor.cs

@ -58,10 +58,10 @@ namespace CSharpBinding
//this.defaultTextColor = ???; //this.defaultTextColor = ???;
this.referenceTypeColor = highlighting.GetNamedColor("ReferenceTypes"); this.referenceTypeColor = highlighting.GetNamedColor("ReferenceTypes");
this.valueTypeColor = highlighting.GetNamedColor("ValueTypes"); this.valueTypeColor = highlighting.GetNamedColor("ValueTypes");
this.interfaceTypeColor = this.referenceTypeColor; this.interfaceTypeColor = highlighting.GetNamedColor("InterfaceTypes");
this.enumerationTypeColor = this.valueKeywordColor; this.enumerationTypeColor = highlighting.GetNamedColor("EnumTypes");
this.typeParameterTypeColor = this.referenceTypeColor; this.typeParameterTypeColor = highlighting.GetNamedColor("TypeParameters");
this.delegateTypeColor = this.referenceTypeColor; this.delegateTypeColor = highlighting.GetNamedColor("DelegateType");
this.methodDeclarationColor = this.methodCallColor = highlighting.GetNamedColor("MethodCall"); this.methodDeclarationColor = this.methodCallColor = highlighting.GetNamedColor("MethodCall");
//this.eventDeclarationColor = this.eventAccessColor = defaultTextColor; //this.eventDeclarationColor = this.eventAccessColor = defaultTextColor;
//this.propertyDeclarationColor = this.propertyAccessColor = defaultTextColor; //this.propertyDeclarationColor = this.propertyAccessColor = defaultTextColor;

13
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs

@ -18,6 +18,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using ICSharpCode.Core; using ICSharpCode.Core;
@ -26,6 +27,7 @@ using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.Completion; using ICSharpCode.NRefactory.Completion;
using ICSharpCode.NRefactory.CSharp.Completion; using ICSharpCode.NRefactory.CSharp.Completion;
using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion; using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
@ -35,7 +37,7 @@ namespace CSharpBinding.Completion
{ {
public class CSharpCompletionBinding : ICodeCompletionBinding public class CSharpCompletionBinding : ICodeCompletionBinding
{ {
FileName contextFileName; ICodeContext context;
TextLocation currentLocation; TextLocation currentLocation;
ITextSource fileContent; ITextSource fileContent;
@ -44,9 +46,9 @@ namespace CSharpBinding.Completion
{ {
} }
public CSharpCompletionBinding(FileName contextFileName, TextLocation currentLocation, ITextSource fileContent) public CSharpCompletionBinding(ICodeContext context, TextLocation currentLocation, ITextSource fileContent)
{ {
this.contextFileName = contextFileName; this.context = context;
this.currentLocation = currentLocation; this.currentLocation = currentLocation;
this.fileContent = fileContent; this.fileContent = fileContent;
} }
@ -75,7 +77,7 @@ namespace CSharpBinding.Completion
if (fileContent == null) { if (fileContent == null) {
completionContext = CSharpCompletionContext.Get(editor); completionContext = CSharpCompletionContext.Get(editor);
} else { } else {
completionContext = CSharpCompletionContext.Get(editor, fileContent, currentLocation, contextFileName); completionContext = CSharpCompletionContext.Get(editor, context, currentLocation, fileContent);
} }
if (completionContext == null) if (completionContext == null)
return false; return false;
@ -114,6 +116,7 @@ namespace CSharpBinding.Completion
} else { } else {
startPos = caretOffset; startPos = caretOffset;
if (char.IsLetterOrDigit (completionChar) || completionChar == '_') { if (char.IsLetterOrDigit (completionChar) || completionChar == '_') {
if (!CodeCompletionOptions.CompleteWhenTyping) return false;
if (startPos > 1 && char.IsLetterOrDigit (completionContext.Document.GetCharAt (startPos - 2))) if (startPos > 1 && char.IsLetterOrDigit (completionContext.Document.GetCharAt (startPos - 2)))
return false; return false;
completionData = cce.GetCompletionData(startPos, false); completionData = cce.GetCompletionData(startPos, false);
@ -136,7 +139,7 @@ namespace CSharpBinding.Completion
return true; return true;
} }
if (!ctrlSpace) { if (CodeCompletionOptions.InsightEnabled && !ctrlSpace) {
// Method Insight // Method Insight
var pce = new CSharpParameterCompletionEngine( var pce = new CSharpParameterCompletionEngine(
completionContext.Document, completionContext.Document,

24
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionContext.cs

@ -61,38 +61,24 @@ namespace CSharpBinding.Completion
return new CSharpCompletionContext(editor, parseInfo.SyntaxTree.ConditionalSymbols, compilation, projectContent, editor.Document, parseInfo.UnresolvedFile, editor.Caret.Location); return new CSharpCompletionContext(editor, parseInfo.SyntaxTree.ConditionalSymbols, compilation, projectContent, editor.Document, parseInfo.UnresolvedFile, editor.Caret.Location);
} }
public static CSharpCompletionContext Get(ITextEditor editor, ITextSource fileContent, TextLocation currentLocation, FileName fileName) public static CSharpCompletionContext Get(ITextEditor editor, ICodeContext context, TextLocation currentLocation, ITextSource fileContent)
{ {
IDocument document = new ReadOnlyDocument(fileContent); IDocument document = new ReadOnlyDocument(fileContent);
// Don't require the very latest parse information, an older cached version is OK. var projectContent = context.Compilation.MainAssembly.UnresolvedAssembly as IProjectContent;
var parseInfo = SD.ParserService.GetCachedParseInformation(fileName) as CSharpFullParseInformation;
if (parseInfo == null) {
parseInfo = SD.ParserService.Parse(fileName) as CSharpFullParseInformation;
}
if (parseInfo == null)
return null;
var project = SD.ProjectService.FindProjectContainingFile(fileName)as CSharpProject;
if (project == null)
return null;
var solutionSnapshot = SD.ParserService.GetCurrentSolutionSnapshot();
var projectContent = solutionSnapshot.GetProjectContent(project);
if (projectContent == null) if (projectContent == null)
return null; return null;
CSharpParser parser = new CSharpParser(project.CompilerSettings); CSharpParser parser = new CSharpParser();
parser.GenerateTypeSystemMode = false; parser.GenerateTypeSystemMode = false;
SyntaxTree cu = parser.Parse(fileContent, Path.GetRandomFileName() + ".cs"); SyntaxTree cu = parser.Parse(fileContent, Path.GetRandomFileName() + ".cs");
cu.Freeze(); cu.Freeze();
CSharpUnresolvedFile unresolvedFile = cu.ToTypeSystem(); CSharpUnresolvedFile unresolvedFile = cu.ToTypeSystem();
ICompilation compilation = projectContent.AddOrUpdateFiles(unresolvedFile).CreateCompilation(solutionSnapshot); ICompilation compilation = projectContent.AddOrUpdateFiles(unresolvedFile).CreateCompilation(SD.ParserService.GetCurrentSolutionSnapshot());
return new CSharpCompletionContext(editor, parseInfo.SyntaxTree.ConditionalSymbols, compilation, projectContent, document, unresolvedFile, currentLocation); return new CSharpCompletionContext(editor, EmptyList<string>.Instance, compilation, projectContent, document, unresolvedFile, currentLocation);
} }
private CSharpCompletionContext(ITextEditor editor, IList<string> conditionalSymbols, ICompilation compilation, IProjectContent projectContent, IDocument document, CSharpUnresolvedFile unresolvedFile, TextLocation caretLocation) private CSharpCompletionContext(ITextEditor editor, IList<string> conditionalSymbols, ICompilation compilation, IProjectContent projectContent, IDocument document, CSharpUnresolvedFile unresolvedFile, TextLocation caretLocation)

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs

@ -86,8 +86,7 @@ namespace CSharpBinding.Completion
ICompletionData ICompletionDataFactory.CreateMemberCompletionData(IType type, IEntity member) ICompletionData ICompletionDataFactory.CreateMemberCompletionData(IType type, IEntity member)
{ {
string typeName = builder.ConvertType(type).ToString(); return new EnumMemberCompletionData(type, member, builder);
return new CompletionData(typeName + "." + member.Name);
} }
ICompletionData ICompletionDataFactory.CreateLiteralCompletionData(string title, string description, string insertText) ICompletionData ICompletionDataFactory.CreateLiteralCompletionData(string title, string description, string insertText)

3
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CompletionData.cs

@ -78,13 +78,14 @@ namespace CSharpBinding.Completion
public IImage Image { get; set; } public IImage Image { get; set; }
public virtual double Priority { public virtual double Priority {
get { return 0; } get { return CodeCompletionDataUsageCache.GetPriority(DisplayText, true); }
} }
public virtual void Complete(CompletionContext context) public virtual void Complete(CompletionContext context)
{ {
context.Editor.Document.Replace(context.StartOffset, context.Length, this.CompletionText); context.Editor.Document.Replace(context.StartOffset, context.Length, this.CompletionText);
context.EndOffset = context.StartOffset + this.CompletionText.Length; context.EndOffset = context.StartOffset + this.CompletionText.Length;
CodeCompletionDataUsageCache.IncrementUsage(DisplayText);
} }
object fancyContent; object fancyContent;

5
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs

@ -37,14 +37,15 @@ namespace CSharpBinding.Completion
public EntityCompletionData(IEntity entity) : base(entity.Name) public EntityCompletionData(IEntity entity) : base(entity.Name)
{ {
this.entity = entity; this.entity = entity;
this.Description = entity.Documentation;
this.Image = ClassBrowserIconService.GetIcon(entity); this.Image = ClassBrowserIconService.GetIcon(entity);
// don't set this.Description -- we use CreateFancyDescription() instead,
// and accessing entity.Documentation in the constructor is too slow
} }
protected override object CreateFancyDescription() protected override object CreateFancyDescription()
{ {
return new FlowDocumentScrollViewer { return new FlowDocumentScrollViewer {
Document = XmlDocFormatter.CreateTooltip(entity, false), Document = XmlDocFormatter.CreateTooltip(entity, entity is ITypeDefinition),
VerticalScrollBarVisibility = ScrollBarVisibility.Auto VerticalScrollBarVisibility = ScrollBarVisibility.Auto
}; };
} }

34
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyLanguageBinding.cs → src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EnumMemberCompletionData.cs

@ -17,20 +17,36 @@
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System; using System;
using System.Linq;
using System.Windows.Controls;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
namespace CSharpBinding.Completion
namespace ICSharpCode.RubyBinding
{ {
public class RubyLanguageBinding : DefaultLanguageBinding class EnumMemberCompletionData : CompletionData
{ {
public override IFormattingStrategy FormattingStrategy { IType enumType;
get { return new RubyFormattingStrategy(); }
IEntity member;
public EnumMemberCompletionData(IType enumType, IEntity member, TypeSystemAstBuilder builder) : base(enumType.Name + "." + member.Name)
{
this.enumType = enumType;
this.member = member;
this.Image = ClassBrowserIconService.Const;
this.CompletionText = builder.ConvertType(enumType).ToString() + "." + member.Name;
} }
public override LanguageProperties Properties { protected override object CreateFancyDescription()
get { return RubyLanguageProperties.Default; } {
return new FlowDocumentScrollViewer {
Document = XmlDocFormatter.CreateTooltip(member, false),
VerticalScrollBarVisibility = ScrollBarVisibility.Auto
};
} }
} }
} }

50
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EventCreationCompletionData.cs

@ -19,14 +19,15 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using ICSharpCode.SharpDevelop; using ICSharpCode.Core;
using CSharpBinding.Parser;
using CSharpBinding.Refactoring;
using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.CSharp.Refactoring; using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion; using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
using CSharpBinding.Parser;
using CSharpBinding.Refactoring;
namespace CSharpBinding.Completion namespace CSharpBinding.Completion
{ {
@ -35,46 +36,27 @@ namespace CSharpBinding.Completion
/// </summary> /// </summary>
class EventCreationCompletionData : CompletionData class EventCreationCompletionData : CompletionData
{ {
IEvent eventDefinition; readonly string handlerName;
string varName; readonly ITypeReference delegateTypeReference;
IType delegateType; readonly bool isStatic;
string parameterList;
IUnresolvedMember callingMember;
IUnresolvedTypeDefinition declaringType;
CSharpResolver contextAtCaret;
public EventCreationCompletionData(string varName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret) public EventCreationCompletionData(string handlerName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType, CSharpResolver contextAtCaret)
{ {
if (string.IsNullOrEmpty(varName)) { if (string.IsNullOrEmpty(handlerName)) {
this.DisplayText = "<Create handler for " + (evt != null ? evt.Name : "") + ">"; handlerName = (evt != null ? evt.Name : "Handle");
} }
else { this.handlerName = handlerName;
this.DisplayText = "Handle" + char.ToUpper(varName[0]) + varName.Substring(1) + (evt != null ? evt.Name : ""); this.DisplayText = StringParser.Parse("${res:CSharpBinding.Refactoring.EventCreation.EventHandlerText}", new[] { new StringTagPair("HandlerName", handlerName) });
} this.delegateTypeReference = delegateType.ToTypeReference();
this.isStatic = callingMember != null && callingMember.IsStatic;
this.varName = varName;
this.eventDefinition = evt;
this.delegateType = delegateType;
this.parameterList = parameterList;
this.callingMember = callingMember;
this.declaringType = declaringType;
this.contextAtCaret = contextAtCaret;
} }
public override void Complete(CompletionContext context) public override void Complete(CompletionContext context)
{ {
var invokeSignature = delegateType.GetMethods(m => m.Name == "Invoke").Single();
var refactoringContext = SDRefactoringContext.Create(context.Editor, CancellationToken.None); var refactoringContext = SDRefactoringContext.Create(context.Editor, CancellationToken.None);
var delegateType = delegateTypeReference.Resolve(refactoringContext.Compilation);
var invokeSignature = delegateType.GetMethods(m => m.Name == "Invoke").Single();
var builder = refactoringContext.CreateTypeSystemAstBuilder(); var builder = refactoringContext.CreateTypeSystemAstBuilder();
string handlerName;
bool isStatic;
if (eventDefinition != null) {
handlerName = eventDefinition.Name;
isStatic = eventDefinition.IsStatic;
} else {
handlerName = varName;
isStatic = callingMember.IsStatic;
}
var throwStatement = new ThrowStatement(); var throwStatement = new ThrowStatement();
var decl = new MethodDeclaration { var decl = new MethodDeclaration {

7
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/TypeCompletionData.cs

@ -35,16 +35,15 @@ namespace CSharpBinding.Completion
public TypeCompletionData(IType type) : base(type.Name) public TypeCompletionData(IType type) : base(type.Name)
{ {
this.type = type; this.type = type;
ITypeDefinition typeDef = type.GetDefinition();
if (typeDef != null)
this.Description = typeDef.Documentation;
this.Image = ClassBrowserIconService.GetIcon(type); this.Image = ClassBrowserIconService.GetIcon(type);
// don't set this.Description -- we use CreateFancyDescription() instead,
// and accessing entity.Documentation in the constructor is too slow
} }
protected override object CreateFancyDescription() protected override object CreateFancyDescription()
{ {
return new FlowDocumentScrollViewer { return new FlowDocumentScrollViewer {
Document = XmlDocFormatter.CreateTooltip(type, false), Document = XmlDocFormatter.CreateTooltip(type),
VerticalScrollBarVisibility = ScrollBarVisibility.Auto VerticalScrollBarVisibility = ScrollBarVisibility.Auto
}; };
} }

17
src/AddIns/BackendBindings/CSharpBinding/Project/Src/ExtensionMethods.cs

@ -37,14 +37,19 @@ namespace CSharpBinding
public static class ExtensionMethods public static class ExtensionMethods
{ {
public static TextEditorOptions ToEditorOptions(this ITextEditor editor) public static TextEditorOptions ToEditorOptions(this ITextEditor editor)
{
return ToEditorOptions(editor.Options);
}
public static TextEditorOptions ToEditorOptions(this ITextEditorOptions options)
{ {
return new TextEditorOptions { return new TextEditorOptions {
TabsToSpaces = editor.Options.ConvertTabsToSpaces, TabsToSpaces = options.ConvertTabsToSpaces,
TabSize = editor.Options.IndentationSize, TabSize = options.IndentationSize,
IndentSize = editor.Options.IndentationSize, IndentSize = options.IndentationSize,
ContinuationIndent = editor.Options.IndentationSize, ContinuationIndent = options.IndentationSize,
LabelIndent = -editor.Options.IndentationSize, LabelIndent = -options.IndentationSize,
WrapLineLength = editor.Options.VerticalRulerColumn, WrapLineLength = options.VerticalRulerColumn
}; };
} }

6
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/FormattingOptionBinding.cs

@ -22,6 +22,7 @@ using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.SharpDevelop;
using CSharpBinding.OptionPanels; using CSharpBinding.OptionPanels;
namespace CSharpBinding.FormattingStrategy namespace CSharpBinding.FormattingStrategy
@ -143,9 +144,8 @@ namespace CSharpBinding.FormattingStrategy
static void FillBoolComboValues(ComboBox comboBox) static void FillBoolComboValues(ComboBox comboBox)
{ {
// TODO Add located resources! comboBox.Items.Add(new ComboBoxItem { Content = SD.ResourceService.GetString("Global.Yes"), Tag = true });
comboBox.Items.Add(new ComboBoxItem { Content = "Yes", Tag = true }); comboBox.Items.Add(new ComboBoxItem { Content = SD.ResourceService.GetString("Global.No"), Tag = false });
comboBox.Items.Add(new ComboBoxItem { Content = "No", Tag = false });
} }
static void FillIntComboValues(ComboBox comboBox) static void FillIntComboValues(ComboBox comboBox)

11
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs

@ -297,9 +297,14 @@ namespace CSharpBinding.FormsDesigner
void CreateField(CodeMemberField newField) void CreateField(CodeMemberField newField)
{ {
// insert new field below InitializeComponents() // insert new field below the last field or InitializeComponents()
IField field = null;
var bodyRegion = initializeComponents.BodyRegion; if (formClass != null) {
field = formClass.Fields.LastOrDefault(f => string.Equals(f.Region.FileName,
initializeComponents.Region.FileName,
StringComparison.OrdinalIgnoreCase));
}
var bodyRegion = field != null ? field.BodyRegion : initializeComponents.BodyRegion;
DocumentScript script = GetScript(bodyRegion.FileName); DocumentScript script = GetScript(bodyRegion.FileName);
string newline = DocumentUtilities.GetLineTerminator(script.OriginalDocument, bodyRegion.BeginLine); string newline = DocumentUtilities.GetLineTerminator(script.OriginalDocument, bodyRegion.BeginLine);
string indentation = DocumentUtilities.GetIndentation(script.OriginalDocument, bodyRegion.BeginLine); string indentation = DocumentUtilities.GetIndentation(script.OriginalDocument, bodyRegion.BeginLine);

28
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpEventBindingService.cs

@ -24,10 +24,14 @@ using System.Reflection;
using System.Windows.Threading; using System.Windows.Threading;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.FormsDesigner.Gui.OptionPanels; using ICSharpCode.FormsDesigner.Gui.OptionPanels;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Refactoring;
using CSharpBinding.Refactoring; using CSharpBinding.Refactoring;
namespace CSharpBinding.FormsDesigner namespace CSharpBinding.FormsDesigner
@ -144,18 +148,28 @@ namespace CSharpBinding.FormsDesigner
var primary = loader.GetPrimaryTypeDefinition(); var primary = loader.GetPrimaryTypeDefinition();
var evtHandler = primary.GetMethods(m => m.Name == methodName, GetMemberOptions.IgnoreInheritedMembers).FirstOrDefault(); var evtHandler = primary.GetMethods(m => m.Name == methodName, GetMemberOptions.IgnoreInheritedMembers).FirstOrDefault();
if (evtHandler == null) { if (evtHandler == null) {
generator.InsertEventHandler(primary, methodName, evt, true); var insertionType = GeneralOptionsPanel.InsertTodoComment ? InsertEventHandlerBodyKind.TodoComment : InsertEventHandlerBodyKind.Nothing;
} generator.InsertEventHandler(primary, methodName, evt, true, insertionType);
else { } else {
CSharpBinding.Parser.CSharpFullParseInformation parseInfo; CSharpBinding.Parser.CSharpFullParseInformation parseInfo;
var node = evtHandler.GetDeclaration(out parseInfo) as MethodDeclaration; var node = evtHandler.GetDeclaration(out parseInfo) as MethodDeclaration;
var fileName = new FileName(evtHandler.Region.FileName);
var fileContentFinder = new ParseableFileContentFinder();
if (node != null && !node.Body.IsNull) { if (node != null && !node.Body.IsNull) {
var location = node.Body.FirstChild.StartLocation; var location = node.Body.FirstChild.StartLocation;
var firstStatement = node.Body.Children.OfType<Statement>().FirstOrDefault(); var firstStatement = node.Body.Children.OfType<Statement>().FirstOrDefault();
if (firstStatement != null)
if (firstStatement == null) {
var fileContent = fileContentFinder.Create(fileName);
var document = new ReadOnlyDocument(fileContent);
var offset = document.GetOffset(new TextLocation(location.Line + 1, 1));
var length = DocumentUtilities.GetWhitespaceAfter(fileContent, offset).Length;
location = new TextLocation(location.Line + 1, length + 1);
} else {
location = firstStatement.StartLocation; location = firstStatement.StartLocation;
// TODO : does not jump correctly... }
SD.FileService.JumpToFilePosition(new FileName(evtHandler.Region.FileName), location.Line, location.Column); SD.FileService.JumpToFilePosition(fileName, location.Line, location.Column);
} }
} }
} }

1
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/ICSharpDesignerLoaderContext.cs

@ -31,6 +31,7 @@ namespace CSharpBinding.FormsDesigner
CSharpFullParseInformation GetPrimaryFileParseInformation(); CSharpFullParseInformation GetPrimaryFileParseInformation();
ICompilation GetCompilation(); ICompilation GetCompilation();
IDocument GetDocument(FileName fileName); IDocument GetDocument(FileName fileName);
/// <remarks>if lineNumber = 0 no jump is performed, but the active view content changes.</remarks>
void ShowSourceCode(int lineNumber = 0); void ShowSourceCode(int lineNumber = 0);
} }
} }

36
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/Parser.cs

@ -38,7 +38,6 @@ using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor.Search; using ICSharpCode.SharpDevelop.Editor.Search;
using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Parser;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Refactoring;
namespace CSharpBinding.Parser namespace CSharpBinding.Parser
{ {
@ -51,38 +50,6 @@ namespace CSharpBinding.Parser
return Path.GetExtension(fileName).Equals(".CS", StringComparison.OrdinalIgnoreCase); return Path.GetExtension(fileName).Equals(".CS", StringComparison.OrdinalIgnoreCase);
} }
/*
void RetrieveRegions(ISyntaxTree cu, ICSharpCode.NRefactory.Parser.SpecialTracker tracker)
{
for (int i = 0; i < tracker.CurrentSpecials.Count; ++i) {
ICSharpCode.NRefactory.PreprocessingDirective directive = tracker.CurrentSpecials[i] as ICSharpCode.NRefactory.PreprocessingDirective;
if (directive != null) {
if (directive.Cmd == "#region") {
int deep = 1;
for (int j = i + 1; j < tracker.CurrentSpecials.Count; ++j) {
ICSharpCode.NRefactory.PreprocessingDirective nextDirective = tracker.CurrentSpecials[j] as ICSharpCode.NRefactory.PreprocessingDirective;
if (nextDirective != null) {
switch (nextDirective.Cmd) {
case "#region":
++deep;
break;
case "#endregion":
--deep;
if (deep == 0) {
cu.FoldingRegions.Add(new FoldingRegion(directive.Arg.Trim(), DomRegion.FromLocation(directive.StartPosition, nextDirective.EndPosition)));
goto end;
}
break;
}
}
}
end: ;
}
}
}
}
*/
public ITextSource GetFileContent(FileName fileName) public ITextSource GetFileContent(FileName fileName)
{ {
return SD.FileService.GetFileContent(fileName); return SD.FileService.GetFileContent(fileName);
@ -94,7 +61,6 @@ namespace CSharpBinding.Parser
var csharpProject = parentProject as CSharpProject; var csharpProject = parentProject as CSharpProject;
CSharpParser parser = new CSharpParser(csharpProject != null ? csharpProject.CompilerSettings : null); CSharpParser parser = new CSharpParser(csharpProject != null ? csharpProject.CompilerSettings : null);
parser.GenerateTypeSystemMode = !fullParseInformationRequested;
SyntaxTree cu = parser.Parse(fileContent, fileName); SyntaxTree cu = parser.Parse(fileContent, fileName);
cu.Freeze(); cu.Freeze();
@ -135,7 +101,7 @@ namespace CSharpBinding.Parser
int endOffset; int endOffset;
int searchOffset = 0; int searchOffset = 0;
// HACK: workaround for parser bug: uses \n instead of \r\n in comment.Content // HACK: workaround for parser bug: uses \n instead of \r\n in comment.Content
string commentContent = document.GetText(commentStartOffset, commentEndOffset - commentStartOffset + 1); string commentContent = document.GetText(commentStartOffset, Math.Min(commentEndOffset - commentStartOffset + 1, commentEndOffset - commentStartOffset));
do { do {
int start = commentStartOffset + searchOffset; int start = commentStartOffset + searchOffset;
int absoluteOffset = document.IndexOf(match, start, document.TextLength - start, StringComparison.Ordinal); int absoluteOffset = document.IndexOf(match, start, document.TextLength - start, StringComparison.Ordinal);

29
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/CSharpCodeGenerator.cs

@ -66,7 +66,7 @@ namespace CSharpBinding.Refactoring
AddAttribute(target.Region, attribute, "return"); AddAttribute(target.Region, attribute, "return");
} }
public override void InsertEventHandler(ITypeDefinition target, string name, IEvent eventDefinition, bool jumpTo) public override void InsertEventHandler(ITypeDefinition target, string name, IEvent eventDefinition, bool jumpTo, InsertEventHandlerBodyKind bodyKind = InsertEventHandlerBodyKind.ThrowNotImplementedException)
{ {
IUnresolvedTypeDefinition match = null; IUnresolvedTypeDefinition match = null;
@ -103,15 +103,30 @@ namespace CSharpBinding.Refactoring
decl.Parameters.AddRange(param); decl.Parameters.AddRange(param);
using (Script script = context.StartScript()) { using (Script script = context.StartScript()) {
// FIXME : will not work properly if there are no members. int eolLen = 0;
if (last == match) { if (last == match) {
throw new NotImplementedException(); eolLen = 2;
// TODO InsertWithCursor not implemented! script.AddTo((TypeDeclaration)node, decl);
//script.InsertWithCursor("Insert event handler", Script.InsertPosition.End, decl).RunSynchronously();
} else { } else {
// TODO does not jump correctly...
script.InsertAfter(node, decl); script.InsertAfter(node, decl);
editor.JumpTo(throwStmt.StartLocation.Line, throwStmt.StartLocation.Column); }
switch (bodyKind) {
case InsertEventHandlerBodyKind.TodoComment:
Comment comment = new Comment(" TODO: Implement " + name);
script.Replace(throwStmt, comment);
script.Select(comment);
break;
case InsertEventHandlerBodyKind.Nothing:
var segment = script.GetSegment(throwStmt);
if (script is DocumentScript && eolLen > 0) {
eolLen = ((DocumentScript)script).CurrentDocument.GetLineByOffset(segment.Offset).DelimiterLength;
}
script.RemoveText(segment.Offset, segment.Length - eolLen);
script.Select(segment.Offset, segment.Offset);
break;
case InsertEventHandlerBodyKind.ThrowNotImplementedException:
script.Select(throwStmt);
break;
} }
} }
} }

59
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/EditorScript.cs

@ -18,6 +18,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Threading; using System.Windows.Threading;
@ -80,6 +81,16 @@ namespace CSharpBinding.Refactoring
editor.Select(startOffset, endOffset - startOffset); editor.Select(startOffset, endOffset - startOffset);
} }
public override void Select(int startOffset, int endOffset)
{
editor.Select(Math.Min(startOffset, endOffset), Math.Abs(endOffset - startOffset));
}
public override void Select(TextLocation start, TextLocation end)
{
Select(editor.Document.GetOffset(start), editor.Document.GetOffset(end));
}
public override Task Link(params AstNode[] nodes) public override Task Link(params AstNode[] nodes)
{ {
var segs = nodes.Select(node => GetSegment(node)).ToArray(); var segs = nodes.Select(node => GetSegment(node)).ToArray();
@ -132,21 +143,21 @@ namespace CSharpBinding.Refactoring
switch (defaultPosition) { switch (defaultPosition) {
case InsertPosition.Start: case InsertPosition.Start:
layer.CurrentInsertionPoint = 0; layer.CurrentInsertionPointIndex = 0;
break; break;
case InsertPosition.End: case InsertPosition.End:
layer.CurrentInsertionPoint = insertionPoints.Count - 1; layer.CurrentInsertionPointIndex = insertionPoints.Count - 1;
break; break;
case InsertPosition.Before: case InsertPosition.Before:
for (int i = 0; i < insertionPoints.Count; i++) { for (int i = 0; i < insertionPoints.Count; i++) {
if (insertionPoints[i].Location < loc) if (insertionPoints[i].Location < loc)
layer.CurrentInsertionPoint = i; layer.CurrentInsertionPointIndex = i;
} }
break; break;
case InsertPosition.After: case InsertPosition.After:
for (int i = 0; i < insertionPoints.Count; i++) { for (int i = 0; i < insertionPoints.Count; i++) {
if (insertionPoints[i].Location > loc) { if (insertionPoints[i].Location > loc) {
layer.CurrentInsertionPoint = i; layer.CurrentInsertionPointIndex = i;
break; break;
} }
} }
@ -172,13 +183,34 @@ namespace CSharpBinding.Refactoring
args.InsertionPoint.LineBefore == NewLineInsertion.None && nodes.Count > 1) { args.InsertionPoint.LineBefore == NewLineInsertion.None && nodes.Count > 1) {
args.InsertionPoint.LineAfter = NewLineInsertion.BlankLine; args.InsertionPoint.LineAfter = NewLineInsertion.BlankLine;
} }
var insertionPoint = args.InsertionPoint;
if (nodes.All(n => n is EnumMemberDeclaration)) {
insertionPoint.LineAfter = NewLineInsertion.Eol;
insertionPoint.LineBefore = NewLineInsertion.None;
}
int offset = currentScript.GetCurrentOffset(args.InsertionPoint.Location); int offset = currentScript.GetCurrentOffset(insertionPoint.Location);
int indentLevel = currentScript.GetIndentLevelAt(offset); int indentLevel = currentScript.GetIndentLevelAt(Math.Max(0, offset - 1));
foreach (var node in nodes.Reverse()) { foreach (var node in nodes.Reverse()) {
var output = currentScript.OutputNode(indentLevel, node); var output = currentScript.OutputNode(indentLevel, node);
int delta = args.InsertionPoint.Insert(target, output.Text); var text = output.Text;
if (node is EnumMemberDeclaration) {
if (insertionPoint != layer.InsertionPoints.Last()) {
text += ",";
} else {
var parentEnum = currentScript.context.RootNode.GetNodeAt(insertionPoint.Location, n => (n is TypeDeclaration) && ((TypeDeclaration)n).ClassType == ClassType.Enum) as TypeDeclaration;
if (parentEnum != null) {
var lastMember = parentEnum.Members.LastOrDefault();
if (lastMember != null) {
var segment = currentScript.GetSegment(lastMember);
currentScript.InsertText(segment.EndOffset, ",");
}
}
}
}
int delta = insertionPoint.Insert(target, text);
output.RegisterTrackedSegments(currentScript, delta + offset); output.RegisterTrackedSegments(currentScript, delta + offset);
} }
currentScript.FormatText(nodes); currentScript.FormatText(nodes);
@ -239,19 +271,6 @@ namespace CSharpBinding.Refactoring
var layer = new InsertionCursorLayer(area, operation, insertionPoints); var layer = new InsertionCursorLayer(area, operation, insertionPoints);
area.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)area.TextView.InvalidateVisual); area.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)area.TextView.InvalidateVisual);
if (declaringType.Kind == TypeKind.Enum) {
foreach (var node in nodes.Reverse()) {
int indentLevel = GetIndentLevelAt(area.Document.GetOffset(declaringType.BodyRegion.Begin));
var output = OutputNode(indentLevel, node);
var point = insertionPoints[0];
var offset = area.Document.GetOffset(point.Location);
var text = output.Text + ",";
var delta = point.Insert(area.Document, text);
output.RegisterTrackedSegments(script, delta + offset);
}
tcs.SetResult(script);
return tcs.Task;
}
InsertWithCursorOnLayer(script, layer, tcs, nodes, area.Document); InsertWithCursorOnLayer(script, layer, tcs, nodes, area.Document);
return tcs.Task; return tcs.Task;
} }

37
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertionCursorLayer.cs

@ -24,6 +24,7 @@ using System.Windows.Controls;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using ICSharpCode.AvalonEdit; using ICSharpCode.AvalonEdit;
using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Rendering;
@ -31,6 +32,7 @@ using ICSharpCode.AvalonEdit.Utils;
using ICSharpCode.NRefactory; using ICSharpCode.NRefactory;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
namespace CSharpBinding.Refactoring namespace CSharpBinding.Refactoring
{ {
class InsertionCursorLayer : Canvas, IDisposable class InsertionCursorLayer : Canvas, IDisposable
@ -41,9 +43,10 @@ namespace CSharpBinding.Refactoring
readonly TextArea editor; readonly TextArea editor;
public int CurrentInsertionPoint { public int CurrentInsertionPointIndex { get; set; }
get;
set; public InsertionPoint[] InsertionPoints {
get { return insertionPoints; }
} }
int insertionPointNextToMouse = -1; int insertionPointNextToMouse = -1;
@ -73,8 +76,8 @@ namespace CSharpBinding.Refactoring
protected override void OnRender(DrawingContext drawingContext) protected override void OnRender(DrawingContext drawingContext)
{ {
DrawLineForInsertionPoint(CurrentInsertionPoint, markerPen, drawingContext); DrawLineForInsertionPoint(CurrentInsertionPointIndex, markerPen, drawingContext);
if (insertionPointNextToMouse > -1 && insertionPointNextToMouse != CurrentInsertionPoint) if (insertionPointNextToMouse > -1 && insertionPointNextToMouse != CurrentInsertionPointIndex)
DrawLineForInsertionPoint(insertionPointNextToMouse, tempMarkerPen, drawingContext); DrawLineForInsertionPoint(insertionPointNextToMouse, tempMarkerPen, drawingContext);
SetGroupBoxPosition(); SetGroupBoxPosition();
// HACK: why OnRender() override? we could just use Line objects instead // HACK: why OnRender() override? we could just use Line objects instead
@ -128,7 +131,7 @@ namespace CSharpBinding.Refactoring
else { else {
insertionPointNextToMouse = FindNextInsertionPoint(e.GetPosition(this)); insertionPointNextToMouse = FindNextInsertionPoint(e.GetPosition(this));
if (insertionPointNextToMouse >= 0) if (insertionPointNextToMouse >= 0)
CurrentInsertionPoint = insertionPointNextToMouse; CurrentInsertionPointIndex = insertionPointNextToMouse;
InvalidateVisual(); InvalidateVisual();
} }
e.Handled = true; e.Handled = true;
@ -181,9 +184,9 @@ namespace CSharpBinding.Refactoring
{ {
return (sender, e) => { return (sender, e) => {
if (up) if (up)
layer.CurrentInsertionPoint = Math.Max(0, layer.CurrentInsertionPoint - 1); layer.CurrentInsertionPointIndex = Math.Max(0, layer.CurrentInsertionPointIndex - 1);
else else
layer.CurrentInsertionPoint = Math.Min(layer.insertionPoints.Length - 1, layer.CurrentInsertionPoint + 1); layer.CurrentInsertionPointIndex = Math.Min(layer.insertionPoints.Length - 1, layer.CurrentInsertionPointIndex + 1);
layer.InvalidateVisual(); layer.InvalidateVisual();
layer.ScrollToInsertionPoint(); layer.ScrollToInsertionPoint();
}; };
@ -192,9 +195,9 @@ namespace CSharpBinding.Refactoring
ExecutedRoutedEventHandler MoveMarkerPage(bool up) ExecutedRoutedEventHandler MoveMarkerPage(bool up)
{ {
return (sender, e) => { return (sender, e) => {
TextLocation current = layer.insertionPoints[layer.CurrentInsertionPoint].Location; TextLocation current = layer.insertionPoints[layer.CurrentInsertionPointIndex].Location;
double currentVPos = layer.editor.TextView.GetVisualTopByDocumentLine(current.Line); double currentVPos = layer.editor.TextView.GetVisualTopByDocumentLine(current.Line);
int newIndex = layer.CurrentInsertionPoint; int newIndex = layer.CurrentInsertionPointIndex;
double newVPos; double newVPos;
do { do {
if (up) { if (up) {
@ -214,7 +217,7 @@ namespace CSharpBinding.Refactoring
newVPos = layer.editor.TextView.GetVisualTopByDocumentLine(layer.insertionPoints[newIndex].Location.Line); newVPos = layer.editor.TextView.GetVisualTopByDocumentLine(layer.insertionPoints[newIndex].Location.Line);
} }
while (Math.Abs(currentVPos - newVPos) < layer.editor.ActualHeight); while (Math.Abs(currentVPos - newVPos) < layer.editor.ActualHeight);
layer.CurrentInsertionPoint = newIndex; layer.CurrentInsertionPointIndex = newIndex;
layer.InvalidateVisual(); layer.InvalidateVisual();
layer.ScrollToInsertionPoint(); layer.ScrollToInsertionPoint();
}; };
@ -224,9 +227,9 @@ namespace CSharpBinding.Refactoring
{ {
return (sender, e) => { return (sender, e) => {
if (up) if (up)
layer.CurrentInsertionPoint = 0; layer.CurrentInsertionPointIndex = 0;
else else
layer.CurrentInsertionPoint = layer.insertionPoints.Length - 1; layer.CurrentInsertionPointIndex = layer.insertionPoints.Length - 1;
layer.InvalidateVisual(); layer.InvalidateVisual();
layer.ScrollToInsertionPoint(); layer.ScrollToInsertionPoint();
}; };
@ -247,14 +250,14 @@ namespace CSharpBinding.Refactoring
internal void ScrollToInsertionPoint() internal void ScrollToInsertionPoint()
{ {
var location = insertionPoints[CurrentInsertionPoint].Location; var location = insertionPoints[CurrentInsertionPointIndex].Location;
editor.GetService<TextEditor>().ScrollTo(location.Line, location.Column); editor.GetService<TextEditor>().ScrollTo(location.Line, location.Column);
SetGroupBoxPosition(); SetGroupBoxPosition();
} }
void SetGroupBoxPosition() void SetGroupBoxPosition()
{ {
var boxPosition = GetLinePosition(CurrentInsertionPoint) + new Vector(editor.TextView.ActualWidth * 0.6 - 5, -groupBox.ActualHeight / 2.0); var boxPosition = GetLinePosition(CurrentInsertionPointIndex) + new Vector(editor.TextView.ActualWidth * 0.6 - 5, -groupBox.ActualHeight / 2.0);
Canvas.SetTop(groupBox, boxPosition.Y); Canvas.SetTop(groupBox, boxPosition.Y);
Canvas.SetLeft(groupBox, boxPosition.X); Canvas.SetLeft(groupBox, boxPosition.X);
} }
@ -267,7 +270,7 @@ namespace CSharpBinding.Refactoring
void FireExited(bool success) void FireExited(bool success)
{ {
if (Exited != null) { if (Exited != null) {
Exited(this, new InsertionCursorEventArgs(insertionPoints[CurrentInsertionPoint], success)); Exited(this, new InsertionCursorEventArgs(insertionPoints[CurrentInsertionPointIndex], success));
} }
} }
@ -278,7 +281,7 @@ namespace CSharpBinding.Refactoring
var content = new StackPanel { var content = new StackPanel {
Children = { Children = {
new TextBlock { new TextBlock {
Text = "Use Up/Down to move to another location.\r\n" + "Press Enter to select the location.\r\n" + "Press Esc to cancel this operation." Text = SD.ResourceService.GetString("CSharpBinding.Refactoring.InsertWithCursor.Description")
} }
} }
}; };

9
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs

@ -44,6 +44,7 @@ namespace CSharpBinding.Refactoring
readonly ITextEditor editor; readonly ITextEditor editor;
readonly ITextSource textSource; readonly ITextSource textSource;
readonly TextLocation location; readonly TextLocation location;
readonly TextEditorOptions editorOptions;
IDocument document; IDocument document;
int selectionStart, selectionLength; int selectionStart, selectionLength;
@ -86,6 +87,7 @@ namespace CSharpBinding.Refactoring
this.selectionStart = selectionStart; this.selectionStart = selectionStart;
this.selectionLength = selectionLength; this.selectionLength = selectionLength;
this.location = location; this.location = location;
this.editorOptions = SD.EditorControlService.GlobalOptions.ToEditorOptions();
InitializeServices(); InitializeServices();
} }
@ -99,6 +101,7 @@ namespace CSharpBinding.Refactoring
this.selectionStart = editor.SelectionStart; this.selectionStart = editor.SelectionStart;
this.selectionLength = editor.SelectionLength; this.selectionLength = editor.SelectionLength;
this.location = location; this.location = location;
this.editorOptions = editor.ToEditorOptions();
InitializeServices(); InitializeServices();
} }
@ -131,6 +134,12 @@ namespace CSharpBinding.Refactoring
} }
} }
public override TextEditorOptions TextEditorOptions {
get {
return editorOptions;
}
}
public IDocument Document { public IDocument Document {
get { get {
IDocument result = LazyInit.VolatileRead(ref document); IDocument result = LazyInit.VolatileRead(ref document);

8
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesDialog.xaml

@ -11,7 +11,7 @@
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
Closing="Window_Closing" Closing="Window_Closing"
MinHeight="250" MinWidth="200" MinHeight="250" MinWidth="200"
Height="450" Width="400" Title="Search For Issues"> Height="450" Width="400" Title="{core:Localize XML.MainMenu.SearchMenu.SearchForIssues}">
<Grid Margin="6"> <Grid Margin="6">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -24,15 +24,15 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Label Content="Search In:" /> <Label Content="{core:Localize Dialog.NewProject.SearchReplace.SearchIn}" />
<widgets:RadioButtonGroup Name="searchInRBG" Margin="0,6,0,0" sd:EnumBinding.EnumType="local:SearchForIssuesTarget" /> <widgets:RadioButtonGroup Name="searchInRBG" Margin="0,6,0,0" sd:EnumBinding.EnumType="local:SearchForIssuesTarget" />
</StackPanel> </StackPanel>
<Label Content="Issues:" Grid.Row="1" HorizontalAlignment="Left" /> <Label Content="Issues:" Grid.Row="1" HorizontalAlignment="Left" />
<tv:SharpTreeView Name="treeView" Grid.Row="2" Margin="4,0,4,4" /> <tv:SharpTreeView Name="treeView" Grid.Row="2" Margin="4,0,4,4" />
<CheckBox Name="fixCheckBox" Grid.Row="3" Margin="8,0,0,0" Checked="FixCheckBox_Checked" Unchecked="FixCheckBox_Unchecked" <CheckBox Name="fixCheckBox" Grid.Row="3" Margin="8,0,0,0" Checked="FixCheckBox_Checked" Unchecked="FixCheckBox_Unchecked"
HorizontalAlignment="Left" Content="Automatically fix issues if possible" /> HorizontalAlignment="Left" Content="{core:Localize Dialog.SearchForIssues.AutoFix}" />
<StackPanel Grid.Row="4" Margin="4" HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel Grid.Row="4" Margin="4" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Content="Search" Style="{x:Static core:GlobalStyles.ButtonStyle}" Name="searchButton" IsDefault="True" Click="searchButton_Click" Margin="0,0,5,0" /> <Button Content="{core:Localize MainWindow.Windows.ClassBrowser.CommitSearch.ToolTip}" Style="{x:Static core:GlobalStyles.ButtonStyle}" Name="searchButton" IsDefault="True" Click="searchButton_Click" Margin="0,0,5,0" />
<Button Content="{core:Localize Global.CloseButtonText}" Style="{x:Static core:GlobalStyles.ButtonStyle}" IsCancel="True" /> <Button Content="{core:Localize Global.CloseButtonText}" Style="{x:Static core:GlobalStyles.ButtonStyle}" IsCancel="True" />
</StackPanel> </StackPanel>
</Grid> </Grid>

2
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.xaml.cs

@ -165,7 +165,7 @@ namespace ICSharpCode.CppBinding.Project
var stringListDialog = new StringListEditorDialog(); var stringListDialog = new StringListEditorDialog();
stringListDialog.TitleText = title; stringListDialog.TitleText = title;
stringListDialog.ListCaption = listCaption; stringListDialog.ListCaption = listCaption;
stringListDialog.BrowseForDirectory = browseForDirectoty; stringListDialog.ShowBrowse = browseForDirectoty;
string[] strings = textBox.Text.Split(';'); string[] strings = textBox.Text.Split(';');
stringListDialog.LoadList (strings); stringListDialog.LoadList (strings);
stringListDialog.ShowDialog(); stringListDialog.ShowDialog();

49
src/AddIns/BackendBindings/Python/PyWalker/AssemblyInfo.cs

@ -1,49 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#region Using directives
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PyWalker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PyWalker")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("0.1")]

441
src/AddIns/BackendBindings/Python/PyWalker/CodeDomVisitor.cs

@ -1,441 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.CodeDom;
using System.Collections;
using System.Reflection;
using System.Text;
namespace PyWalker
{
/// <summary>
/// Visits the code dom generated by PythonProvider.
/// </summary>
public class CodeDomVisitor
{
IOutputWriter writer;
public CodeDomVisitor(IOutputWriter writer)
{
this.writer = writer;
}
public void Visit(CodeCompileUnit unit)
{
VisitCodeCompileUnit(unit);
}
void VisitCodeCompileUnit(CodeCompileUnit unit)
{
WriteLine("VisitCodeCompileUnit");
foreach (CodeNamespace ns in unit.Namespaces) {
VisitCodeNamespace(ns);
}
}
void VisitCodeNamespace(CodeNamespace ns)
{
WriteLine("VisitCodeNamespace: " + ns.Name);
foreach (CodeNamespaceImport import in ns.Imports) {
VisitCodeNamespaceImport(import);
}
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
foreach (CodeTypeDeclaration type in ns.Types) {
VisitCodeTypeDeclaration(type);
}
}
}
void VisitCodeNamespaceImport(CodeNamespaceImport import)
{
WriteLine("VisitCodeNamespaceImport: " + import.Namespace);
}
void VisitCodeTypeDeclaration(CodeTypeDeclaration type)
{
WriteLine("VisitCodeTypeDeclaration: " + type.Name);
WriteLine(MemberAttributesToString(type.Attributes));
WriteLine("UserData: " + UserDataKeysToString(type.UserData));
WriteLine("VisitCodeTypeDeclaration: Custom attributes");
foreach (CodeAttributeDeclaration attributeDeclaration in type.CustomAttributes) {
VisitCodeAttributeDeclaration(attributeDeclaration);
}
WriteLine("TypeAttributes: " + TypeAttributesToString(type.TypeAttributes));
foreach (CodeTypeParameter parameter in type.TypeParameters) {
VisitCodeTypeParameter(parameter);
}
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
foreach (CodeTypeMember member in type.Members) {
CodeMemberMethod method = member as CodeMemberMethod;
CodeMemberField field = member as CodeMemberField;
if (method != null) {
VisitCodeMemberMethod(method);
} else if (field != null) {
VisitCodeMemberField(field);
} else {
WriteLine("Unhandled type member: " + member.GetType().Name);
}
}
}
}
void VisitCodeTypeParameter(CodeTypeParameter parameter)
{
WriteLine("VisitCodeTypeParameter: " + parameter.Name);
}
string TypeAttributesToString(TypeAttributes typeAttributes)
{
return typeAttributes.ToString();
}
void VisitCodeAttributeDeclaration(CodeAttributeDeclaration attributeDeclaration)
{
WriteLine("VisitCodeAttributeDeclaration: " + attributeDeclaration.Name);
}
void VisitCodeMemberMethod(CodeMemberMethod method)
{
WriteLine("VisitCodeMemberMethod: " + method.Name);
WriteLine(MemberAttributesToString(method.Attributes));
WriteLine("UserData: " + UserDataKeysToString(method.UserData));
foreach (CodeParameterDeclarationExpression param in method.Parameters) {
VisitCodeParameterDeclarationExpression(param);
}
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
WriteLine("Method.Statements.Count: " + method.Statements.Count);
foreach (CodeStatement statement in method.Statements) {
VisitCodeStatement(statement);
}
}
}
void VisitCodeStatement(CodeStatement statement)
{
WriteLine("VisitCodeStatement: " + statement.GetType().Name);
CodeVariableDeclarationStatement codeVariableDeclarationStatement = statement as CodeVariableDeclarationStatement;
CodeAssignStatement codeAssignStatement = statement as CodeAssignStatement;
CodeConditionStatement codeConditionStatement = statement as CodeConditionStatement;
CodeIterationStatement codeIterationStatement = statement as CodeIterationStatement;
CodeExpressionStatement codeExpressionStatement = statement as CodeExpressionStatement;
CodeTryCatchFinallyStatement codeTryCatchFinallyStatement = statement as CodeTryCatchFinallyStatement;
if (codeVariableDeclarationStatement != null) {
VisitCodeVariableDeclarationStatement(codeVariableDeclarationStatement);
} else if (codeAssignStatement != null) {
VisitCodeAssignStatement(codeAssignStatement);
} else if (codeConditionStatement != null) {
VisitCodeConditionStatement(codeConditionStatement);
} else if (codeIterationStatement != null) {
VisitCodeIterationStatement(codeIterationStatement);
} else if (codeExpressionStatement != null) {
VisitCodeExpressionStatement(codeExpressionStatement);
} else if (codeTryCatchFinallyStatement != null) {
VisitCodeTryCatchFinallyStatement(codeTryCatchFinallyStatement);
} else {
WriteLine("Unhandled statement: " + statement.GetType().Name);
}
}
void VisitCodeAssignStatement(CodeAssignStatement assignStatement)
{
WriteLine("VisitCodeAssignmentStatement");
WriteLine("Left follows");
VisitCodeExpression(assignStatement.Left);
WriteLine("Right follows");
VisitCodeExpression(assignStatement.Right);
}
void VisitCodeParameterDeclarationExpression(CodeParameterDeclarationExpression expression)
{
WriteLine("VisitCodeParameterDeclarationExpression: " + expression.Name);
WriteLine("BaseType: " + expression.Type.BaseType);
}
void VisitCodeVariableDeclarationStatement(CodeVariableDeclarationStatement codeVariableDeclarationStatement)
{
WriteLine("VisitCodeVariableDeclarationStatement: " + codeVariableDeclarationStatement.Name);
WriteLine("BaseType: " + codeVariableDeclarationStatement.Type.BaseType);
WriteLine("UserData: " + UserDataKeysToString(codeVariableDeclarationStatement.UserData));
WriteLine("InitExpression follows");
VisitCodeExpression(codeVariableDeclarationStatement.InitExpression);
}
void VisitCodeExpression(CodeExpression expression)
{
if (expression != null) {
WriteLine("VisitCodeExpression: " + expression.GetType().Name);
CodePrimitiveExpression primitiveExpression = expression as CodePrimitiveExpression;
CodeFieldReferenceExpression fieldReferenceExpression = expression as CodeFieldReferenceExpression;
CodeThisReferenceExpression thisReferenceExpression = expression as CodeThisReferenceExpression;
CodeObjectCreateExpression createExpression = expression as CodeObjectCreateExpression;
CodeBinaryOperatorExpression binaryExpression = expression as CodeBinaryOperatorExpression;
CodeMethodReferenceExpression methodReferenceExpression = expression as CodeMethodReferenceExpression;
CodeMethodInvokeExpression methodInvokeExpression = expression as CodeMethodInvokeExpression;
CodeVariableReferenceExpression variableReferenceExpression = expression as CodeVariableReferenceExpression;
if (primitiveExpression != null) {
VisitCodePrimitiveExpression(primitiveExpression);
} else if (fieldReferenceExpression != null) {
VisitCodeFieldReferenceExpression(fieldReferenceExpression);
} else if (thisReferenceExpression != null) {
VisitCodeThisReferenceExpression(thisReferenceExpression);
} else if (createExpression != null) {
VisitObjectCreateExpression(createExpression);
} else if (binaryExpression != null) {
VisitCodeBinaryOperatorExpression(binaryExpression);
} else if (methodReferenceExpression != null) {
VisitCodeMethodReferenceExpression(methodReferenceExpression);
} else if (methodInvokeExpression != null) {
VisitCodeMethodInvokeExpression(methodInvokeExpression);
} else if (variableReferenceExpression != null) {
VisitCodeVariableReferenceExpression(variableReferenceExpression);
}
} else {
WriteLine("VisitCodeExpression: Null");
}
}
void VisitCodePrimitiveExpression(CodePrimitiveExpression expression)
{
WriteLine("VisitCodePrimitiveExpression: " + expression.Value);
}
void VisitCodeFieldReferenceExpression(CodeFieldReferenceExpression expression)
{
WriteLine("VisitFieldReferenceExpression: " + expression.FieldName);
WriteLine("Target object follows");
VisitCodeExpression(expression.TargetObject);
}
void VisitCodeThisReferenceExpression(CodeThisReferenceExpression expression)
{
WriteLine("VisitCodeThisReferenceExpression");
WriteLine("UserData: " + UserDataKeysToString(expression.UserData));
}
void VisitCodeMemberField(CodeMemberField field)
{
WriteLine("VisitCodeMemberField: " + field.Name);
WriteLine("UserData: " + UserDataKeysToString(field.UserData));
WriteLine(MemberAttributesToString(field.Attributes));
WriteLine("InitExpression follows");
VisitCodeExpression(field.InitExpression);
}
void VisitObjectCreateExpression(CodeObjectCreateExpression createExpression)
{
WriteLine("VisitObjectCreateExpression: Type: " + createExpression.CreateType.BaseType);
foreach (CodeExpression expression in createExpression.Parameters) {
VisitCodeExpression(expression);
}
}
void VisitCodeConditionStatement(CodeConditionStatement conditionStatement)
{
WriteLine("VisitCodeConditionStatement");
WriteLine("Condition follows");
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(conditionStatement.Condition);
}
WriteLine("TrueStatements follow");
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
foreach (CodeStatement statement in conditionStatement.TrueStatements) {
VisitCodeStatement(statement);
}
}
WriteLine("FalseStatements follow");
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
foreach (CodeStatement statement in conditionStatement.FalseStatements) {
VisitCodeStatement(statement);
}
}
}
void VisitCodeBinaryOperatorExpression(CodeBinaryOperatorExpression expression)
{
WriteLine("VisitBinaryOperatorExpression: " + expression.Operator);
WriteLine("Left follows");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(expression.Left);
}
WriteLine("Right follows");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(expression.Right);
}
}
void VisitCodeIterationStatement(CodeIterationStatement statement)
{
WriteLine("VisitIterationStatement");
WriteLine("Init statement follows");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeStatement(statement.InitStatement);
}
WriteLine("Increment statement follows");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeStatement(statement.IncrementStatement);
}
WriteLine("Test expression follows");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(statement.TestExpression);
}
WriteLine("Statements follow");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
foreach (CodeStatement currentStatement in statement.Statements) {
VisitCodeStatement(currentStatement);
}
}
}
void VisitCodeMethodInvokeExpression(CodeMethodInvokeExpression expression)
{
WriteLine("VisitCodeMethodInvokeExpression");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(expression.Method);
}
}
void VisitCodeMethodReferenceExpression(CodeMethodReferenceExpression expression)
{
WriteLine("VisitCodeMethodReferenceExpression: " + expression.MethodName);
WriteLine("Target Object follows");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(expression.TargetObject);
}
}
void VisitCodeExpressionStatement(CodeExpressionStatement statement)
{
WriteLine("VisitCodeExpressionStatement");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
VisitCodeExpression(statement.Expression);
}
}
void VisitCodeVariableReferenceExpression(CodeVariableReferenceExpression expression)
{
WriteLine("VisitCodeVariableReferenceExpression: " + expression.VariableName);
}
void VisitCodeTryCatchFinallyStatement(CodeTryCatchFinallyStatement tryStatement)
{
WriteLine("VisitCodeTryCatchFinallyStatement");
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
WriteLine("Try statements follow: Count: " + tryStatement.TryStatements.Count);
foreach (CodeStatement statement in tryStatement.TryStatements) {
VisitCodeStatement(statement);
}
WriteLine("Catch clauses follow: Count: " + tryStatement.CatchClauses.Count);
foreach (CodeCatchClause catchClause in tryStatement.CatchClauses) {
VisitCodeCatchClause(catchClause);
}
WriteLine("Finally statements follow: Count: " + tryStatement.FinallyStatements);
foreach (CodeStatement statement in tryStatement.FinallyStatements) {
VisitCodeStatement(statement);
}
}
}
void VisitCodeCatchClause(CodeCatchClause catchClause)
{
WriteLine("VisitCodeCatchClause");
WriteLine("Exception caught: " + catchClause.CatchExceptionType.BaseType);
WriteLine("Exception variable: " + catchClause.LocalName);
WriteLine("Catch statements follow: Count: " + catchClause.Statements.Count);
using (IDisposable currentLevel = Indentation.IncrementLevel()) {
foreach (CodeStatement statement in catchClause.Statements) {
VisitCodeStatement(statement);
}
}
}
string MemberAttributesToString(MemberAttributes attributes)
{
StringBuilder s = new StringBuilder();
s.Append("Attributes: ");
if ((attributes & MemberAttributes.Public) == MemberAttributes.Public) {
s.Append("Public, ");
}
if ((attributes & MemberAttributes.Private) == MemberAttributes.Private) {
s.Append("Private, ");
}
if ((attributes & MemberAttributes.Family) == MemberAttributes.Family) {
s.Append("Family, ");
}
if ((attributes & MemberAttributes.Final) == MemberAttributes.Final) {
s.Append("Final, ");
}
return s.ToString();
}
string UserDataKeysToString(IDictionary userData)
{
StringBuilder s = new StringBuilder();
ICollection keys = userData.Keys;
foreach (object o in keys) {
string name = o as string;
if (name != null) {
s.Append(name);
s.Append(", ");
}
}
return s.ToString();
}
/// <summary>
/// Writes a line and indents it to the current level.
/// </summary>
void WriteLine(string s)
{
writer.WriteLine(GetIndent() + s);
}
string GetIndent()
{
StringBuilder indent = new StringBuilder();
for (int i = 0; i < Indentation.CurrentLevel; ++i) {
indent.Append('\t');
}
return indent.ToString();
}
}
}

46
src/AddIns/BackendBindings/Python/PyWalker/Indentation.cs

@ -1,46 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
namespace PyWalker
{
class Indentation : IDisposable
{
static int currentLevel;
public static int CurrentLevel {
get { return currentLevel; }
}
Indentation()
{
currentLevel++;
}
public void Dispose()
{
currentLevel--;
}
public static IDisposable IncrementLevel()
{
return new Indentation();
}
}
}

210
src/AddIns/BackendBindings/Python/PyWalker/MainForm.Designer.cs generated

@ -1,210 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
namespace PyWalker
{
partial class MainForm
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.codeTextBox = new System.Windows.Forms.RichTextBox();
this.runCSharpNRefactoryVisitor = new System.Windows.Forms.Button();
this.runNRefactoryCSharpCodeDomVisitor = new System.Windows.Forms.Button();
this.runCSharpToPythonButton = new System.Windows.Forms.Button();
this.runRoundTripButton = new System.Windows.Forms.Button();
this.clearButton = new System.Windows.Forms.Button();
this.runAstWalkerButton = new System.Windows.Forms.Button();
this.walkerOutputTextBox = new System.Windows.Forms.RichTextBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout();
this.SuspendLayout();
//
// splitContainer
//
this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer.Location = new System.Drawing.Point(0, 0);
this.splitContainer.Name = "splitContainer";
this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer.Panel1
//
this.splitContainer.Panel1.Controls.Add(this.codeTextBox);
//
// splitContainer.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.runCSharpNRefactoryVisitor);
this.splitContainer.Panel2.Controls.Add(this.runNRefactoryCSharpCodeDomVisitor);
this.splitContainer.Panel2.Controls.Add(this.runCSharpToPythonButton);
this.splitContainer.Panel2.Controls.Add(this.runRoundTripButton);
this.splitContainer.Panel2.Controls.Add(this.clearButton);
this.splitContainer.Panel2.Controls.Add(this.runAstWalkerButton);
this.splitContainer.Panel2.Controls.Add(this.walkerOutputTextBox);
this.splitContainer.Size = new System.Drawing.Size(515, 386);
this.splitContainer.SplitterDistance = 138;
this.splitContainer.TabIndex = 0;
//
// codeTextBox
//
this.codeTextBox.AcceptsTab = true;
this.codeTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.codeTextBox.Location = new System.Drawing.Point(0, 0);
this.codeTextBox.Name = "codeTextBox";
this.codeTextBox.Size = new System.Drawing.Size(515, 138);
this.codeTextBox.TabIndex = 0;
this.codeTextBox.Text = "";
this.codeTextBox.WordWrap = false;
//
// runCSharpNRefactoryVisitor
//
this.runCSharpNRefactoryVisitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.runCSharpNRefactoryVisitor.Location = new System.Drawing.Point(261, 218);
this.runCSharpNRefactoryVisitor.Name = "runCSharpNRefactoryVisitor";
this.runCSharpNRefactoryVisitor.Size = new System.Drawing.Size(117, 23);
this.runCSharpNRefactoryVisitor.TabIndex = 8;
this.runCSharpNRefactoryVisitor.Text = "Visit C# AST";
this.toolTip.SetToolTip(this.runCSharpNRefactoryVisitor, "Walks the NRefactory AST generated from the C# code.");
this.runCSharpNRefactoryVisitor.UseVisualStyleBackColor = true;
this.runCSharpNRefactoryVisitor.Click += new System.EventHandler(this.RunCSharpNRefactoryVisitorClick);
//
// runNRefactoryCSharpCodeDomVisitor
//
this.runNRefactoryCSharpCodeDomVisitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.runNRefactoryCSharpCodeDomVisitor.Location = new System.Drawing.Point(384, 218);
this.runNRefactoryCSharpCodeDomVisitor.Name = "runNRefactoryCSharpCodeDomVisitor";
this.runNRefactoryCSharpCodeDomVisitor.Size = new System.Drawing.Size(127, 23);
this.runNRefactoryCSharpCodeDomVisitor.TabIndex = 7;
this.runNRefactoryCSharpCodeDomVisitor.Text = "Visit C# Code DOM";
this.toolTip.SetToolTip(this.runNRefactoryCSharpCodeDomVisitor, "Visits the code dom generated from the C# code by the NRefactory code dom visitor" +
".");
this.runNRefactoryCSharpCodeDomVisitor.UseVisualStyleBackColor = true;
this.runNRefactoryCSharpCodeDomVisitor.Click += new System.EventHandler(this.RunNRefactoryCSharpCodeDomVisitorClick);
//
// runCSharpToPythonButton
//
this.runCSharpToPythonButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.runCSharpToPythonButton.Location = new System.Drawing.Point(261, 192);
this.runCSharpToPythonButton.Name = "runCSharpToPythonButton";
this.runCSharpToPythonButton.Size = new System.Drawing.Size(117, 23);
this.runCSharpToPythonButton.TabIndex = 6;
this.runCSharpToPythonButton.Text = "C# to Python";
this.toolTip.SetToolTip(this.runCSharpToPythonButton, "Takes the code dom generated from the NRefactory parser and converts it to python" +
" using the python generator.");
this.runCSharpToPythonButton.UseVisualStyleBackColor = true;
this.runCSharpToPythonButton.Click += new System.EventHandler(this.RunCSharpToPythonClick);
//
// runRoundTripButton
//
this.runRoundTripButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.runRoundTripButton.Location = new System.Drawing.Point(138, 191);
this.runRoundTripButton.Name = "runRoundTripButton";
this.runRoundTripButton.Size = new System.Drawing.Size(117, 23);
this.runRoundTripButton.TabIndex = 4;
this.runRoundTripButton.Text = "Round Trip";
this.toolTip.SetToolTip(this.runRoundTripButton, "Generates a code dom from the python code and then generates python code from the" +
" code dom.");
this.runRoundTripButton.UseVisualStyleBackColor = true;
this.runRoundTripButton.Click += new System.EventHandler(this.RunRoundTripButtonClick);
//
// clearButton
//
this.clearButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.clearButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.clearButton.Location = new System.Drawing.Point(138, 218);
this.clearButton.Name = "clearButton";
this.clearButton.Size = new System.Drawing.Size(117, 23);
this.clearButton.TabIndex = 2;
this.clearButton.Text = "Clear";
this.clearButton.UseVisualStyleBackColor = true;
this.clearButton.Click += new System.EventHandler(this.ClearButtonClick);
//
// runAstWalkerButton
//
this.runAstWalkerButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.runAstWalkerButton.Location = new System.Drawing.Point(384, 191);
this.runAstWalkerButton.Name = "runAstWalkerButton";
this.runAstWalkerButton.Size = new System.Drawing.Size(127, 23);
this.runAstWalkerButton.TabIndex = 1;
this.runAstWalkerButton.Text = "Visit AST";
this.toolTip.SetToolTip(this.runAstWalkerButton, "Walks the python AST generated from the python code.");
this.runAstWalkerButton.UseVisualStyleBackColor = true;
this.runAstWalkerButton.Click += new System.EventHandler(this.RunAstWalkerButtonClick);
//
// walkerOutputTextBox
//
this.walkerOutputTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.walkerOutputTextBox.Location = new System.Drawing.Point(0, 2);
this.walkerOutputTextBox.Name = "walkerOutputTextBox";
this.walkerOutputTextBox.Size = new System.Drawing.Size(515, 184);
this.walkerOutputTextBox.TabIndex = 0;
this.walkerOutputTextBox.Text = "";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(515, 386);
this.Controls.Add(this.splitContainer);
this.Name = "MainForm";
this.Text = "PyWalker";
this.splitContainer.Panel1.ResumeLayout(false);
this.splitContainer.Panel2.ResumeLayout(false);
this.splitContainer.ResumeLayout(false);
this.ResumeLayout(false);
}
private System.Windows.Forms.Button runCSharpNRefactoryVisitor;
private System.Windows.Forms.Button runNRefactoryCSharpCodeDomVisitor;
private System.Windows.Forms.Button runCSharpToPythonButton;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.Button runRoundTripButton;
private System.Windows.Forms.Button clearButton;
private System.Windows.Forms.Button runAstWalkerButton;
private System.Windows.Forms.RichTextBox walkerOutputTextBox;
private System.Windows.Forms.RichTextBox codeTextBox;
private System.Windows.Forms.SplitContainer splitContainer;
}
}

157
src/AddIns/BackendBindings/Python/PyWalker/MainForm.cs

@ -1,157 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.PythonBinding;
using IronPython;
using IronPython.Compiler;
using IronPython.Compiler.Ast;
using IronPython.Runtime;
using Microsoft.CSharp;
using Microsoft.Scripting;
using Microsoft.Scripting.Runtime;
using NRefactory = ICSharpCode.NRefactory;
namespace PyWalker
{
public partial class MainForm : Form, IOutputWriter
{
public MainForm()
{
InitializeComponent();
}
public void WriteLine(string s)
{
walkerOutputTextBox.Text += String.Concat(s, "\r\n");
}
void RunAstWalkerButtonClick(object sender, EventArgs e)
{
try {
IronPython.Hosting.Python.CreateEngine();
Clear();
PythonCompilerSink sink = new PythonCompilerSink();
SourceUnit source = DefaultContext.DefaultPythonContext.CreateFileUnit(@"D:\Temp.py", codeTextBox.Text);
CompilerContext context = new CompilerContext(source, new PythonCompilerOptions(), sink);
Parser parser = Parser.CreateParser(context, new PythonOptions());
PythonAst ast = parser.ParseFile(false);
if (sink.Errors.Count == 0) {
ResolveWalker walker = new ResolveWalker(this);
ast.Walk(walker);
} else {
walkerOutputTextBox.Text += "\r\n";
foreach (PythonCompilerError error in sink.Errors) {
walkerOutputTextBox.Text += error.ToString() + "\r\n";
}
}
} catch (Exception ex) {
walkerOutputTextBox.Text = ex.ToString();
}
}
void ClearButtonClick(object sender, EventArgs e)
{
Clear();
}
void Clear()
{
walkerOutputTextBox.Text = String.Empty;
}
/// <summary>
/// Round trips the Python code through the code DOM and back
/// to source code.
/// </summary>
void RunRoundTripButtonClick(object sender, EventArgs e)
{
try {
Clear();
// PythonProvider provider = new PythonProvider();
// CodeCompileUnit unit = provider.Parse(new StringReader(codeTextBox.Text));
// StringWriter writer = new StringWriter();
// CodeGeneratorOptions options = new CodeGeneratorOptions();
// options.BlankLinesBetweenMembers = false;
// options.IndentString = "\t";
// provider.GenerateCodeFromCompileUnit(unit, writer, options);
//
// walkerOutputTextBox.Text = writer.ToString();
} catch (Exception ex) {
walkerOutputTextBox.Text = ex.ToString();
}
}
/// <summary>
/// Converts the C# code to a code dom using the NRefactory
/// library and then visits the code dom.
/// </summary>
void RunCSharpToPythonClick(object sender, EventArgs e)
{
try {
Clear();
NRefactoryToPythonConverter converter = new NRefactoryToPythonConverter(NRefactory.SupportedLanguage.CSharp);
walkerOutputTextBox.Text = converter.Convert(codeTextBox.Text);
} catch (Exception ex) {
walkerOutputTextBox.Text = ex.ToString();
}
}
/// <summary>
/// Converts C# to python using the code dom generated by the
/// NRefactory parser.
/// </summary>
void RunNRefactoryCSharpCodeDomVisitorClick(object sender, EventArgs e)
{
try {
Clear();
using (NRefactory.IParser parser = NRefactory.ParserFactory.CreateParser(NRefactory.SupportedLanguage.CSharp, new StringReader(codeTextBox.Text))) {
parser.ParseMethodBodies = false;
parser.Parse();
NRefactory.Visitors.CodeDomVisitor visitor = new NRefactory.Visitors.CodeDomVisitor();
visitor.VisitCompilationUnit(parser.CompilationUnit, null);
CodeDomVisitor codeDomVisitor = new CodeDomVisitor(this);
codeDomVisitor.Visit(visitor.codeCompileUnit);
}
} catch (Exception ex) {
walkerOutputTextBox.Text = ex.ToString();
}
}
void RunCSharpNRefactoryVisitorClick(object sender, EventArgs e)
{
try {
Clear();
using (NRefactory.IParser parser = NRefactory.ParserFactory.CreateParser(NRefactory.SupportedLanguage.CSharp, new StringReader(codeTextBox.Text))) {
parser.ParseMethodBodies = false;
parser.Parse();
NRefactoryAstVisitor visitor = new NRefactoryAstVisitor(this);
visitor.VisitCompilationUnit(parser.CompilationUnit, null);
}
} catch (Exception ex) {
walkerOutputTextBox.Text = ex.ToString();
}
}
}
}

123
src/AddIns/BackendBindings/Python/PyWalker/MainForm.resx

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

678
src/AddIns/BackendBindings/Python/PyWalker/NRefactoryAstVisitor.cs

@ -1,678 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.Visitors;
namespace PyWalker
{
public class NRefactoryAstVisitor : AbstractAstVisitor
{
IOutputWriter writer;
public NRefactoryAstVisitor(IOutputWriter writer)
{
this.writer = writer;
}
public override object VisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data)
{
return base.VisitAddHandlerStatement(addHandlerStatement, data);
}
public override object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data)
{
return base.VisitAddressOfExpression(addressOfExpression, data);
}
public override object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data)
{
return base.VisitAnonymousMethodExpression(anonymousMethodExpression, data);
}
public override object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data)
{
return base.VisitArrayCreateExpression(arrayCreateExpression, data);
}
public override object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
{
WriteLine("VisitAssignmentExpression");
return base.VisitAssignmentExpression(assignmentExpression, data);
}
public override object VisitAttribute(ICSharpCode.NRefactory.Ast.Attribute attribute, object data)
{
return base.VisitAttribute(attribute, data);
}
public override object VisitAttributeSection(AttributeSection attributeSection, object data)
{
return base.VisitAttributeSection(attributeSection, data);
}
public override object VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data)
{
return base.VisitBaseReferenceExpression(baseReferenceExpression, data);
}
public override object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data)
{
return base.VisitBinaryOperatorExpression(binaryOperatorExpression, data);
}
public override object VisitBlockStatement(BlockStatement blockStatement, object data)
{
return base.VisitBlockStatement(blockStatement, data);
}
public override object VisitBreakStatement(BreakStatement breakStatement, object data)
{
return base.VisitBreakStatement(breakStatement, data);
}
public override object VisitCaseLabel(CaseLabel caseLabel, object data)
{
return base.VisitCaseLabel(caseLabel, data);
}
public override object VisitCastExpression(CastExpression castExpression, object data)
{
return base.VisitCastExpression(castExpression, data);
}
public override object VisitCatchClause(CatchClause catchClause, object data)
{
return base.VisitCatchClause(catchClause, data);
}
public override object VisitCheckedExpression(CheckedExpression checkedExpression, object data)
{
return base.VisitCheckedExpression(checkedExpression, data);
}
public override object VisitCheckedStatement(CheckedStatement checkedStatement, object data)
{
return base.VisitCheckedStatement(checkedStatement, data);
}
public override object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data)
{
return base.VisitClassReferenceExpression(classReferenceExpression, data);
}
public override object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data)
{
WriteLine("VisitCollectionInitializerExpression");
return base.VisitCollectionInitializerExpression(collectionInitializerExpression, data);
}
public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
WriteLine("VisitCodeCompileUnit");
return base.VisitCompilationUnit(compilationUnit, data);
}
public override object VisitConditionalExpression(ConditionalExpression conditionalExpression, object data)
{
return base.VisitConditionalExpression(conditionalExpression, data);
}
public override object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data)
{
WriteLine("VisitConstructorDeclaration");
return base.VisitConstructorDeclaration(constructorDeclaration, data);
}
public override object VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data)
{
WriteLine("VisitConstructorInitializer");
return base.VisitConstructorInitializer(constructorInitializer, data);
}
public override object VisitContinueStatement(ContinueStatement continueStatement, object data)
{
return base.VisitContinueStatement(continueStatement, data);
}
public override object VisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data)
{
return base.VisitDeclareDeclaration(declareDeclaration, data);
}
public override object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data)
{
return base.VisitDefaultValueExpression(defaultValueExpression, data);
}
public override object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data)
{
return base.VisitDelegateDeclaration(delegateDeclaration, data);
}
public override object VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, object data)
{
return base.VisitDestructorDeclaration(destructorDeclaration, data);
}
public override object VisitDirectionExpression(DirectionExpression directionExpression, object data)
{
return base.VisitDirectionExpression(directionExpression, data);
}
public override object VisitDoLoopStatement(DoLoopStatement doLoopStatement, object data)
{
return base.VisitDoLoopStatement(doLoopStatement, data);
}
public override object VisitElseIfSection(ElseIfSection elseIfSection, object data)
{
return base.VisitElseIfSection(elseIfSection, data);
}
public override object VisitEmptyStatement(EmptyStatement emptyStatement, object data)
{
WriteLine("VisitEmptyStatement");
return base.VisitEmptyStatement(emptyStatement, data);
}
public override object VisitEndStatement(EndStatement endStatement, object data)
{
return base.VisitEndStatement(endStatement, data);
}
public override object VisitEraseStatement(EraseStatement eraseStatement, object data)
{
return base.VisitEraseStatement(eraseStatement, data);
}
public override object VisitErrorStatement(ErrorStatement errorStatement, object data)
{
return base.VisitErrorStatement(errorStatement, data);
}
public override object VisitEventAddRegion(EventAddRegion eventAddRegion, object data)
{
return base.VisitEventAddRegion(eventAddRegion, data);
}
public override object VisitEventDeclaration(EventDeclaration eventDeclaration, object data)
{
return base.VisitEventDeclaration(eventDeclaration, data);
}
public override object VisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data)
{
return base.VisitEventRaiseRegion(eventRaiseRegion, data);
}
public override object VisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data)
{
return base.VisitEventRemoveRegion(eventRemoveRegion, data);
}
public override object VisitExitStatement(ExitStatement exitStatement, object data)
{
return base.VisitExitStatement(exitStatement, data);
}
public override object VisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data)
{
return base.VisitExpressionRangeVariable(expressionRangeVariable, data);
}
public override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
{
WriteLine("VisitExpressionStatement");
return base.VisitExpressionStatement(expressionStatement, data);
}
public override object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data)
{
WriteLine("VisitFieldDeclaration: " + fieldDeclaration.Fields[0].Name);
return base.VisitFieldDeclaration(fieldDeclaration, data);
}
public override object VisitFixedStatement(FixedStatement fixedStatement, object data)
{
return base.VisitFixedStatement(fixedStatement, data);
}
public override object VisitForeachStatement(ForeachStatement foreachStatement, object data)
{
return base.VisitForeachStatement(foreachStatement, data);
}
public override object VisitForNextStatement(ForNextStatement forNextStatement, object data)
{
return base.VisitForNextStatement(forNextStatement, data);
}
public override object VisitForStatement(ForStatement forStatement, object data)
{
return base.VisitForStatement(forStatement, data);
}
public override object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data)
{
return base.VisitGotoCaseStatement(gotoCaseStatement, data);
}
public override object VisitGotoStatement(GotoStatement gotoStatement, object data)
{
return base.VisitGotoStatement(gotoStatement, data);
}
public override object VisitIdentifierExpression(IdentifierExpression identifierExpression, object data)
{
WriteLine("VisitIdentifierExpression");
return base.VisitIdentifierExpression(identifierExpression, data);
}
public override object VisitIfElseStatement(IfElseStatement ifElseStatement, object data)
{
return base.VisitIfElseStatement(ifElseStatement, data);
}
public override object VisitIndexerExpression(IndexerExpression indexerExpression, object data)
{
return base.VisitIndexerExpression(indexerExpression, data);
}
public override object VisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data)
{
return base.VisitInnerClassTypeReference(innerClassTypeReference, data);
}
public override object VisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data)
{
return base.VisitInterfaceImplementation(interfaceImplementation, data);
}
public override object VisitInvocationExpression(InvocationExpression invocationExpression, object data)
{
return base.VisitInvocationExpression(invocationExpression, data);
}
public override object VisitLabelStatement(LabelStatement labelStatement, object data)
{
return base.VisitLabelStatement(labelStatement, data);
}
public override object VisitLambdaExpression(LambdaExpression lambdaExpression, object data)
{
return base.VisitLambdaExpression(lambdaExpression, data);
}
public override object VisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data)
{
WriteLine("VisitLocalVariableDeclaration");
return base.VisitLocalVariableDeclaration(localVariableDeclaration, data);
}
public override object VisitLockStatement(LockStatement lockStatement, object data)
{
return base.VisitLockStatement(lockStatement, data);
}
public override object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data)
{
WriteLine("VisitMemberReferenceExpression");
return base.VisitMemberReferenceExpression(memberReferenceExpression, data);
}
public override object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data)
{
WriteLine("VisitMethodDeclaration");
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
return base.VisitMethodDeclaration(methodDeclaration, data);
}
}
public override object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
{
return base.VisitNamedArgumentExpression(namedArgumentExpression, data);
}
public override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
WriteLine("VisitNamespaceDeclaration");
return base.VisitNamespaceDeclaration(namespaceDeclaration, data);
}
public override object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data)
{
WriteLine("VisitObjectCreateExpression");
return base.VisitObjectCreateExpression(objectCreateExpression, data);
}
public override object VisitOnErrorStatement(OnErrorStatement onErrorStatement, object data)
{
return base.VisitOnErrorStatement(onErrorStatement, data);
}
public override object VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data)
{
return base.VisitOperatorDeclaration(operatorDeclaration, data);
}
public override object VisitOptionDeclaration(OptionDeclaration optionDeclaration, object data)
{
return base.VisitOptionDeclaration(optionDeclaration, data);
}
public override object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
{
return base.VisitParameterDeclarationExpression(parameterDeclarationExpression, data);
}
public override object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data)
{
return base.VisitParenthesizedExpression(parenthesizedExpression, data);
}
public override object VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, object data)
{
return base.VisitPointerReferenceExpression(pointerReferenceExpression, data);
}
public override object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data)
{
return base.VisitPrimitiveExpression(primitiveExpression, data);
}
public override object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data)
{
return base.VisitPropertyDeclaration(propertyDeclaration, data);
}
public override object VisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data)
{
return base.VisitPropertyGetRegion(propertyGetRegion, data);
}
public override object VisitPropertySetRegion(PropertySetRegion propertySetRegion, object data)
{
return base.VisitPropertySetRegion(propertySetRegion, data);
}
public override object VisitQueryExpression(QueryExpression queryExpression, object data)
{
return base.VisitQueryExpression(queryExpression, data);
}
public override object VisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data)
{
return base.VisitQueryExpressionAggregateClause(queryExpressionAggregateClause, data);
}
public override object VisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data)
{
return base.VisitQueryExpressionDistinctClause(queryExpressionDistinctClause, data);
}
public override object VisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data)
{
return base.VisitQueryExpressionFromClause(queryExpressionFromClause, data);
}
public override object VisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data)
{
return base.VisitQueryExpressionGroupClause(queryExpressionGroupClause, data);
}
public override object VisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data)
{
return base.VisitQueryExpressionGroupJoinVBClause(queryExpressionGroupJoinVBClause, data);
}
public override object VisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data)
{
return base.VisitQueryExpressionGroupVBClause(queryExpressionGroupVBClause, data);
}
public override object VisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data)
{
return base.VisitQueryExpressionJoinClause(queryExpressionJoinClause, data);
}
public override object VisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data)
{
return base.VisitQueryExpressionJoinConditionVB(queryExpressionJoinConditionVB, data);
}
public override object VisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data)
{
return base.VisitQueryExpressionJoinVBClause(queryExpressionJoinVBClause, data);
}
public override object VisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data)
{
return base.VisitQueryExpressionLetClause(queryExpressionLetClause, data);
}
public override object VisitQueryExpressionLetVBClause(QueryExpressionLetVBClause queryExpressionLetVBClause, object data)
{
return base.VisitQueryExpressionLetVBClause(queryExpressionLetVBClause, data);
}
public override object VisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data)
{
return base.VisitQueryExpressionOrderClause(queryExpressionOrderClause, data);
}
public override object VisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data)
{
return base.VisitQueryExpressionOrdering(queryExpressionOrdering, data);
}
public override object VisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data)
{
return base.VisitQueryExpressionPartitionVBClause(queryExpressionPartitionVBClause, data);
}
public override object VisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data)
{
return base.VisitQueryExpressionSelectClause(queryExpressionSelectClause, data);
}
public override object VisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data)
{
return base.VisitQueryExpressionSelectVBClause(queryExpressionSelectVBClause, data);
}
public override object VisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data)
{
return base.VisitQueryExpressionWhereClause(queryExpressionWhereClause, data);
}
public override object VisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data)
{
return base.VisitRaiseEventStatement(raiseEventStatement, data);
}
public override object VisitReDimStatement(ReDimStatement reDimStatement, object data)
{
return base.VisitReDimStatement(reDimStatement, data);
}
public override object VisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data)
{
return base.VisitRemoveHandlerStatement(removeHandlerStatement, data);
}
public override object VisitResumeStatement(ResumeStatement resumeStatement, object data)
{
return base.VisitResumeStatement(resumeStatement, data);
}
public override object VisitReturnStatement(ReturnStatement returnStatement, object data)
{
return base.VisitReturnStatement(returnStatement, data);
}
public override object VisitSizeOfExpression(SizeOfExpression sizeOfExpression, object data)
{
return base.VisitSizeOfExpression(sizeOfExpression, data);
}
public override object VisitStackAllocExpression(StackAllocExpression stackAllocExpression, object data)
{
return base.VisitStackAllocExpression(stackAllocExpression, data);
}
public override object VisitStopStatement(StopStatement stopStatement, object data)
{
return base.VisitStopStatement(stopStatement, data);
}
public override object VisitSwitchSection(SwitchSection switchSection, object data)
{
return base.VisitSwitchSection(switchSection, data);
}
public override object VisitSwitchStatement(SwitchStatement switchStatement, object data)
{
return base.VisitSwitchStatement(switchStatement, data);
}
public override object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data)
{
return base.VisitTemplateDefinition(templateDefinition, data);
}
public override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data)
{
WriteLine("VisitThisReferenceExpression");
return base.VisitThisReferenceExpression(thisReferenceExpression, data);
}
public override object VisitThrowStatement(ThrowStatement throwStatement, object data)
{
return base.VisitThrowStatement(throwStatement, data);
}
public override object VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data)
{
return base.VisitTryCatchStatement(tryCatchStatement, data);
}
public override object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data)
{
WriteLine("VisitTypeDeclaration");
using (IDisposable indentLevel = Indentation.IncrementLevel()) {
return base.VisitTypeDeclaration(typeDeclaration, data);
}
}
public override object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data)
{
return base.VisitTypeOfExpression(typeOfExpression, data);
}
public override object VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data)
{
return base.VisitTypeOfIsExpression(typeOfIsExpression, data);
}
public override object VisitTypeReference(TypeReference typeReference, object data)
{
return base.VisitTypeReference(typeReference, data);
}
public override object VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data)
{
return base.VisitTypeReferenceExpression(typeReferenceExpression, data);
}
public override object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data)
{
return base.VisitUnaryOperatorExpression(unaryOperatorExpression, data);
}
public override object VisitUncheckedExpression(UncheckedExpression uncheckedExpression, object data)
{
return base.VisitUncheckedExpression(uncheckedExpression, data);
}
public override object VisitUncheckedStatement(UncheckedStatement uncheckedStatement, object data)
{
return base.VisitUncheckedStatement(uncheckedStatement, data);
}
public override object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data)
{
return base.VisitUnsafeStatement(unsafeStatement, data);
}
public override object VisitUsing(Using @using, object data)
{
WriteLine("VisitUsing");
return base.VisitUsing(@using, data);
}
public override object VisitUsingDeclaration(UsingDeclaration usingDeclaration, object data)
{
WriteLine("VisitUsingDeclaration");
return base.VisitUsingDeclaration(usingDeclaration, data);
}
public override object VisitUsingStatement(UsingStatement usingStatement, object data)
{
WriteLine("VisitUsingStatement");
return base.VisitUsingStatement(usingStatement, data);
}
public override object VisitVariableDeclaration(VariableDeclaration variableDeclaration, object data)
{
WriteLine("VisitVariableDeclaration");
return base.VisitVariableDeclaration(variableDeclaration, data);
}
public override object VisitWithStatement(WithStatement withStatement, object data)
{
return base.VisitWithStatement(withStatement, data);
}
public override object VisitYieldStatement(YieldStatement yieldStatement, object data)
{
return base.VisitYieldStatement(yieldStatement, data);
}
/// <summary>
/// Writes a line and indents it to the current level.
/// </summary>
void WriteLine(string s)
{
writer.WriteLine(GetIndent() + s);
}
string GetIndent()
{
StringBuilder indent = new StringBuilder();
for (int i = 0; i < Indentation.CurrentLevel; ++i) {
indent.Append('\t');
}
return indent.ToString();
}
}
}

84
src/AddIns/BackendBindings/Python/PyWalker/PyWalker.csproj

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectGuid>{55329704-6046-48EC-8A20-5C80B3092A63}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>WinExe</OutputType>
<RootNamespace>PyWalker</RootNamespace>
<AssemblyName>PyWalker</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<StartAction>Project</StartAction>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="IronPython">
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules">
<HintPath>..\RequiredLibraries\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic">
<HintPath>..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CodeDomVisitor.cs" />
<Compile Include="Indentation.cs" />
<Compile Include="MainForm.cs" />
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="NRefactoryAstVisitor.cs" />
<Compile Include="Program.cs" />
<Compile Include="ResolveWalker.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
</ProjectReference>
<ProjectReference Include="..\PythonBinding\Project\PythonBinding.csproj">
<Project>{8D732610-8FC6-43BA-94C9-7126FD7FE361}</Project>
<Name>PythonBinding</Name>
</ProjectReference>
</ItemGroup>
</Project>

237
src/AddIns/BackendBindings/Python/PyWalker/ResolveWalker.cs

@ -1,237 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Text;
using IronPython;
using IronPython.Compiler;
using IronPython.Compiler.Ast;
namespace PyWalker
{
public interface IOutputWriter
{
void WriteLine(string s);
}
public class ResolveWalker : PythonWalker
{
IOutputWriter writer;
public ResolveWalker(IOutputWriter writer)
{
this.writer = writer;
}
public override bool Walk(AndExpression node)
{
writer.WriteLine("And");
return base.Walk(node);
}
public override bool Walk(AssertStatement node)
{
writer.WriteLine("Assert");
return base.Walk(node);
}
public override bool Walk(Arg node)
{
writer.WriteLine("Arg: " + node.Name.ToString());
return base.Walk(node);
}
public override bool Walk(AugmentedAssignStatement node)
{
writer.WriteLine("AugmentedAssignStatement");
return base.Walk(node);
}
public override bool Walk(AssignmentStatement node)
{
writer.WriteLine("AssignmentStatement");
return base.Walk(node);
}
public override bool Walk(BackQuoteExpression node)
{
writer.WriteLine("BackQuote");
return base.Walk(node);
}
public override bool Walk(BinaryExpression node)
{
writer.WriteLine("Binary");
return base.Walk(node);
}
public override bool Walk(BreakStatement node)
{
writer.WriteLine("Breaks");
return base.Walk(node);
}
public override bool Walk(ClassDefinition node)
{
if (node.Bases.Count > 0) {
writer.WriteLine("Class: " + node.Name + " BaseTypes: " + GetBaseTypes(node.Bases));
} else {
writer.WriteLine("Class: " + node.Name);
}
return base.Walk(node);
}
public override bool Walk(ConditionalExpression node)
{
writer.WriteLine("ConditionalExpression");
return base.Walk(node);
}
public override bool Walk(ConstantExpression node)
{
writer.WriteLine("ConstantExpression");
return base.Walk(node);
}
public override bool Walk(ContinueStatement node)
{
writer.WriteLine("Continue");
return base.Walk(node);
}
public override bool Walk(PrintStatement node)
{
writer.WriteLine("PrintStatement");
return base.Walk(node);
}
public override bool Walk(FunctionDefinition node)
{
writer.WriteLine("FunctionDefinition");
return base.Walk(node);
}
public override bool Walk(CallExpression node)
{
writer.WriteLine("Call");
return base.Walk(node);
}
public override bool Walk(DictionaryExpression node)
{
writer.WriteLine("Dict");
return base.Walk(node);
}
public override bool Walk(DottedName node)
{
writer.WriteLine("DottedName");
return base.Walk(node);
}
public override bool Walk(ExpressionStatement node)
{
writer.WriteLine("Expr");
return base.Walk(node);
}
public override bool Walk(GlobalStatement node)
{
writer.WriteLine("Global");
return base.Walk(node);
}
public override bool Walk(NameExpression node)
{
writer.WriteLine("Name: " + node.Name);
return base.Walk(node);
}
public override bool Walk(MemberExpression node)
{
writer.WriteLine("Member: " + node.Name);
return base.Walk(node);
}
public override bool Walk(FromImportStatement node)
{
writer.WriteLine("FromImport: " + node.Root.MakeString());
return base.Walk(node);
}
public override bool Walk(ImportStatement node)
{
writer.WriteLine("Import: " + GetImports(node.Names));
return base.Walk(node);
}
public override bool Walk(IndexExpression node)
{
writer.WriteLine("Index: " + node.Index.ToString());
return base.Walk(node);
}
public override bool Walk(UnaryExpression node)
{
writer.WriteLine("Unary");
return base.Walk(node);
}
public override bool Walk(SuiteStatement node)
{
writer.WriteLine("Suite");
return base.Walk(node);
}
public override bool Walk(ErrorExpression node)
{
writer.WriteLine("Error");
return base.Walk(node);
}
public override bool Walk(IfStatement node)
{
writer.WriteLine("If");
return base.Walk(node);
}
string GetImports(IList<DottedName> names)
{
StringBuilder s = new StringBuilder();
foreach (DottedName name in names) {
s.Append(name.MakeString());
s.Append(',');
}
return s.ToString();
}
string GetBaseTypes(IList<Expression> types)
{
StringBuilder s = new StringBuilder();
foreach (Expression expression in types) {
NameExpression nameExpression = expression as NameExpression;
if (nameExpression != null) {
s.Append(nameExpression.Name.ToString());
s.Append(',');
}
}
return s.ToString();
}
}
}

31
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Configuration/AssemblyInfo.cs

@ -1,31 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Reflection;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("Python.Build.Tasks")]
[assembly: AssemblyDescription("Provides IronPython build tasks for the IronPython addin.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

79
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Python.Build.Tasks.csproj

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectGuid>{D332F2D1-2CF1-43B7-903C-844BD5211A7E}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>ICSharpCode.Python.Build.Tasks</RootNamespace>
<AssemblyName>Python.Build.Tasks</AssemblyName>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\..\..\..\AddIns\BackendBindings\PythonBinding\</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\..\..\..\..\AddIns\BackendBindings\PythonBinding\</OutputPath>
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="IronPython">
<HintPath>..\..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules">
<HintPath>..\..\RequiredLibraries\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks" />
<Reference Include="Microsoft.Build.Utilities.v3.5">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="Microsoft.Dynamic">
<HintPath>..\..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>..\..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\IPythonCompiler.cs" />
<Compile Include="Src\PythonCompiler.cs" />
<Compile Include="Src\PythonCompilerException.cs" />
<Compile Include="Src\PythonCompilerTask.cs" />
<Compile Include="Src\ResourceFile.cs" />
<Compile Include="Src\Resources.cs" />
<None Include="SharpDevelop.Build.Python.targets">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

105
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/SharpDevelop.Build.Python.targets

@ -1,105 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<UsingTask
TaskName="ICSharpCode.Python.Build.Tasks.PythonCompilerTask"
AssemblyFile="$(PythonBinPath)\Python.Build.Tasks.dll"/>
<UsingTask
TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName"
AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(PythonBinPath)\SharpDevelop.Build.Python.targets</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.py</DefaultLanguageSourceExtension>
<Language>Python</Language>
</PropertyGroup>
<PropertyGroup>
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
</PropertyGroup>
<Target
Name="CreateManifestResourceNames"
Condition="'@(EmbeddedResource)' != ''"
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
>
<ItemGroup>
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>
<!-- Create manifest names for culture and non-culture Resx files, and for non-culture Non-Resx resources -->
<CreateCSharpManifestResourceName
ResourceFiles="@(EmbeddedResource)"
RootNamespace="$(RootNamespace)"
Condition="'%(EmbeddedResource.ManifestResourceName)' == '' and ('%(EmbeddedResource.WithCulture)' == 'false' or '%(EmbeddedResource.Type)' == 'Resx')">
<Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="_Temporary" />
</CreateCSharpManifestResourceName>
<!-- Create manifest names for all culture non-resx resources -->
<CreateCSharpManifestResourceName
ResourceFiles="@(EmbeddedResource)"
RootNamespace="$(RootNamespace)"
PrependCultureAsDirectory="false"
Condition="'%(EmbeddedResource.ManifestResourceName)' == '' and '%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'">
<Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="_Temporary" />
</CreateCSharpManifestResourceName>
<ItemGroup>
<EmbeddedResource Remove="@(EmbeddedResource)" Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"/>
<EmbeddedResource Include="@(_Temporary)" />
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>
</Target>
<Target
Name="CoreCompile"
Inputs="$(MSBuildAllProjects);
@(Compile);
@(_CoreCompileResourceInputs);
@(ReferencePath)"
Outputs="@(IntermediateAssembly)"
DependsOnTargets="$(CoreCompileDependsOn)"
>
<PythonCompilerTask
EmitDebugInformation="$(DebugSymbols)"
MainFile="$(MainFile)"
Platform="$(PlatformTarget)"
OutputAssembly="@(IntermediateAssembly)"
References="@(ReferencePath)"
Resources="@(_CoreCompileResourceInputs)"
Sources="@(Compile)"
TargetType="$(OutputType)"/>
</Target>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets"/>
<PropertyGroup>
<PrepareForRunDependsOn>
CopyFilesToOutputDirectory;CopyIntermediateAssemblyDllToOutputDirectory
</PrepareForRunDependsOn>
</PropertyGroup>
<Target
Name="PrepareForRun"
DependsOnTargets="$(PrepareForRunDependsOn)"
/>
<ItemGroup>
<IntermediateAssemblyDll Include="$(IntermediateOutputPath)$(TargetName).dll"/>
</ItemGroup>
<!-- The Python compiler generates a separate dll if an exe is compiled which needs to
be copied to the output folder -->
<Target
Name="CopyIntermediateAssemblyDllToOutputDirectory"
>
<Copy SourceFiles="@(IntermediateAssemblyDll)"
DestinationFolder="$(OutDir)"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Condition="'$(OutputType)'=='exe' Or '$(OutputType)'=='winexe'">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Target>
</Project>

83
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/IPythonCompiler.cs

@ -1,83 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace ICSharpCode.Python.Build.Tasks
{
/// <summary>
/// Python compiler interface.
/// </summary>
public interface IPythonCompiler : IDisposable
{
/// <summary>
/// Gets or sets the source files to compile.
/// </summary>
IList<string> SourceFiles { get; set; }
/// <summary>
/// Gets or sets the filenames of the referenced assemblies.
/// </summary>
IList<string> ReferencedAssemblies { get; set; }
/// <summary>
/// Gets or sets the resources to be compiled.
/// </summary>
IList<ResourceFile> ResourceFiles { get; set; }
/// <summary>
/// Executes the compiler.
/// </summary>
void Compile();
/// <summary>
/// Gets or sets the type of the compiled assembly (e.g. windows app,
/// console app or dll).
/// </summary>
PEFileKinds TargetKind { get; set; }
/// <summary>
/// Gets or sets the nature of the code in the executable produced by the compiler.
/// </summary>
PortableExecutableKinds ExecutableKind { get; set; }
/// <summary>
/// Gets or sets the machine that will be targeted by the compiler.
/// </summary>
ImageFileMachine Machine { get; set; }
/// <summary>
/// Gets or sets the file that contains the main entry point.
/// </summary>
string MainFile { get; set; }
/// <summary>
/// Gets or sets the output assembly filename.
/// </summary>
string OutputAssembly { get; set; }
/// <summary>
/// Gets or sets whether the compiler should include debug
/// information in the created assembly.
/// </summary>
bool IncludeDebugInformation { get; set; }
}
}

282
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/PythonCompiler.cs

@ -1,282 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using IronPython.Hosting;
using IronPython.Runtime;
using IronPython.Runtime.Operations;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
namespace ICSharpCode.Python.Build.Tasks
{
/// <summary>
/// Wraps the IronPython.Hosting.PythonCompiler class so it
/// implements the IPythonCompiler interface.
/// </summary>
public class PythonCompiler : IPythonCompiler
{
IList<string> sourceFiles;
IList<string> referencedAssemblies;
IList<ResourceFile> resourceFiles;
PEFileKinds targetKind = PEFileKinds.Dll;
PortableExecutableKinds executableKind = PortableExecutableKinds.ILOnly;
ImageFileMachine machine = ImageFileMachine.I386;
string mainFile = String.Empty;
bool includeDebugInformation;
string outputAssembly = String.Empty;
public PythonCompiler()
{
}
public IList<string> SourceFiles {
get { return sourceFiles; }
set { sourceFiles = value; }
}
public IList<string> ReferencedAssemblies {
get { return referencedAssemblies; }
set { referencedAssemblies = value; }
}
public IList<ResourceFile> ResourceFiles {
get { return resourceFiles; }
set { resourceFiles = value; }
}
public PEFileKinds TargetKind {
get { return targetKind; }
set { targetKind = value; }
}
public PortableExecutableKinds ExecutableKind {
get { return executableKind; }
set { executableKind = value; }
}
public ImageFileMachine Machine {
get { return machine; }
set { machine = value; }
}
public string MainFile {
get { return mainFile; }
set { mainFile = value; }
}
public string OutputAssembly {
get { return outputAssembly; }
set { outputAssembly = value; }
}
public bool IncludeDebugInformation {
get { return includeDebugInformation; }
set { includeDebugInformation = value; }
}
/// <summary>
/// The compilation requires us to change into the compile output folder since the
/// AssemblyBuilder.Save does not use a full path when generating the assembly.
/// </summary>
public void Compile()
{
VerifyParameters();
// Compile the source files to a dll first.
ScriptEngine engine = IronPython.Hosting.Python.CreateEngine();
Dictionary<string, object> dictionary = new Dictionary<string, object>();
dictionary.Add("mainModule", mainFile);
string outputAssemblyDll = Path.ChangeExtension(outputAssembly, ".dll");
ClrModule.CompileModules(DefaultContext.Default, outputAssemblyDll, dictionary, ToStringArray(sourceFiles));
// Generate an executable if required.
if (targetKind != PEFileKinds.Dll) {
// Change into compilation folder.
string originalFolder = Directory.GetCurrentDirectory();
try {
string compileFolder = Path.Combine(originalFolder, Path.GetDirectoryName(outputAssembly));
Directory.SetCurrentDirectory(compileFolder);
GenerateExecutable(outputAssemblyDll);
} finally {
Directory.SetCurrentDirectory(originalFolder);
}
}
}
/// <summary>
/// Verifies the compiler parameters that have been set correctly.
/// </summary>
public void VerifyParameters()
{
if ((mainFile == null) && (targetKind != PEFileKinds.Dll)) {
throw new PythonCompilerException(Resources.NoMainFileSpecified);
}
}
public void Dispose()
{
}
/// <summary>
/// Generates an executable from the already compiled dll.
/// </summary>
void GenerateExecutable(string outputAssemblyDll)
{
string outputAssemblyFileNameWithoutExtension = Path.GetFileNameWithoutExtension(outputAssembly);
AssemblyName assemblyName = new AssemblyName(outputAssemblyFileNameWithoutExtension);
AssemblyBuilder assemblyBuilder = PythonOps.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(outputAssemblyFileNameWithoutExtension, assemblyName.Name + ".exe");
TypeBuilder typeBuilder = moduleBuilder.DefineType("PythonMain", TypeAttributes.Public);
MethodBuilder mainMethod = typeBuilder.DefineMethod("Main", MethodAttributes.Public | MethodAttributes.Static, typeof(int), new Type[0]);
MarkMainMethodAsSTA(mainMethod);
GenerateMainMethodBody(mainMethod, outputAssemblyDll);
// Add resources.
AddResources(moduleBuilder);
// Create executable.
typeBuilder.CreateType();
assemblyBuilder.SetEntryPoint(mainMethod, targetKind);
assemblyBuilder.Save(assemblyName.Name + ".exe", executableKind, machine);
}
void MarkMainMethodAsSTA(MethodBuilder mainMethod)
{
mainMethod.SetCustomAttribute(typeof(STAThreadAttribute).GetConstructor(Type.EmptyTypes), new byte[0]);
}
void GenerateMainMethodBody(MethodBuilder mainMethod, string outputAssemblyDll)
{
ILGenerator generator = mainMethod.GetILGenerator();
LocalBuilder exeAssemblyLocalVariable = generator.DeclareLocal(typeof(Assembly));
LocalBuilder directoryLocalVariable = generator.DeclareLocal(typeof(string));
LocalBuilder fileNameLocalVariable = generator.DeclareLocal(typeof(string));
generator.EmitCall(OpCodes.Call, typeof(Assembly).GetMethod("GetExecutingAssembly", new Type[0], new ParameterModifier[0]), null);
generator.Emit(OpCodes.Stloc_0);
generator.Emit(OpCodes.Ldloc_0);
generator.EmitCall(OpCodes.Callvirt, typeof(Assembly).GetMethod("get_Location"), null);
generator.EmitCall(OpCodes.Call, typeof(Path).GetMethod("GetDirectoryName", new Type[] {typeof(String)}, new ParameterModifier[0]), null);
generator.Emit(OpCodes.Stloc_1);
generator.Emit(OpCodes.Ldloc_1);
generator.Emit(OpCodes.Ldstr, Path.GetFileName(outputAssemblyDll));
generator.EmitCall(OpCodes.Call, typeof(Path).GetMethod("Combine", new Type[] {typeof(String), typeof(String)}, new ParameterModifier[0]), null);
generator.Emit(OpCodes.Stloc_2);
generator.Emit(OpCodes.Ldloc_2);
generator.EmitCall(OpCodes.Call, typeof(Assembly).GetMethod("LoadFile", new Type[] {typeof(String)}, new ParameterModifier[0]), null);
generator.Emit(OpCodes.Ldstr, Path.GetFileNameWithoutExtension(mainFile));
// Add referenced assemblies.
AddReferences(generator);
generator.EmitCall(OpCodes.Call, typeof(PythonOps).GetMethod("InitializeModule"), new Type[0]);
generator.Emit(OpCodes.Ret);
}
/// <summary>
/// Converts an IList<string> into a string[].
/// </summary>
string[] ToStringArray(IList<string> items)
{
string[] array = new string[items.Count];
items.CopyTo(array, 0);
return array;
}
/// <summary>
/// Adds reference information to the IL.
/// </summary>
void AddReferences(ILGenerator generator)
{
if (referencedAssemblies.Count > 0) {
generator.Emit(OpCodes.Ldc_I4, referencedAssemblies.Count);
generator.Emit(OpCodes.Newarr, typeof(String));
for (int i = 0; i < referencedAssemblies.Count; ++i) {
generator.Emit(OpCodes.Dup);
generator.Emit(OpCodes.Ldc_I4, i);
string assemblyFileName = referencedAssemblies[i];
Assembly assembly = Assembly.ReflectionOnlyLoadFrom(assemblyFileName);
generator.Emit(OpCodes.Ldstr, assembly.FullName);
generator.Emit(OpCodes.Stelem_Ref);
}
} else {
generator.Emit(OpCodes.Ldnull);
}
}
/// <summary>
/// Embeds resources into the assembly.
/// </summary>
void AddResources(ModuleBuilder moduleBuilder)
{
foreach (ResourceFile resourceFile in resourceFiles) {
AddResource(moduleBuilder, resourceFile);
}
}
/// <summary>
/// Embeds a single resource into the assembly.
/// </summary>
void AddResource(ModuleBuilder moduleBuilder, ResourceFile resourceFile)
{
string fileName = resourceFile.FileName;
string extension = Path.GetExtension(fileName).ToLowerInvariant();
if (extension == ".resources") {
string fullFileName = Path.GetFileName(fileName);
IResourceWriter resourceWriter = moduleBuilder.DefineResource(fullFileName, resourceFile.Name, ResourceAttributes.Public);
AddResources(resourceWriter, fileName);
} else {
moduleBuilder.DefineManifestResource(resourceFile.Name, new FileStream(fileName, FileMode.Open), ResourceAttributes.Public);
}
}
void AddResources(IResourceWriter resourceWriter, string fileName)
{
ResourceReader resourceReader = new ResourceReader(fileName);
using (resourceReader) {
IDictionaryEnumerator enumerator = resourceReader.GetEnumerator();
while (enumerator.MoveNext()) {
string key = enumerator.Key as string;
Stream resourceStream = enumerator.Value as Stream;
if (resourceStream != null) {
BinaryReader reader = new BinaryReader(resourceStream);
MemoryStream stream = new MemoryStream();
byte[] bytes = reader.ReadBytes((int)resourceStream.Length);
stream.Write(bytes, 0, bytes.Length);
resourceWriter.AddResource(key, stream);
} else {
resourceWriter.AddResource(key, enumerator.Value);
}
}
}
}
}
}

313
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/PythonCompilerTask.cs

@ -1,313 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using IronPython.Hosting;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Scripting;
namespace ICSharpCode.Python.Build.Tasks
{
/// <summary>
/// Python compiler task.
/// </summary>
public class PythonCompilerTask : Task
{
IPythonCompiler compiler;
ITaskItem[] sources;
ITaskItem[] references;
ITaskItem[] resources;
string targetType;
string mainFile;
string outputAssembly;
bool emitDebugInformation;
string platform;
public PythonCompilerTask()
: this(new PythonCompiler())
{
}
public PythonCompilerTask(IPythonCompiler compiler)
{
this.compiler = compiler;
}
/// <summary>
/// Gets or sets the source files that will be compiled.
/// </summary>
public ITaskItem[] Sources {
get { return sources; }
set { sources = value; }
}
/// <summary>
/// Gets or sets the resources to be compiled.
/// </summary>
public ITaskItem[] Resources {
get { return resources; }
set { resources = value; }
}
/// <summary>
/// Gets or sets the output assembly type.
/// </summary>
public string TargetType {
get { return targetType; }
set { targetType = value; }
}
/// <summary>
/// Gets or sets the file that contains the main entry point.
/// </summary>
public string MainFile {
get { return mainFile; }
set { mainFile = value; }
}
/// <summary>
/// Gets or sets the output assembly filename.
/// </summary>
public string OutputAssembly {
get { return outputAssembly; }
set { outputAssembly = value; }
}
/// <summary>
/// Gets or sets the platform that will be targeted by the compiler (e.g. x86).
/// </summary>
public string Platform {
get { return platform; }
set { platform = value; }
}
/// <summary>
/// Gets or sets whether the compiler should include debug
/// information in the created assembly.
/// </summary>
public bool EmitDebugInformation {
get { return emitDebugInformation; }
set { emitDebugInformation = value; }
}
/// <summary>
/// Gets or sets the assembly references.
/// </summary>
public ITaskItem[] References {
get { return references; }
set { references = value; }
}
/// <summary>
/// Executes the compiler.
/// </summary>
public override bool Execute()
{
using (compiler) {
// Set what sort of assembly we are generating
// (e.g. WinExe, Exe or Dll)
compiler.TargetKind = GetPEFileKind(targetType);
compiler.ExecutableKind = GetExecutableKind(platform);
compiler.Machine = GetMachine(platform);
compiler.SourceFiles = GetFiles(sources, false);
compiler.ReferencedAssemblies = GetFiles(references, true);
compiler.ResourceFiles = GetResourceFiles(resources);
compiler.MainFile = mainFile;
compiler.OutputAssembly = outputAssembly;
compiler.IncludeDebugInformation = emitDebugInformation;
// Compile the code.
try {
compiler.Compile();
return true;
} catch (SyntaxErrorException ex) {
LogSyntaxError(ex);
} catch (IOException ex) {
LogError(ex.Message);
} catch (PythonCompilerException ex) {
LogError(ex.Message);
}
}
return false;
}
/// <summary>
/// Gets the current folder where this task is being executed from.
/// </summary>
protected virtual string GetCurrentFolder()
{
return Directory.GetCurrentDirectory();
}
/// <summary>
/// Logs any error message that occurs during compilation. Default implementation
/// is to use the MSBuild task's base.Log.LogError(...)
/// </summary>
protected virtual void LogError(string message, string errorCode, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber)
{
Log.LogError(null, errorCode, null, file, lineNumber, columnNumber, endLineNumber, endColumnNumber, message);
}
void LogError(string message)
{
LogError(message, null, null, 0, 0, 0, 0);
}
void LogSyntaxError(SyntaxErrorException ex)
{
string fileName = GetFileName(ex, sources);
LogError(ex.Message, ex.ErrorCode.ToString(), fileName, ex.Line, ex.Column, ex.RawSpan.End.Line, ex.RawSpan.End.Column);
}
/// <summary>
/// Matches the syntax exception SourcePath against filenames being compiled. The
/// syntax exception only contains the file name without its path and without its file extension.
/// </summary>
string GetFileName(SyntaxErrorException ex, ITaskItem[] sources)
{
if (ex.SourcePath == null) {
return null;
}
string sourcePath = ex.SourcePath.Replace('\\', '.');
foreach (ITaskItem item in sources) {
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(item.ItemSpec);
if (fileNameWithoutExtension == sourcePath) {
return item.ItemSpec;
}
}
string fileName = sourcePath + ".py";
return Path.Combine(GetCurrentFolder(), fileName);
}
/// <summary>
/// Maps from the target type string to the PEFileKind
/// needed by the compiler.
/// </summary>
static PEFileKinds GetPEFileKind(string targetType)
{
if (targetType != null) {
switch (targetType.ToLowerInvariant()) {
case "winexe":
return PEFileKinds.WindowApplication;
case "library":
return PEFileKinds.Dll;
}
}
return PEFileKinds.ConsoleApplication;
}
/// <summary>
/// Converts from an array of ITaskItems to a list of
/// strings, each containing the ITaskItem filename.
/// </summary>
IList<string> GetFiles(ITaskItem[] taskItems, bool fullPath)
{
List<string> files = new List<string>();
if (taskItems != null) {
foreach (ITaskItem item in taskItems) {
string fileName = item.ItemSpec;
if (fullPath) {
fileName = GetFullPath(item.ItemSpec);
}
files.Add(fileName);
}
}
return files;
}
/// <summary>
/// Converts the string into a PortableExecutableKinds enum.
/// </summary>
PortableExecutableKinds GetExecutableKind(string platform)
{
switch (platform) {
case "x86":
return PortableExecutableKinds.ILOnly | PortableExecutableKinds.Required32Bit;
case "Itanium":
case "x64":
return PortableExecutableKinds.ILOnly | PortableExecutableKinds.PE32Plus;
}
return PortableExecutableKinds.ILOnly;
}
/// <summary>
/// Gets the machine associated with a PortalExecutableKind.
/// </summary>
ImageFileMachine GetMachine(string platform)
{
switch (platform) {
case "Itanium":
return ImageFileMachine.IA64;
case "x64":
return ImageFileMachine.AMD64;
}
return ImageFileMachine.I386;
}
/// <summary>
/// Converts from an array of ITaskItems to a list of
/// ResourceFiles.
/// </summary>
/// <remarks>
/// The resource name is the filename without any preceding
/// path information.
/// </remarks>
IList<ResourceFile> GetResourceFiles(ITaskItem[] taskItems)
{
List<ResourceFile> files = new List<ResourceFile>();
if (taskItems != null) {
foreach (ITaskItem item in taskItems) {
string resourceFileName = GetFullPath(item.ItemSpec);
string resourceName = GetResourceName(item);
ResourceFile resourceFile = new ResourceFile(resourceName, resourceFileName);
files.Add(resourceFile);
}
}
return files;
}
string GetResourceName(ITaskItem item)
{
string logicalResourceName = item.GetMetadata("LogicalName");
if (!String.IsNullOrEmpty(logicalResourceName)) {
return logicalResourceName;
}
return Path.GetFileName(item.ItemSpec);
}
/// <summary>
/// Takes a relative path to a file and turns it into the full path using the current folder
/// as the base directory.
/// </summary>
string GetFullPath(string fileName)
{
if (!Path.IsPathRooted(fileName)) {
return Path.GetFullPath(Path.Combine(GetCurrentFolder(), fileName));
}
return fileName;
}
}
}

58
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Project/Src/ResourceFile.cs

@ -1,58 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
namespace ICSharpCode.Python.Build.Tasks
{
/// <summary>
/// Stores the name and filename of a resource that will be embedded by the PythonCompiler.
/// </summary>
public class ResourceFile
{
string name;
string fileName;
bool isPublic;
public ResourceFile(string name, string fileName) : this(name, fileName, true)
{
}
public ResourceFile(string name, string fileName, bool isPublic)
{
this.name = name;
this.fileName = fileName;
this.isPublic = isPublic;
}
public string Name {
get { return name; }
set { name = value; }
}
public string FileName {
get { return fileName; }
set { fileName = value; }
}
public bool IsPublic {
get { return isPublic; }
set { isPublic = value; }
}
}
}

49
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/AssemblyInfo.cs

@ -1,49 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("Python.Build.Tasks.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Python.Build.Tasks.Tests")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("0.3")]

90
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/CompileResourcesTestFixture.cs

@ -1,90 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using IronPython.Hosting;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that resources are compiled using the PythonCompilerTask.
/// </summary>
[TestFixture]
public class CompileResourcesTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem resourceTaskItem;
ResourceFile resourceFile;
PythonCompilerTask compiler;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new PythonCompilerTask(mockCompiler);
TaskItem sourceTaskItem = new TaskItem("test.py");
compiler.Sources = new ITaskItem[] {sourceTaskItem};
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
resourceTaskItem = new TaskItem(@"C:\Projects\Test\Test.resources");
compiler.Resources = new ITaskItem[] {resourceTaskItem};
compiler.Execute();
if (mockCompiler.ResourceFiles != null && mockCompiler.ResourceFiles.Count > 0) {
resourceFile = mockCompiler.ResourceFiles[0];
}
}
[Test]
public void OneResourceFile()
{
Assert.AreEqual(1, mockCompiler.ResourceFiles.Count);
}
[Test]
public void ResourceFileName()
{
Assert.AreEqual(resourceTaskItem.ItemSpec, resourceFile.FileName);
}
/// <summary>
/// The resource name should be the same as the filename without
/// any preceding path information.
/// </summary>
[Test]
public void ResourceName()
{
Assert.AreEqual("Test.resources", resourceFile.Name);
}
[Test]
public void CompilerTaskResources()
{
ITaskItem[] resources = compiler.Resources;
Assert.AreEqual(resourceTaskItem, resources[0]);
}
}
}

120
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/CompileSingleSourceFileTestFixture.cs

@ -1,120 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that the python compiler task compiles a single source file.
/// </summary>
[TestFixture]
public class CompileSingleSourceFileTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem sourceTaskItem;
TaskItem systemXmlReferenceTaskItem;
TaskItem systemDataReferenceTaskItem;
PythonCompilerTask compiler;
bool success;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new PythonCompilerTask(mockCompiler);
sourceTaskItem = new TaskItem("test.py");
compiler.Sources = new ITaskItem[] {sourceTaskItem};
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
systemDataReferenceTaskItem = new TaskItem(@"C:\Windows\Microsoft.NET\Framework\2.0\System.Data.dll");
systemXmlReferenceTaskItem = new TaskItem(@"C:\Windows\Microsoft.NET\Framework\2.0\System.Xml.dll");
compiler.References = new ITaskItem[] {systemDataReferenceTaskItem, systemXmlReferenceTaskItem};
success = compiler.Execute();
}
[Test]
public void CompilationSucceeded()
{
Assert.IsTrue(success);
}
[Test]
public void OneSourceFile()
{
Assert.AreEqual(1, mockCompiler.SourceFiles.Count);
}
[Test]
public void SourceFileName()
{
Assert.AreEqual("test.py", mockCompiler.SourceFiles[0]);
}
[Test]
public void IsCompileCalled()
{
Assert.IsTrue(mockCompiler.CompileCalled);
}
[Test]
public void IsDisposeCalled()
{
Assert.IsTrue(mockCompiler.DisposeCalled);
}
[Test]
public void TargetKindIsExe()
{
Assert.AreEqual(PEFileKinds.ConsoleApplication, mockCompiler.TargetKind);
}
[Test]
public void OutputAssembly()
{
Assert.AreEqual("test.exe", mockCompiler.OutputAssembly);
}
[Test]
public void DebugInfo()
{
Assert.IsFalse(mockCompiler.IncludeDebugInformation);
}
[Test]
public void TwoReferences()
{
Assert.AreEqual(2, mockCompiler.ReferencedAssemblies.Count);
}
[Test]
public void PythonCompilerTaskReferences()
{
ITaskItem[] references = compiler.References;
Assert.AreEqual(systemDataReferenceTaskItem, references[0]);
Assert.AreEqual(systemXmlReferenceTaskItem, references[1]);
}
}
}

84
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/DifferentTargetTypesTestFixture.cs

@ -1,84 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that the PythonCompiler correctly compiles to a
/// windows app when the TargetType is set to WinExe".
/// </summary>
[TestFixture]
public class DifferentTargetTypesTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem sourceTaskItem;
PythonCompilerTask compilerTask;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compilerTask = new PythonCompilerTask(mockCompiler);
sourceTaskItem = new TaskItem("test.py");
compilerTask.Sources = new ITaskItem[] {sourceTaskItem};
}
[Test]
public void CompiledToWindowsApp()
{
compilerTask.TargetType = "WinExe";
compilerTask.Execute();
Assert.AreEqual(PEFileKinds.WindowApplication, mockCompiler.TargetKind);
}
[Test]
public void CompiledToWindowsAppWhenTargetTypeLowerCase()
{
compilerTask.TargetType = "winexe";
compilerTask.Execute();
Assert.AreEqual(PEFileKinds.WindowApplication, mockCompiler.TargetKind);
}
[Test]
public void CompiledToDll()
{
compilerTask.TargetType = "Library";
compilerTask.Execute();
Assert.AreEqual(PEFileKinds.Dll, mockCompiler.TargetKind);
}
[Test]
public void NullTargetTypeCompilesToConsoleApp()
{
compilerTask.TargetType = null;
compilerTask.Execute();
Assert.AreEqual(PEFileKinds.ConsoleApplication, mockCompiler.TargetKind);
}
}
}

109
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/DummyPythonCompilerTask.cs

@ -1,109 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.Python.Build.Tasks;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Overrides the GetCurrentFolder to return a predefined string.
/// </summary>
public class DummyPythonCompilerTask : PythonCompilerTask
{
string currentFolder;
string loggedErrorMessage;
string loggedErrorCode;
string loggedErrorFile;
int loggedStartColumn = -1;
int loggedStartLine = -1;
int loggedEndLine = -1;
int loggedEndColumn = -1;
public DummyPythonCompilerTask(IPythonCompiler compiler, string currentFolder)
: base(compiler)
{
this.currentFolder = currentFolder;
}
/// <summary>
/// Gets the error message passed to the LogError method.
/// </summary>
public string LoggedErrorMessage {
get { return loggedErrorMessage; }
}
/// <summary>
/// Gets the error code passed to the LogError method.
/// </summary>
public string LoggedErrorCode {
get { return loggedErrorCode; }
}
/// <summary>
/// Gets the file passed to the LogError method.
/// </summary>
public string LoggedErrorFile {
get { return loggedErrorFile; }
}
/// <summary>
/// Gets the start line passed to the LogError method.
/// </summary>
public int LoggedStartLine {
get { return loggedStartLine; }
}
/// <summary>
/// Gets the end line passed to the LogError method.
/// </summary>
public int LoggedEndLine {
get { return loggedEndLine; }
}
/// <summary>
/// Gets the start column passed to the LogError method.
/// </summary>
public int LoggedStartColumn {
get { return loggedStartColumn; }
}
/// <summary>
/// Gets the end column passed to the LogError method.
/// </summary>
public int LoggedEndColumn {
get { return loggedEndColumn; }
}
protected override string GetCurrentFolder()
{
return currentFolder;
}
protected override void LogError(string message, string errorCode, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber)
{
loggedErrorMessage = message;
loggedErrorCode = errorCode;
loggedErrorFile = file;
loggedStartColumn = columnNumber;
loggedStartLine = lineNumber;
loggedEndColumn = endColumnNumber;
loggedEndLine = endLineNumber;
}
}
}

72
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/IOErrorTestFixture.cs

@ -1,72 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection;
using System.Reflection.Emit;
using IronPython.Runtime;
using IronPython.Runtime.Operations;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Runtime;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that an IOException is caught and logged.
/// </summary>
[TestFixture]
public class IOErrorTestFixture
{
MockPythonCompiler mockCompiler;
DummyPythonCompilerTask compiler;
bool success;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
compiler.Sources = new ITaskItem[] {sourceFile};
mockCompiler.ThrowExceptionAtCompile = PythonOps.IOError("Could not find main file test.py");
success = compiler.Execute();
}
[Test]
public void ExecuteFailed()
{
Assert.IsFalse(success);
}
[Test]
public void IsExceptionMessageLogged()
{
Assert.AreEqual("Could not find main file test.py", compiler.LoggedErrorMessage);
}
}
}

77
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/IncludeDebugInfoTestFixture.cs

@ -1,77 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that the compiler includes debug info in the
/// generated assembly.
/// </summary>
[TestFixture]
public class IncludeDebugInfoTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem sourceTaskItem;
PythonCompilerTask compiler;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new PythonCompilerTask(mockCompiler);
sourceTaskItem = new TaskItem("test.py");
compiler.Sources = new ITaskItem[] {sourceTaskItem};
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
compiler.EmitDebugInformation = true;
compiler.Execute();
}
[Test]
public void DebugInfoIncluded()
{
Assert.IsTrue(mockCompiler.IncludeDebugInformation);
}
[Test]
public void PythonCompilerTaskTargetType()
{
Assert.AreEqual("Exe", compiler.TargetType);
}
[Test]
public void PythonCompilerTaskOutputAssembly()
{
Assert.AreEqual("test.exe", compiler.OutputAssembly);
}
[Test]
public void PythonCompilerTaskEmitDebugInfo()
{
Assert.AreEqual(true, compiler.EmitDebugInformation);
}
}
}

59
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/LogicalResourceNamesTests.cs

@ -1,59 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
[TestFixture]
public class LogicalResourceNamesTests
{
MockPythonCompiler mockCompiler;
PythonCompilerTask compilerTask;
void CreatePythonCompilerTask()
{
mockCompiler = new MockPythonCompiler();
compilerTask = new PythonCompilerTask(mockCompiler);
compilerTask.TargetType = "Exe";
compilerTask.OutputAssembly = "test.exe";
}
[Test]
public void Execute_ResourceHasLogicalNameSetInTaskItemMetadata_ResourceNamePassedToCompilerUsesLogicalName()
{
CreatePythonCompilerTask();
TaskItem resourceTaskItem = new TaskItem("test.xaml");
resourceTaskItem.SetMetadata("LogicalName", "MyLogicalResourceName");
compilerTask.Resources = new ITaskItem[] {resourceTaskItem};
compilerTask.Execute();
ResourceFile resourceFile = mockCompiler.ResourceFiles[0];
string resourceName = resourceFile.Name;
string expectedResourceName = "MyLogicalResourceName";
Assert.AreEqual(expectedResourceName, resourceName);
}
}
}

72
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/MainEntryPointTestFixture.cs

@ -1,72 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that the main entry point is set in the PythonCompiler
/// by the PythonCompilerTask.
/// </summary>
[TestFixture]
public class MainEntryPointTestFixture
{
MockPythonCompiler mockCompiler;
PythonCompilerTask compilerTask;
TaskItem mainTaskItem;
TaskItem classTaskItem;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compilerTask = new PythonCompilerTask(mockCompiler);
mainTaskItem = new TaskItem("main.py");
classTaskItem = new TaskItem("class1.py");
compilerTask.Sources = new ITaskItem[] {mainTaskItem, classTaskItem};
compilerTask.MainFile = "main.py";
compilerTask.Execute();
}
[Test]
public void MainFile()
{
Assert.AreEqual("main.py", mockCompiler.MainFile);
}
[Test]
public void TaskMainFile()
{
Assert.AreEqual("main.py", compilerTask.MainFile);
}
[Test]
public void TaskSources()
{
ITaskItem[] sources = compilerTask.Sources;
Assert.AreEqual(sources[0], mainTaskItem);
Assert.AreEqual(sources[1], classTaskItem);
}
}
}

67
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/MissingMainEntryPointTestFixture.cs

@ -1,67 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that an error is reported when the mainFile is missing and we are trying to compile
/// an executable.
/// </summary>
[TestFixture]
public class MissingMainEntryPointTestFixture
{
MockPythonCompiler mockCompiler;
DummyPythonCompilerTask compiler;
bool success;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
compiler.Sources = new ITaskItem[] {sourceFile};
mockCompiler.ThrowExceptionAtCompile = new PythonCompilerException("Missing main file.");
success = compiler.Execute();
}
[Test]
public void ExecuteFailed()
{
Assert.IsFalse(success);
}
[Test]
public void IsExceptionMessageLogged()
{
Assert.AreEqual("Missing main file.", compiler.LoggedErrorMessage);
}
}
}

160
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/MockPythonCompiler.cs

@ -1,160 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using IronPython.Hosting;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Implements the IPythonCompiler interface so the
/// PythonCompiler task can be tested.
/// </summary>
public class MockPythonCompiler : IPythonCompiler
{
IList<string> sourceFiles;
bool compileCalled;
bool disposeCalled;
PEFileKinds targetKind;
PortableExecutableKinds executableKind;
ImageFileMachine machine;
string mainFile;
string outputAssembly;
bool includeDebugInformation;
IList<string> referencedAssemblies;
IList<ResourceFile> resourceFiles;
Exception throwExceptionAtCompile;
public MockPythonCompiler()
{
}
/// <summary>
/// Gets or sets the source files to compiler.
/// </summary>
public IList<string> SourceFiles {
get { return sourceFiles; }
set { sourceFiles = value; }
}
/// <summary>
/// Gets or sets the filenames of the referenced assemblies.
/// </summary>
public IList<string> ReferencedAssemblies {
get { return referencedAssemblies; }
set { referencedAssemblies = value; }
}
/// <summary>
/// Gets or sets the resources to be compiled.
/// </summary>
public IList<ResourceFile> ResourceFiles {
get { return resourceFiles; }
set { resourceFiles = value; }
}
/// <summary>
/// Gets or sets the exception that will be thrown when the Compile method is called.
/// </summary>
public Exception ThrowExceptionAtCompile {
get { return throwExceptionAtCompile; }
set { throwExceptionAtCompile = value; }
}
/// <summary>
/// Compiles the source code.
/// </summary>
public void Compile()
{
compileCalled = true;
if (throwExceptionAtCompile != null) {
throw throwExceptionAtCompile;
}
}
/// <summary>
/// Disposes the compiler.
/// </summary>
public void Dispose()
{
disposeCalled = true;
}
/// <summary>
/// Gets or sets the type of the compiled assembly.
/// </summary>
public PEFileKinds TargetKind {
get { return targetKind; }
set { targetKind = value; }
}
public PortableExecutableKinds ExecutableKind {
get { return executableKind; }
set { executableKind = value; }
}
public ImageFileMachine Machine {
get { return machine; }
set { machine = value; }
}
/// <summary>
/// Gets or sets the file that contains the main entry point.
/// </summary>
public string MainFile {
get { return mainFile; }
set { mainFile = value; }
}
/// <summary>
/// Gets or sets the output assembly filename.
/// </summary>
public string OutputAssembly {
get { return outputAssembly; }
set { outputAssembly = value; }
}
/// <summary>
/// Gets or sets whether the compiler should include debug
/// information in the created assembly.
/// </summary>
public bool IncludeDebugInformation {
get { return includeDebugInformation; }
set { includeDebugInformation = value; }
}
/// <summary>
/// Gets whether the Compile method has been called.
/// </summary>
public bool CompileCalled {
get { return compileCalled; }
}
/// <summary>
/// Gets whether the Dispose method has been called.
/// </summary>
public bool DisposeCalled {
get { return disposeCalled; }
}
}
}

116
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/PlatformTestFixture.cs

@ -1,116 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests the platform information (e.g. x86) is correctly passed to the IPythonCompiler.
/// </summary>
[TestFixture]
public class PlatformTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem sourceTaskItem;
PythonCompilerTask compilerTask;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compilerTask = new PythonCompilerTask(mockCompiler);
sourceTaskItem = new TaskItem("test.py");
compilerTask.Sources = new ITaskItem[] {sourceTaskItem};
}
[Test]
public void DefaultPlatformIsILOnly()
{
compilerTask.Execute();
Assert.AreEqual(PortableExecutableKinds.ILOnly, mockCompiler.ExecutableKind);
}
[Test]
public void DefaultMachineIs386()
{
compilerTask.Execute();
Assert.AreEqual(ImageFileMachine.I386, mockCompiler.Machine);
}
[Test]
public void ExecutableIsCompiledTo32Bit()
{
compilerTask.Platform = "x86";
compilerTask.Execute();
Assert.AreEqual(PortableExecutableKinds.ILOnly | PortableExecutableKinds.Required32Bit, mockCompiler.ExecutableKind);
}
[Test]
public void MachineWhenExecutableIsCompiledTo32Bit()
{
compilerTask.Platform = "x86";
compilerTask.Execute();
Assert.AreEqual(ImageFileMachine.I386, mockCompiler.Machine);
}
[Test]
public void ExecutableIsCompiledToItanium()
{
compilerTask.Platform = "Itanium";
compilerTask.Execute();
Assert.AreEqual(PortableExecutableKinds.ILOnly | PortableExecutableKinds.PE32Plus, mockCompiler.ExecutableKind);
}
[Test]
public void MachineWhenExecutableIsCompiledToItanium()
{
compilerTask.Platform = "Itanium";
compilerTask.Execute();
Assert.AreEqual(ImageFileMachine.IA64, mockCompiler.Machine);
}
[Test]
public void ExecutableIsCompiledTo64Bit()
{
compilerTask.Platform = "x64";
compilerTask.Execute();
Assert.AreEqual(PortableExecutableKinds.ILOnly | PortableExecutableKinds.PE32Plus, mockCompiler.ExecutableKind);
}
[Test]
public void MachineWhenExecutableIsCompiledTo64Bit()
{
compilerTask.Platform = "x64";
compilerTask.Execute();
Assert.AreEqual(ImageFileMachine.AMD64, mockCompiler.Machine);
}
}
}

90
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/Python.Build.Tasks.Tests.csproj

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectGuid>{833904AB-3CD4-4071-9B48-5770E44685AA}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>Python.Build.Tasks.Tests</RootNamespace>
<AssemblyName>Python.Build.Tasks.Tests</AssemblyName>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\..\..\..\bin\UnitTests\</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\..\..\..\..\bin\UnitTests\</OutputPath>
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="IronPython">
<HintPath>..\..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Engine" />
<Reference Include="Microsoft.Build.Framework" />
<Reference Include="Microsoft.Build.Tasks" />
<Reference Include="Microsoft.Build.Utilities.v3.5">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="Microsoft.Dynamic">
<HintPath>..\..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>..\..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\..\..\..\Tools\NUnit\nunit.framework.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CompileResourcesTestFixture.cs" />
<Compile Include="DifferentTargetTypesTestFixture.cs" />
<Compile Include="DummyPythonCompilerTask.cs" />
<Compile Include="IncludeDebugInfoTestFixture.cs" />
<Compile Include="IOErrorTestFixture.cs" />
<Compile Include="LogicalResourceNamesTests.cs" />
<Compile Include="MainEntryPointTestFixture.cs" />
<Compile Include="MissingMainEntryPointTestFixture.cs" />
<Compile Include="MockPythonCompiler.cs" />
<Compile Include="CompileSingleSourceFileTestFixture.cs" />
<Compile Include="PlatformTestFixture.cs" />
<Compile Include="PythonCompilerTests.cs" />
<Compile Include="RelativeReferenceTestFixture.cs" />
<Compile Include="RelativeResourceFileTestFixture.cs" />
<Compile Include="SyntaxErrorFileNameWithDotCharTestFixture.cs" />
<Compile Include="SyntaxErrorNullFileNameTestFixture.cs" />
<Compile Include="SyntaxErrorTestFixture.cs" />
<Compile Include="SyntaxErrorUnknownFileNameTestFixture.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Project\Python.Build.Tasks.csproj">
<Project>{D332F2D1-2CF1-43B7-903C-844BD5211A7E}</Project>
<Name>Python.Build.Tasks</Name>
</ProjectReference>
</ItemGroup>
</Project>

57
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/PythonCompilerTests.cs

@ -1,57 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
[TestFixture]
public class PythonCompilerTests
{
[Test]
public void NoMainFileSpecifiedForWindowsApplication()
{
try {
PythonCompiler compiler = new PythonCompiler();
compiler.TargetKind = PEFileKinds.WindowApplication;
compiler.OutputAssembly = "test.exe";
compiler.SourceFiles = new string[0];
compiler.MainFile = null;
compiler.Compile();
Assert.Fail("Expected PythonCompilerException.");
} catch (PythonCompilerException ex) {
Assert.AreEqual(Resources.NoMainFileSpecified, ex.Message);
}
}
[Test]
public void NoMainSpecifiedForLibraryThrowsNoError()
{
PythonCompiler compiler = new PythonCompiler();
compiler.TargetKind = PEFileKinds.Dll;
compiler.OutputAssembly = "test.dll";
compiler.SourceFiles = new string[0];
compiler.MainFile = null;
compiler.VerifyParameters();
}
}
}

69
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/RelativeReferenceTestFixture.cs

@ -1,69 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that references with a relative path are converted to a full path before being
/// passed to the PythonCompiler.
/// </summary>
[TestFixture]
public class RelativeReferenceTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem referenceTaskItem;
TaskItem fullPathReferenceTaskItem;
DummyPythonCompilerTask compiler;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
referenceTaskItem = new TaskItem(@"..\RequiredLibraries\MyReference.dll");
fullPathReferenceTaskItem = new TaskItem(@"C:\Projects\Test\MyTest.dll");
compiler.References = new ITaskItem[] {referenceTaskItem, fullPathReferenceTaskItem};
compiler.Execute();
}
[Test]
public void RelativePathReferenceItemPassedToCompilerWithFullPath()
{
string fileName = mockCompiler.ReferencedAssemblies[0];
Assert.AreEqual(@"C:\Projects\RequiredLibraries\MyReference.dll", fileName);
}
[Test]
public void FullPathReferenceItemUnchangedWhenPassedToCompiler()
{
string fileName = mockCompiler.ReferencedAssemblies[1];
Assert.AreEqual(fullPathReferenceTaskItem.ItemSpec, fileName);
}
}
}

69
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/RelativeResourceFileTestFixture.cs

@ -1,69 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection.Emit;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that resoures with a relative path are converted to a full path before being
/// passed to the PythonCompiler.
/// </summary>
[TestFixture]
public class RelativeResourceFileTestFixture
{
MockPythonCompiler mockCompiler;
TaskItem resourceTaskItem;
TaskItem fullPathResourceTaskItem;
DummyPythonCompilerTask compiler;
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
resourceTaskItem = new TaskItem(@"..\RequiredLibraries\MyResource.resx");
fullPathResourceTaskItem = new TaskItem(@"C:\Projects\Test\MyTest.resx");
compiler.Resources = new ITaskItem[] {resourceTaskItem, fullPathResourceTaskItem};
compiler.Execute();
}
[Test]
public void RelativePathReferenceItemPassedToCompilerWithFullPath()
{
string fileName = mockCompiler.ResourceFiles[0].FileName;
Assert.AreEqual(@"C:\Projects\RequiredLibraries\MyResource.resx", fileName);
}
[Test]
public void FullPathReferenceItemUnchangedWhenPassedToCompiler()
{
string fileName = mockCompiler.ResourceFiles[1].FileName;
Assert.AreEqual(fullPathResourceTaskItem.ItemSpec, fileName);
}
}
}

79
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorFileNameWithDotCharTestFixture.cs

@ -1,79 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection;
using System.Reflection.Emit;
using IronPython.Runtime;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Runtime;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// If the project has a filename with a dot character in it (e.g. Resources.Designer.py) and this file
/// has a syntax error then IronPython's ClrModule.CompileModules method will throw a syntax error exception but the
/// filename will have a '\' replacing the dot character (i.e. Resources\Designer.py).
/// </summary>
[TestFixture]
public class SyntaxErrorFileNameWithDotCharTestFixture
{
MockPythonCompiler mockCompiler;
DummyPythonCompilerTask compiler;
bool success;
[TestFixtureSetUp]
public void SetUpFixture()
{
ScriptEngine engine = IronPython.Hosting.Python.CreateEngine();
}
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\PythonApp.Program.py");
compiler.Sources = new ITaskItem[] {sourceFile};
SourceUnit source = DefaultContext.DefaultPythonContext.CreateSourceUnit(NullTextContentProvider.Null, @"PythonApp\Program", SourceCodeKind.InteractiveCode);
SourceLocation start = new SourceLocation(0, 1, 1);
SourceLocation end = new SourceLocation(0, 2, 3);
SourceSpan span = new SourceSpan(start, end);
SyntaxErrorException ex = new SyntaxErrorException("Error", source, span, 1000, Severity.FatalError);
mockCompiler.ThrowExceptionAtCompile = ex;
success = compiler.Execute();
}
[Test]
public void SourceFile()
{
Assert.AreEqual(@"D:\Projects\MyProject\PythonApp.Program.py", compiler.LoggedErrorFile);
}
}
}

71
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorNullFileNameTestFixture.cs

@ -1,71 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection;
using System.Reflection.Emit;
using IronPython.Runtime;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Runtime;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
[TestFixture]
public class SyntaxErrorNullFileNameTestFixture
{
MockPythonCompiler mockCompiler;
DummyPythonCompilerTask compiler;
bool success;
[TestFixtureSetUp]
public void SetUpFixture()
{
ScriptEngine engine = IronPython.Hosting.Python.CreateEngine();
}
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
compiler.Sources = new ITaskItem[] {sourceFile};
SourceUnit source = DefaultContext.DefaultPythonContext.CreateSourceUnit(NullTextContentProvider.Null, @"test", SourceCodeKind.InteractiveCode);
SyntaxErrorException ex = new SyntaxErrorException("Error", null, SourceSpan.None, 1000, Severity.FatalError);
mockCompiler.ThrowExceptionAtCompile = ex;
success = compiler.Execute();
}
[Test]
public void IsExceptionMessageLogged()
{
Assert.AreEqual("Error", compiler.LoggedErrorMessage);
}
}
}

119
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorTestFixture.cs

@ -1,119 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection;
using System.Reflection.Emit;
using IronPython.Runtime;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Runtime;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// Tests that a syntax error exception is caught and logged.
/// </summary>
[TestFixture]
public class SyntaxErrorTestFixture
{
MockPythonCompiler mockCompiler;
DummyPythonCompilerTask compiler;
bool success;
[TestFixtureSetUp]
public void SetUpFixture()
{
ScriptEngine engine = IronPython.Hosting.Python.CreateEngine();
}
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"C:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
compiler.Sources = new ITaskItem[] {sourceFile};
SourceUnit source = DefaultContext.DefaultPythonContext.CreateSourceUnit(NullTextContentProvider.Null, @"test", SourceCodeKind.InteractiveCode);
SourceLocation start = new SourceLocation(0, 1, 1);
SourceLocation end = new SourceLocation(0, 2, 3);
SourceSpan span = new SourceSpan(start, end);
SyntaxErrorException ex = new SyntaxErrorException("Error", source, span, 1000, Severity.FatalError);
mockCompiler.ThrowExceptionAtCompile = ex;
success = compiler.Execute();
}
[Test]
public void ExecuteFailed()
{
Assert.IsFalse(success);
}
[Test]
public void IsExceptionMessageLogged()
{
Assert.AreEqual("Error", compiler.LoggedErrorMessage);
}
[Test]
public void IsErrorCodeLogged()
{
Assert.AreEqual("1000", compiler.LoggedErrorCode);
}
[Test]
public void SourceFile()
{
Assert.AreEqual(@"D:\Projects\MyProject\test.py", compiler.LoggedErrorFile);
}
[Test]
public void SourceStartLine()
{
Assert.AreEqual(1, compiler.LoggedStartLine);
}
[Test]
public void SourceStartColumn()
{
Assert.AreEqual(1, compiler.LoggedStartColumn);
}
[Test]
public void SourceEndLine()
{
Assert.AreEqual(2, compiler.LoggedEndLine);
}
[Test]
public void SourceEndColumn()
{
Assert.AreEqual(3, compiler.LoggedEndColumn);
}
}
}

78
src/AddIns/BackendBindings/Python/Python.Build.Tasks/Test/SyntaxErrorUnknownFileNameTestFixture.cs

@ -1,78 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Reflection;
using System.Reflection.Emit;
using IronPython.Runtime;
using ICSharpCode.Python.Build.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Runtime;
using NUnit.Framework;
namespace Python.Build.Tasks.Tests
{
/// <summary>
/// If the filename returned from the SyntaxErrorException cannot be found in the project then
/// just use the project's folder concatenated with the filename.
/// </summary>
[TestFixture]
public class SyntaxErrorUnknownFileNameTestFixture
{
MockPythonCompiler mockCompiler;
DummyPythonCompilerTask compiler;
bool success;
[TestFixtureSetUp]
public void SetUpFixture()
{
ScriptEngine engine = IronPython.Hosting.Python.CreateEngine();
}
[SetUp]
public void Init()
{
mockCompiler = new MockPythonCompiler();
compiler = new DummyPythonCompilerTask(mockCompiler, @"D:\Projects\MyProject");
compiler.TargetType = "Exe";
compiler.OutputAssembly = "test.exe";
TaskItem sourceFile = new TaskItem(@"D:\Projects\MyProject\test.py");
compiler.Sources = new ITaskItem[] {sourceFile};
SourceUnit source = DefaultContext.DefaultPythonContext.CreateSourceUnit(NullTextContentProvider.Null, @"test\unknown", SourceCodeKind.InteractiveCode);
SourceLocation start = new SourceLocation(0, 1, 1);
SourceLocation end = new SourceLocation(0, 2, 3);
SourceSpan span = new SourceSpan(start, end);
SyntaxErrorException ex = new SyntaxErrorException("Error", source, span, 1000, Severity.FatalError);
mockCompiler.ThrowExceptionAtCompile = ex;
success = compiler.Execute();
}
[Test]
public void SourceFile()
{
Assert.AreEqual(@"D:\Projects\MyProject\test.unknown.py", compiler.LoggedErrorFile);
}
}
}

206
src/AddIns/BackendBindings/Python/PythonBinding.sln

@ -1,206 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.3
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythonBinding", "PythonBinding\Project\PythonBinding.csproj", "{8D732610-8FC6-43BA-94C9-7126FD7FE361}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythonBinding.Tests", "PythonBinding\Test\PythonBinding.Tests.csproj", "{23B517C9-1ECC-4419-A13F-0B7136D085CB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Build.Tasks", "Python.Build.Tasks\Project\Python.Build.Tasks.csproj", "{D332F2D1-2CF1-43B7-903C-844BD5211A7E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Build.Tasks.Tests", "Python.Build.Tasks\Test\Python.Build.Tasks.Tests.csproj", "{833904AB-3CD4-4071-9B48-5770E44685AA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormsDesigner", "..\..\DisplayBindings\FormsDesigner\Project\FormsDesigner.csproj", "{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.AvalonEdit", "..\..\..\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj", "{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Presentation", "..\..\..\Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj", "{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.WinForms", "..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj", "{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Dom", "..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj", "{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Widgets", "..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj", "{8035765F-D51F-4A0C-A746-2FD100E19419}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvalonEdit.AddIn", "..\..\DisplayBindings\AvalonEdit.AddIn\AvalonEdit.AddIn.csproj", "{0162E499-42D0-409B-AA25-EED21F75336B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTesting", "..\..\Analysis\UnitTesting\UnitTesting.csproj", "{1F261725-6318-4434-A1B1-6C70CE4CD324}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTesting.Tests", "..\..\Analysis\UnitTesting\Test\UnitTesting.Tests.csproj", "{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Scripting", "..\Scripting\Project\ICSharpCode.Scripting.csproj", "{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Scripting.Tests", "..\Scripting\Test\ICSharpCode.Scripting.Tests.csproj", "{85C09AD8-183B-403A-869A-7226646218A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PyWalker", "PyWalker\PyWalker.csproj", "{55329704-6046-48EC-8A20-5C80B3092A63}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|Any CPU.Build.0 = Release|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Release|Any CPU.Build.0 = Release|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Release|Any CPU.Build.0 = Release|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Release|Any CPU.Build.0 = Release|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Release|Any CPU.Build.0 = Release|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.Build.0 = Release|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Release|Any CPU.Build.0 = Release|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|Any CPU.Build.0 = Debug|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.Build.0 = Release|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.ActiveCfg = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|Any CPU.Build.0 = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|Any CPU.Build.0 = Release|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.Build.0 = Release|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Release|Any CPU.Build.0 = Release|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Release|Any CPU.Build.0 = Release|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Debug|Any CPU.Build.0 = Debug|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Debug|Any CPU.ActiveCfg = Debug|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Release|Any CPU.Build.0 = Release|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Release|Any CPU.ActiveCfg = Release|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Debug|x86.Build.0 = Debug|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Debug|x86.ActiveCfg = Debug|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Release|x86.Build.0 = Release|x86
{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}.Release|x86.ActiveCfg = Release|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Debug|Any CPU.Build.0 = Debug|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Debug|Any CPU.ActiveCfg = Debug|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Debug|x86.Build.0 = Debug|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Debug|x86.ActiveCfg = Debug|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Release|Any CPU.Build.0 = Release|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Release|Any CPU.ActiveCfg = Release|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Release|x86.Build.0 = Release|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Release|x86.ActiveCfg = Release|x86
{55329704-6046-48EC-8A20-5C80B3092A63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Debug|x86.Build.0 = Debug|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Debug|x86.ActiveCfg = Debug|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Release|Any CPU.Build.0 = Release|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Release|x86.Build.0 = Release|Any CPU
{55329704-6046-48EC-8A20-5C80B3092A63}.Release|x86.ActiveCfg = Release|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Debug|x86.Build.0 = Debug|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Debug|x86.ActiveCfg = Debug|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Release|x86.Build.0 = Release|Any CPU
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}.Release|x86.ActiveCfg = Release|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Debug|x86.Build.0 = Debug|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Debug|x86.ActiveCfg = Debug|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Release|x86.Build.0 = Release|Any CPU
{1F261725-6318-4434-A1B1-6C70CE4CD324}.Release|x86.ActiveCfg = Release|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|x86.Build.0 = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|x86.ActiveCfg = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|x86.Build.0 = Release|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|x86.ActiveCfg = Release|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|x86.Build.0 = Debug|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|x86.ActiveCfg = Debug|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|x86.Build.0 = Release|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|x86.ActiveCfg = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|x86.Build.0 = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|x86.ActiveCfg = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|x86.Build.0 = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|x86.ActiveCfg = Release|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|x86.Build.0 = Debug|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|x86.ActiveCfg = Debug|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|x86.Build.0 = Release|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|x86.ActiveCfg = Release|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Debug|x86.Build.0 = Debug|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Debug|x86.ActiveCfg = Debug|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Release|x86.Build.0 = Release|Any CPU
{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Release|x86.ActiveCfg = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|x86.Build.0 = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|x86.ActiveCfg = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|x86.Build.0 = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|x86.ActiveCfg = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|x86.Build.0 = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|x86.ActiveCfg = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|x86.Build.0 = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|x86.ActiveCfg = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|x86.Build.0 = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|x86.ActiveCfg = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|x86.Build.0 = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|x86.ActiveCfg = Release|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|x86.Build.0 = Debug|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|x86.ActiveCfg = Debug|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|x86.Build.0 = Release|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|x86.ActiveCfg = Release|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Debug|x86.Build.0 = Debug|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Release|x86.Build.0 = Release|Any CPU
{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}.Release|x86.ActiveCfg = Release|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Debug|x86.Build.0 = Debug|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Debug|x86.ActiveCfg = Debug|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Release|x86.Build.0 = Release|Any CPU
{833904AB-3CD4-4071-9B48-5770E44685AA}.Release|x86.ActiveCfg = Release|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Debug|x86.Build.0 = Debug|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Debug|x86.ActiveCfg = Debug|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Release|x86.Build.0 = Release|Any CPU
{D332F2D1-2CF1-43B7-903C-844BD5211A7E}.Release|x86.ActiveCfg = Release|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Debug|x86.Build.0 = Debug|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Debug|x86.ActiveCfg = Debug|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Release|x86.Build.0 = Release|Any CPU
{23B517C9-1ECC-4419-A13F-0B7136D085CB}.Release|x86.ActiveCfg = Release|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Debug|x86.Build.0 = Debug|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Debug|x86.ActiveCfg = Debug|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|x86.Build.0 = Release|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal

31
src/AddIns/BackendBindings/Python/PythonBinding/Project/Configuration/AssemblyInfo.cs

@ -1,31 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Reflection;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("PythonBinding")]
[assembly: AssemblyDescription("IronPython addin for SharpDevelop.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

25
src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/__future__.py

@ -1,25 +0,0 @@
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Microsoft Public License. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you cannot locate the Microsoft Public License, please send an email to
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Microsoft Public License.
#
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################
all_feature_names = ['nested_scopes', 'generators', 'division',
'absolute_import', 'with_statement', 'print_function',
'unicode_literals']
division=1
with_statement=1
generators=1
absolute_import=1
print_function=1
unicode_literals=1

31
src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/runpy.py

@ -1,31 +0,0 @@
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Microsoft Public License. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you cannot locate the Microsoft Public License, please send an email to
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Microsoft Public License.
#
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################
"""
Fake runpy.py which emulates what CPython does to properly support the '-m' flag.
If you have access to the CPython standard library, you most likely do not need this.
"""
import sys, nt
def run_module(modToRun, init_globals=None, run_name = '__main__', alter_sys = True):
if alter_sys:
for o in sys.path:
libpath = o + '\\' + modToRun + '.py'
if nt.access(libpath, nt.F_OK):
sys.argv[0] = libpath
break
__import__(modToRun)

14
src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/site.py

@ -1,14 +0,0 @@
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Microsoft Public License. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you cannot locate the Microsoft Public License, please send an email to
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Microsoft Public License.
#
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################

227
src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.addin

@ -1,227 +0,0 @@
<AddIn name="Python Binding"
author="Matt Ward"
copyright="prj:///doc/copyright.txt"
description="Backend binding for IronPython"
addInManagerHidden="preinstalled">
<Manifest>
<Identity name="ICSharpCode.PythonBinding"/>
<Dependency addin="ICSharpCode.FormsDesigner"/>
</Manifest>
<Runtime>
<Import assembly=":ICSharpCode.SharpDevelop"/>
<Import assembly="$ICSharpCode.FormsDesigner/FormsDesigner.dll"/>
<Import assembly="$ICSharpCode.UnitTesting/UnitTesting.dll"/>
<Import assembly="IronPython.Modules.dll"/>
<Import assembly="PythonBinding.dll"/>
</Runtime>
<Path name="/SharpDevelop/ViewContent/AvalonEdit/SyntaxModes">
<SyntaxMode id="Python.SyntaxMode"
extensions=".py"
name="Python"
resource="ICSharpCode.PythonBinding.Resources.Python.xshd"/>
</Path>
<Path name="/SharpDevelop/Workbench/LanguageBindings">
<LanguageBinding id="Python"
class="ICSharpCode.PythonBinding.PythonLanguageBinding"
extensions=".py" />
</Path>
<!-- Add the "Python" entry to the Open File Dialog -->
<Path name="/SharpDevelop/Workbench/FileFilter">
<FileFilter id="Python"
insertbefore="Resources"
insertafter="Icons"
name="${res:ICSharpCode.PythonBinding.PythonFiles} (*.py)"
extensions="*.py"
mimeType = "text/plain"/>
</Path>
<!-- Add the "Python" entry to the Open Project Dialog -->
<Path name="/SharpDevelop/Workbench/Combine/FileFilter">
<FileFilter id="PythonProject"
insertbefore="AllFiles"
name="${res:ICSharpCode.PythonBinding.PythonProjectFiles} (*.pyproj)"
class="ICSharpCode.SharpDevelop.Project.LoadProject"
extensions="*.pyproj"/>
</Path>
<!-- File templates -->
<Path name="/SharpDevelop/BackendBindings/Templates">
<Directory id="Python" path="./Templates" />
</Path>
<!-- Python menu -->
<Path name="/SharpDevelop/Workbench/MainMenu">
<Condition name="ActiveContentExtension" activeextension=".py">
<MenuItem id="Python"
insertafter="Search"
insertbefore="Tools"
label="&amp;Python"
type="Menu">
<Condition name="IsProcessRunning" isprocessrunning="False" isdebugging="False" action="Disable">
<MenuItem id="Run"
icon="Icons.16x16.RunProgramIcon"
class="ICSharpCode.PythonBinding.RunDebugPythonCommand"
label="${res:XML.MainMenu.RunMenu.Run}"
shortcut="Control|Shift|R"/>
<MenuItem id="RunWithoutDebugger"
icon="Icons.16x16.Debug.StartWithoutDebugging"
class="ICSharpCode.PythonBinding.RunPythonCommand"
label="${res:XML.MainMenu.DebugMenu.RunWithoutDebug}"
shortcut="Control|Shift|W"/>
</Condition>
<Condition name="IsProcessRunning" isdebugging="True" action="Disable">
<MenuItem id="Stop"
icon="Icons.16x16.StopProcess"
class="ICSharpCode.SharpDevelop.Project.Commands.StopDebuggingCommand"
label="${res:XML.MainMenu.DebugMenu.Stop}"/>
</Condition>
<MenuItem id="SendToPythonConsoleSeparator" type="Separator"/>
<MenuItem id="SendLineToPythonConsole"
class="ICSharpCode.PythonBinding.SendLineToPythonConsoleCommand"
label="${res:ICSharpCode.PythonBinding.SendLineToPythonConsole}"/>
<Condition name="IsTextSelected" action="Disable">
<MenuItem id="SendSelectedTextToPythonConsole"
class="ICSharpCode.PythonBinding.SendSelectedTextToPythonConsoleCommand"
label="${res:ICSharpCode.PythonBinding.SendSelectedTextToPythonConsole}"/>
</Condition>
</MenuItem>
</Condition>
</Path>
<!-- Python parser -->
<Path name="/SharpDevelop/Parser">
<Parser id="Python"
supportedextensions=".py"
projectfileextension=".pyproj"
class="ICSharpCode.PythonBinding.PythonParser"/>
</Path>
<!-- Register Python MSBuild project (.pyproj) -->
<Path name="/SharpDevelop/Workbench/ProjectBindings">
<ProjectBinding id="Python"
guid="{FD48973F-F585-4F70-812B-4D0503B36CE9}"
supportedextensions=".py"
projectfileextension=".pyproj"
class="ICSharpCode.PythonBinding.PythonProjectBinding" />
</Path>
<!-- The Python code completion binding -->
<Path name="/SharpDevelop/ViewContent/TextEditor/CodeCompletion">
<CodeCompletionBinding id="Python"
extensions=".py"
class="ICSharpCode.PythonBinding.PythonCodeCompletionBinding"/>
</Path>
<!--
Register path to SharpDevelop.Build.Python.targets for the MSBuild engine.
SharpDevelop.Build.Python.targets is in the PythonBinding AddIn directory
-->
<Path name="/SharpDevelop/MSBuildEngine/AdditionalProperties">
<String id="PythonBinPath" text="${AddInPath:ICSharpCode.PythonBinding}"/>
</Path>
<!-- Options panel -->
<Path name="/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<OptionPanel id="PythonOptionsPanel"
label="Python"
class="ICSharpCode.PythonBinding.PythonOptionsPanel"/>
</Path>
<!-- Project options panels -->
<Path path="/SharpDevelop/BackendBindings/ProjectOptions/Python">
<OptionPanel id="Application"
label="${res:Dialog.ProjectOptions.ApplicationSettings}"
class="ICSharpCode.PythonBinding.ApplicationSettingsPanel"/>
<OptionPanel id="BuildEvents"
label="${res:Dialog.ProjectOptions.BuildEvents}"
class="ICSharpCode.SharpDevelop.Gui.OptionPanels.BuildEvents"/>
<OptionPanel id="CompilingOptions"
label="${res:Dialog.ProjectOptions.BuildOptions}"
class="ICSharpCode.PythonBinding.CompilingOptionsPanel"/>
<OptionPanel id="DebugOptions"
label="${res:Dialog.ProjectOptions.DebugOptions}"
class="ICSharpCode.SharpDevelop.Gui.OptionPanels.DebugOptions"/>
</Path>
<!-- Python display binding -->
<Path name="/SharpDevelop/Workbench/DisplayBindings">
<DisplayBinding id="PythonDisplayBinding"
type="Secondary"
fileNamePattern="\.py$"
languagePattern="^Python$"
class="ICSharpCode.PythonBinding.PythonFormsDesignerDisplayBinding" />
</Path>
<Path name="/SharpDevelop/Workbench/MainMenu/Tools/ConvertCode">
<ComplexCondition action="Disable">
<Or>
<Condition name="ActiveContentExtension" activeextension=".cs"/>
<Condition name="ActiveContentExtension" activeextension=".vb"/>
</Or>
<MenuItem id="ConvertToPython"
insertafter="CSharp"
insertbefore="VBNet"
label="Python"
class="ICSharpCode.PythonBinding.ConvertToPythonMenuCommand"/>
</ComplexCondition>
</Path>
<Path name="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectActions/Convert">
<Condition name="ProjectActive" activeproject="C#">
<MenuItem id="CSharpProjectToPythonProjectConverter"
label="${res:ICSharpCode.PythonBinding.ConvertCSharpProjectToPythonProject}"
class="ICSharpCode.PythonBinding.ConvertProjectToPythonProjectCommand"/>
</Condition>
<Condition name="ProjectActive" activeproject="VBNet">
<MenuItem id="VBNetProjectToPythonProjectConverter"
label="${res:ICSharpCode.PythonBinding.ConvertVBNetProjectToPythonProject}"
class="ICSharpCode.PythonBinding.ConvertProjectToPythonProjectCommand"/>
</Condition>
</Path>
<Path name="/SharpDevelop/Workbench/Pads">
<Pad id="PythonConsole"
category="Tools"
title="${res:ICSharpCode.PythonBinding.PythonConsole}"
insertbefore="DefinitionView"
icon="PadIcons.Output"
defaultPosition="Bottom, Hidden"
class="ICSharpCode.PythonBinding.PythonConsolePad"/>
</Path>
<Path name="/Workspace/Icons">
<Icon id="PythonFileIcon"
extensions=".py"
resource="Python.ProjectBrowser.File"/>
<Icon id="PythonProjectIcon"
language="Python"
resource="Python.ProjectBrowser.Project"/>
</Path>
<Path name="/SharpDevelop/UnitTesting/TestFrameworks">
<TestFramework id="pyunit"
class="ICSharpCode.PythonBinding.PythonTestFramework"
supportedProjects=".pyproj"/>
</Path>
<Path name="/SharpDevelop/ViewContent/TextEditor/ContextMenu">
<Condition name="ActiveContentExtension" activeextension=".py">
<MenuItem id="SendToPythonConsoleSeparator"
insertafter="Indent"
type="Separator"/>
<MenuItem id="SendLineToPythonConsole"
class="ICSharpCode.PythonBinding.SendLineToPythonConsoleCommand"
label="${res:ICSharpCode.PythonBinding.SendLineToPythonConsole}"/>
<Condition name="IsTextSelected" action="Disable">
<MenuItem id="SendSelectedTextToPythonConsole"
class="ICSharpCode.PythonBinding.SendSelectedTextToPythonConsoleCommand"
label="${res:ICSharpCode.PythonBinding.SendSelectedTextToPythonConsole}"/>
</Condition>
</Condition>
</Path>
</AddIn>

319
src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj

@ -1,319 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectGuid>{8D732610-8FC6-43BA-94C9-7126FD7FE361}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>ICSharpCode.PythonBinding</RootNamespace>
<AssemblyName>PythonBinding</AssemblyName>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\..\..\..\AddIns\BackendBindings\PythonBinding\</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\..\..\..\..\AddIns\BackendBindings\PythonBinding\</OutputPath>
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="Chiron">
<HintPath>..\..\RequiredLibraries\Chiron.exe</HintPath>
</Reference>
<Reference Include="ipy">
<HintPath>..\..\RequiredLibraries\ipy.exe</HintPath>
</Reference>
<Reference Include="IronPython">
<HintPath>..\..\RequiredLibraries\IronPython.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="IronPython.Modules">
<HintPath>..\..\RequiredLibraries\IronPython.Modules.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Dynamic">
<HintPath>..\..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>..\..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Scripting.Metadata">
<HintPath>..\..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Src\ConstructorInfo.cs" />
<Compile Include="Src\ConvertProjectToPythonProjectCommand.cs" />
<Compile Include="Src\ConvertToPythonMenuCommand.cs" />
<Compile Include="Src\ApplicationSettingsPanel.cs" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\AddInOptions.cs" />
<Compile Include="Src\CompilingOptionsPanel.cs" />
<Compile Include="Src\IPythonResolver.cs" />
<Compile Include="Src\MemberName.cs" />
<Compile Include="Src\PythonBuiltInModuleMemberName.cs" />
<Compile Include="Src\PythonClass.cs" />
<Compile Include="Src\PythonClassFields.cs" />
<Compile Include="Src\PythonClassMembers.cs" />
<Compile Include="Src\PythonClassResolver.cs" />
<Compile Include="Src\PythonCodeCompletionItemProvider.cs" />
<Compile Include="Src\PythonCompilationUnit.cs" />
<Compile Include="Src\PythonCompletionItemList.cs" />
<Compile Include="Src\PythonConsoleApplication.cs" />
<Compile Include="Src\PythonConstructor.cs" />
<Compile Include="Src\PythonFromImport.cs" />
<Compile Include="Src\PythonImport.cs" />
<Compile Include="Src\PythonInsightWindowHandler.cs" />
<Compile Include="Src\PythonLanguageBinding.cs" />
<Compile Include="Src\PythonLineIndenter.cs" />
<Compile Include="Src\PythonLocalVariableAssignment.cs" />
<Compile Include="Src\PythonLocalVariableResolver.cs" />
<Compile Include="Src\PythonMemberResolver.cs" />
<Compile Include="Src\PythonMethod.cs" />
<Compile Include="Src\PythonMethodDefinition.cs" />
<Compile Include="Src\PythonMethodGroupResolveResult.cs" />
<Compile Include="Src\PythonMethodOrClassBodyRegion.cs" />
<Compile Include="Src\PythonMethodReturnValueResolver.cs" />
<Compile Include="Src\PythonModule.cs" />
<Compile Include="Src\PythonModuleCompletionItems.cs" />
<Compile Include="Src\PythonModuleCompletionItemsFactory.cs" />
<Compile Include="Src\PythonImportResolver.cs" />
<Compile Include="Src\PythonNamespaceResolver.cs" />
<Compile Include="Src\PythonOptionsPanel.xaml.cs">
<DependentUpon>PythonOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\PythonProperty.cs" />
<Compile Include="Src\PythonPropertyAssignment.cs" />
<Compile Include="Src\PythonResolverContext.cs" />
<Compile Include="Src\PythonSelfResolver.cs" />
<Compile Include="Src\PythonStandardLibraryPath.cs" />
<Compile Include="Src\PythonStandardModuleMethodResolver.cs" />
<Compile Include="Src\PythonStandardModuleMethodResolveResult.cs" />
<Compile Include="Src\PythonStandardModuleResolver.cs" />
<Compile Include="Src\PythonStandardModuleResolveResult.cs" />
<Compile Include="Src\PythonStandardModuleType.cs" />
<Compile Include="Src\PythonTestDebugger.cs" />
<Compile Include="Src\PythonTestFramework.cs" />
<Compile Include="Src\PythonTestResult.cs" />
<Compile Include="Src\PythonTestRunner.cs" />
<Compile Include="Src\PythonTestRunnerApplication.cs" />
<Compile Include="Src\PythonTestRunnerContext.cs" />
<Compile Include="Src\PythonTestRunnerResponseFile.cs" />
<Compile Include="Src\PythonUsingScope.cs" />
<Compile Include="Src\PythonWorkbench.cs" />
<Compile Include="Src\SendLineToPythonConsoleCommand.cs" />
<Compile Include="Src\SendSelectedTextToPythonConsoleCommand.cs" />
<Compile Include="Src\SysModuleCompletionItems.cs" />
<Compile Include="Src\NRefactoryToPythonConverter.cs" />
<Compile Include="Src\PythonAstWalker.cs" />
<Compile Include="Src\PythonCodeCompletionBinding.cs" />
<Compile Include="Src\PythonCodeDeserializer.cs" />
<Compile Include="Src\PythonCodeBuilder.cs" />
<Compile Include="Src\PythonCodeDomSerializer.cs" />
<Compile Include="Src\PythonCompilerError.cs" />
<Compile Include="Src\PythonCompilerSink.cs" />
<Compile Include="Src\PythonConsole.cs" />
<Compile Include="Src\PythonConsoleHost.cs" />
<Compile Include="Src\PythonConsolePad.cs" />
<Compile Include="Src\PythonControlFieldExpression.cs">
</Compile>
<Compile Include="Src\PythonDesignerGenerator.cs" />
<Compile Include="Src\PythonDesignerLoader.cs" />
<Compile Include="Src\PythonDesignerLoaderProvider.cs" />
<Compile Include="Src\PythonExpression.cs" />
<Compile Include="Src\PythonExpressionFinder.cs" />
<Compile Include="Src\PythonFormattingStrategy.cs" />
<Compile Include="Src\PythonFormsDesignerDisplayBinding.cs" />
<Compile Include="Src\PythonProjectBinding.cs" />
<Compile Include="Src\PythonComponentWalker.cs" />
<Compile Include="Src\PythonComponentWalkerException.cs" />
<Compile Include="Src\PythonImportCompletion.cs" />
<Compile Include="Src\PythonImportExpression.cs" />
<Compile Include="Src\PythonImportExpressionContext.cs" />
<Compile Include="Src\PythonLanguageProperties.cs" />
<Compile Include="Src\PythonImportModuleResolveResult.cs" />
<Compile Include="Src\PythonParser.cs" />
<Compile Include="Src\PythonProject.cs" />
<Compile Include="Src\PythonPropertyValueAssignment.cs" />
<Compile Include="Src\PythonResolver.cs" />
<Compile Include="Src\RunDebugPythonCommand.cs" />
<Compile Include="Src\RunPythonCommand.cs" />
<Compile Include="Src\PythonStandardModules.cs" />
<Compile Include="Src\StringTextContentProvider.cs" />
<None Include="..\..\RequiredLibraries\Chiron.exe.Config">
<Link>Chiron.exe.Config</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\RequiredLibraries\DLLs\IronPython.Wpf.dll">
<Link>DLLs\IronPython.Wpf.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\RequiredLibraries\License.Rtf">
<Link>License.Rtf</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Lib\runpy.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Lib\site.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Lib\__future__.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="PythonBinding.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="Resources\ApplicationSettingsPanel.xfrm" />
<EmbeddedResource Include="Resources\CompilingOptionsPanel.xfrm" />
<None Include="Templates\ConsoleProject.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\Empty.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\EmptyClass.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\EmptyForm.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\EmptyUserControl.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\FormsProject.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\LibraryProject.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="Resources\Python.xshd" />
<None Include="Templates\SilverlightApplication.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\WPFApplication.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\WPFWindow.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="TestRunner\sdtest.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="TestRunner\sdtestrunner.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Lib" />
<Folder Include="DLLs" />
<Folder Include="TestRunner" />
<Folder Include="Templates" />
<Folder Include="Resources" />
<ProjectReference Include="..\..\..\..\..\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj">
<Project>{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}</Project>
<Name>ICSharpCode.AvalonEdit</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj">
<Project>{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}</Project>
<Name>ICSharpCode.Core.Presentation</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj">
<Project>{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}</Project>
<Name>ICSharpCode.SharpDevelop.Dom</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj">
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project>
<Name>ICSharpCode.SharpDevelop.Widgets</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Analysis\UnitTesting\UnitTesting.csproj">
<Project>{1F261725-6318-4434-A1B1-6C70CE4CD324}</Project>
<Name>UnitTesting</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\DisplayBindings\FormsDesigner\Project\FormsDesigner.csproj">
<Project>{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}</Project>
<Name>FormsDesigner</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Scripting\Project\ICSharpCode.Scripting.csproj">
<Project>{7048AE18-EB93-4A84-82D0-DD60EB58ADBD}</Project>
<Name>ICSharpCode.Scripting</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Src\PythonOptionsPanel.xaml" />
</ItemGroup>
</Project>

138
src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/ApplicationSettingsPanel.xfrm

@ -1,138 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="applicationSettingsPanel" />
<ClientSize value="{Width=456, Height=308}" />
<Controls>
<System.Windows.Forms.Button>
<Name value="mainFileBrowseButton" />
<Location value="403, 165" />
<Text value="..." />
<Anchor value="Top, Right" />
<Size value="40, 21" />
<TabIndex value="25" />
</System.Windows.Forms.Button>
<System.Windows.Forms.ComboBox>
<Name value="mainFileComboBox" />
<Size value="392, 21" />
<TabIndex value="24" />
<FormattingEnabled value="True" />
<Location value="3, 165" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="mainFileLabel" />
<Location value="3, 149" />
<Text value="Main file:" />
<Anchor value="Top, Left, Right" />
<TextAlign value="BottomLeft" />
<Size value="436, 16" />
<TabIndex value="23" />
</System.Windows.Forms.Label>
<System.Windows.Forms.ComboBox>
<Name value="outputTypeComboBox" />
<Size value="159, 21" />
<TabIndex value="22" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
<Location value="3, 116" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="outputTypeLabel" />
<Location value="3, 100" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.OutputType}" />
<TextAlign value="BottomLeft" />
<Size value="159, 16" />
<TabIndex value="21" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="rootNamespaceTextBox" />
<TabIndex value="20" />
<Size value="440, 20" />
<Location value="3, 68" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="rootNamespaceLabel" />
<Location value="3, 52" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.RootNamespace}" />
<Anchor value="Top, Left, Right" />
<TextAlign value="BottomLeft" />
<Size value="440, 16" />
<TabIndex value="19" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="assemblyNameTextBox" />
<TabIndex value="18" />
<Size value="440, 20" />
<Location value="3, 24" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="assemblyNameLabel" />
<Location value="3, 8" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.AssemblyName}" />
<Anchor value="Top, Left, Right" />
<TextAlign value="BottomLeft" />
<Size value="440, 16" />
<TabIndex value="17" />
</System.Windows.Forms.Label>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="3, 193" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ProjectInformation}" />
<Anchor value="Top, Left, Right" />
<Size value="450, 112" />
<TabIndex value="16" />
<Controls>
<System.Windows.Forms.TextBox>
<Name value="outputNameTextBox" />
<TabIndex value="5" />
<ReadOnly value="True" />
<Size value="318, 20" />
<Location value="112, 80" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="outputNameLabel" />
<Location value="8, 80" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.OutputName}" />
<TextAlign value="MiddleRight" />
<Size value="100, 23" />
<TabIndex value="4" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="projectFileTextBox" />
<TabIndex value="3" />
<Size value="318, 20" />
<Location value="112, 56" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="projectFileLabel" />
<Location value="8, 52" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ProjectFile}" />
<TextAlign value="MiddleRight" />
<Size value="100, 23" />
<TabIndex value="2" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="projectFolderTextBox" />
<TabIndex value="1" />
<ReadOnly value="True" />
<Size value="318, 20" />
<Location value="112, 28" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="projectFolderLabel" />
<Location value="8, 24" />
<Text value="${res:Dialog.ProjectOptions.ApplicationSettings.ProjectFolder}" />
<TextAlign value="MiddleRight" />
<Size value="100, 23" />
<TabIndex value="0" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

71
src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm

@ -1,71 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="compilingOptionsPanel" />
<ClientSize value="{Width=510, Height=358}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="outputGroupBox" />
<Location value="3, -2" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.Output}" />
<Size value="504, 362" />
<Anchor value="Top, Left, Right" />
<TabIndex value="2" />
<Controls>
<System.Windows.Forms.ComboBox>
<Name value="targetCpuComboBox" />
<TabIndex value="14" />
<Location value="12, 106" />
<Size value="180, 21" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="targetCpuLabel" />
<Location value="12, 87" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.TargetCPU}" />
<Size value="180, 16" />
<TextAlign value="MiddleLeft" />
<TabIndex value="13" />
</System.Windows.Forms.Label>
<System.Windows.Forms.CheckBox>
<Name value="debugInfoCheckBox" />
<CheckAlign value="MiddleRight" />
<Location value="12, 63" />
<Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" />
<TabIndex value="12" />
<Size value="180, 21" />
<UseCompatibleTextRendering value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label>
<Name value="outputPathLabel" />
<Location value="12, 17" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" />
<Size value="492, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="3" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="outputPathTextBox" />
<TabIndex value="4" />
<Location value="12, 37" />
<Anchor value="Top, Left, Right" />
<Size value="448, 20" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Button>
<Name value="outputPathBrowseButton" />
<Location value="464, 37" />
<UseCompatibleTextRendering value="True" />
<Text value="..." />
<Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="5" />
</System.Windows.Forms.Button>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

135
src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/Python.xshd

@ -1,135 +0,0 @@
<SyntaxDefinition name="Python" extensions=".py" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Digits" foreground="DarkBlue" exampleText="0123456789" />
<Color name="DocComment" foreground="Green" exampleText='""" comment' />
<Color name="SingleQuoteDocComment" foreground="Green" exampleText="''' comment" />
<Color name="LineComment" foreground="Green" exampleText="# comment" />
<Color name="String" foreground="Blue" exampleText='name = "Joe"' />
<Color name="Char" foreground="Magenta" exampleText="char linefeed = '\n'" />
<Color name="Punctuation" exampleText="a(b.c);" />
<Color name="MethodCall" fontWeight="bold" foreground="MidnightBlue" exampleText="method(" />
<Color name="BuiltInStatements" fontWeight="bold" foreground="MidnightBlue" exampleText="print 'hello'" />
<Color name="ClassStatement" foreground="Blue" fontWeight="bold" exampleText="class Foo: pass" />
<Color name="ExceptionHandlingStatements" fontWeight="bold" foreground="Teal" exampleText="raise 'error'" />
<Color name="FunctionDefinition" fontWeight="bold" foreground="Blue" exampleText="def MyFunction" />
<Color name="Imports" fontWeight="bold" foreground="Green" exampleText="import System.Xml" />
<Color name="IterationStatements" fontWeight="bold" foreground="Blue" exampleText="for num in range(10,20):" />
<Color name="JumpStatements" foreground="Navy" exampleText="return val" />
<Color name="OperatorStatements" fontWeight="bold" foreground="DarkCyan" exampleText="not(a &amp;&amp; b)" />
<Color name="PassStatement" foreground="Gray" exampleText="pass" />
<Color name="NullStatement" foreground="Gray" exampleText="return None" />
<Color name="SelectionStatements" fontWeight="bold" foreground="Blue" exampleText="if (a):" />
<Color name="WithStatement" foreground="DarkViolet" exampleText='with open("a.txt") as file:' />
<Property name="LineComment" value="#"/>
<RuleSet ignoreCase="false">
<Span color="DocComment" multiline="true">
<Begin>"""</Begin>
<End>"""</End>
</Span>
<Span color="SingleQuoteDocComment" multiline="true">
<Begin>'''</Begin>
<End>'''</End>
</Span>
<Span color="LineComment">
<Begin>\#</Begin>
</Span>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<Span color="Char">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<Keywords color="BuiltInStatements">
<Word>assert</Word>
<Word>del</Word>
<Word>exec</Word>
<Word>global</Word>
<Word>lambda</Word>
<Word>print</Word>
</Keywords>
<Keywords color="ClassStatement">
<Word>class</Word>
</Keywords>
<Keywords color="ExceptionHandlingStatements">
<Word>except</Word>
<Word>finally</Word>
<Word>raise</Word>
<Word>try</Word>
</Keywords>
<Keywords color="FunctionDefinition">
<Word>def</Word>
</Keywords>
<Keywords color="Imports">
<Word>import</Word>
<Word>from</Word>
</Keywords>
<Keywords color="IterationStatements">
<Word>for</Word>
<Word>in</Word>
<Word>while</Word>
</Keywords>
<Keywords color="JumpStatements">
<Word>break</Word>
<Word>continue</Word>
<Word>yield</Word>
<Word>return</Word>
</Keywords>
<Keywords color="OperatorStatements">
<Word>and</Word>
<Word>as</Word>
<Word>is</Word>
<Word>not</Word>
<Word>or</Word>
</Keywords>
<Keywords color="PassStatement">
<Word>pass</Word>
</Keywords>
<Keywords color="SelectionStatements">
<Word>elif</Word>
<Word>else</Word>
<Word>if</Word>
</Keywords>
<Keywords color="WithStatement">
<Word>with</Word>
</Keywords>
<Keywords color="NullStatement">
<Word>None</Word>
</Keywords>
<Rule color="MethodCall">\b[\d\w_]+(?=(\s*\())</Rule>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
<Rule color="Punctuation">
[?,.;()\[\]{}+\-/%*&lt;&gt;^+~!|&amp;]+
</Rule>
</RuleSet>
</SyntaxDefinition>

100
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/AddInOptions.cs

@ -1,100 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.IO;
using ICSharpCode.Core;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Holds the options for the PythonBinding AddIn
/// </summary>
public class PythonAddInOptions
{
/// <summary>
/// The name of the options as read from the PropertyService.
/// </summary>
public static readonly string AddInOptionsName = "PythonBinding.Options";
/// <summary>
/// The default python console filename.
/// </summary>
public static readonly string DefaultPythonFileName = "ipy.exe";
#region Property names
public static readonly string PythonFileNameProperty = "PythonFileName";
public static readonly string PythonLibraryPathProperty = "PythonLibraryPath";
#endregion
Properties properties;
public PythonAddInOptions()
: this(PropertyService.Get(AddInOptionsName, new Properties()))
{
}
/// <summary>
/// Creates the addin options class which will use
/// the options from the properties class specified.
/// </summary>
public PythonAddInOptions(Properties properties)
{
this.properties = properties;
}
public string PythonLibraryPath {
get { return properties.Get<string>(PythonLibraryPathProperty, String.Empty); }
set { properties.Set(PythonLibraryPathProperty, value); }
}
public bool HasPythonLibraryPath {
get { return !String.IsNullOrEmpty(PythonLibraryPath); }
}
/// <summary>
/// Gets or sets the python console filename.
/// </summary>
public string PythonFileName {
get { return properties.Get<string>(PythonFileNameProperty, GetDefaultPythonFileName()); }
set {
if (String.IsNullOrEmpty(value)) {
properties.Set(PythonFileNameProperty, GetDefaultPythonFileName());
} else {
properties.Set(PythonFileNameProperty, value);
}
}
}
/// <summary>
/// Returns the full path to ipyw.exe which is installed in the
/// Python addin folder.
/// </summary>
string GetDefaultPythonFileName()
{
string path = GetPythonBindingAddInPath();
return Path.Combine(path, DefaultPythonFileName);
}
string GetPythonBindingAddInPath()
{
return StringParser.Parse("${addinpath:ICSharpCode.PythonBinding}");
}
}
}

154
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ApplicationSettingsPanel.cs

@ -1,154 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Python project's application settings panel.
/// </summary>
public class ApplicationSettingsPanel : AbstractXmlFormsProjectOptionPanel
{
const string AssemblyTextBoxName = "assemblyNameTextBox";
const string RootNamespaceTextBoxName = "rootNamespaceTextBox";
const string OutputTypeComboBoxName = "outputTypeComboBox";
const string MainFileComboBoxName = "mainFileComboBox";
public override void LoadPanelContents()
{
SetupFromManifestResource("ICSharpCode.PythonBinding.Resources.ApplicationSettingsPanel.xfrm");
InitializeHelper();
ConfigurationGuiBinding b = BindString(AssemblyTextBoxName, "AssemblyName", TextBoxEditMode.EditEvaluatedProperty);
CreateLocationButton(b, AssemblyTextBoxName);
AssemblyNameTextBox.TextChanged += AssemblyNameTextBoxTextChanged;
b = BindString(RootNamespaceTextBoxName, "RootNamespace", TextBoxEditMode.EditEvaluatedProperty);
CreateLocationButton(b, RootNamespaceTextBoxName);
b = BindEnum<OutputType>(OutputTypeComboBoxName, "OutputType");
CreateLocationButton(b, OutputTypeComboBoxName);
OutputTypeComboBox.SelectedIndexChanged += OutputTypeComboBoxSelectedIndexChanged;
b = BindString(MainFileComboBoxName, "MainFile", TextBoxEditMode.EditEvaluatedProperty);
CreateLocationButton(b, MainFileComboBoxName);
ConnectBrowseButtonControl("mainFileBrowseButton", "mainFileComboBox",
"${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
Get<TextBox>("projectFolder").Text = project.Directory;
Get<TextBox>("projectFile").Text = Path.GetFileName(project.FileName);
Get<TextBox>("projectFile").ReadOnly = true;
RefreshOutputNameTextBox();
AddConfigurationSelector(this);
}
/// <summary>
/// Calls SetupFromXmlStream after creating a stream from the current
/// assembly using the specified manifest resource name.
/// </summary>
/// <param name="resource">The manifest resource name used
/// to create the stream.</param>
protected virtual void SetupFromManifestResource(string resource)
{
SetupFromXmlStream(typeof(ApplicationSettingsPanel).Assembly.GetManifestResourceStream(resource));
}
/// <summary>
/// Binds the string property to a text box control.
/// </summary>
protected virtual ConfigurationGuiBinding BindString(string control, string property, TextBoxEditMode textBoxEditMode)
{
return helper.BindString(control, property, textBoxEditMode);
}
/// <summary>
/// Binds an enum property to a control.
/// </summary>
protected virtual ConfigurationGuiBinding BindEnum<T>(string control, string property) where T : struct
{
return helper.BindEnum<T>(control, property);
}
/// <summary>
/// Associates a location button with a control.
/// </summary>
protected virtual ChooseStorageLocationButton CreateLocationButton(ConfigurationGuiBinding binding, string controlName)
{
return binding.CreateLocationButton(controlName);
}
/// <summary>
/// Adds a configuration selector to the specified control.
/// </summary>
protected virtual void AddConfigurationSelector(Control control)
{
helper.AddConfigurationSelector(control);
}
/// <summary>
/// Connects the browse button control to the target control.
/// </summary>
protected virtual void ConnectBrowseButtonControl(string browseButton, string target, string fileFilter, TextBoxEditMode textBoxEditMode)
{
ConnectBrowseButton(browseButton, target, fileFilter, textBoxEditMode);
}
/// <summary>
/// Refreshes the output name text box after the assembly name
/// has changed.
/// </summary>
protected void AssemblyNameTextBoxTextChanged(object source, EventArgs e)
{
RefreshOutputNameTextBox();
}
/// <summary>
/// Refreshes the output name text box after the output type has changed.
/// </summary>
protected void OutputTypeComboBoxSelectedIndexChanged(object source, EventArgs e)
{
RefreshOutputNameTextBox();
}
/// <summary>
/// Updates the output name text box based on the assembly name and
/// output type.
/// </summary>
void RefreshOutputNameTextBox()
{
string assemblyName = AssemblyNameTextBox.Text;
string extension = CompilableProject.GetExtension((OutputType)OutputTypeComboBox.SelectedIndex);
Get<TextBox>("outputName").Text = String.Concat(assemblyName, extension);
}
TextBox AssemblyNameTextBox {
get { return Get<TextBox>("assemblyName"); }
}
ComboBox OutputTypeComboBox {
get { return Get<ComboBox>("outputType"); }
}
}
}

108
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs

@ -1,108 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Python project's compiling options panel.
/// </summary>
public class CompilingOptionsPanel : AbstractBuildOptions
{
public override void LoadPanelContents()
{
SetupFromManifestResource("ICSharpCode.PythonBinding.Resources.CompilingOptionsPanel.xfrm");
InitializeHelper();
ConfigurationGuiBinding b = BindString("outputPathTextBox", "OutputPath", TextBoxEditMode.EditRawProperty);
CreateLocationButton(b, "outputPathTextBox");
ConnectBrowseFolderButtonControl("outputPathBrowseButton", "outputPathTextBox", "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", TextBoxEditMode.EditRawProperty);
b = BindBoolean("debugInfoCheckBox", "DebugInfo", false);
CreateLocationButton(b, "debugInfoCheckBox");
b = CreatePlatformTargetComboBox();
CreateLocationButton(b, "targetCpuComboBox");
AddConfigurationSelector(this);
}
/// <summary>
/// Calls SetupFromXmlStream after creating a stream from the current
/// assembly using the specified manifest resource name.
/// </summary>
/// <param name="resource">The manifest resource name used
/// to create the stream.</param>
protected virtual void SetupFromManifestResource(string resource)
{
SetupFromXmlStream(typeof(CompilingOptionsPanel).Assembly.GetManifestResourceStream(resource));
}
/// <summary>
/// Binds the string property to a text box control.
/// </summary>
protected virtual ConfigurationGuiBinding BindString(string control, string property, TextBoxEditMode textBoxEditMode)
{
return helper.BindString(control, property, textBoxEditMode);
}
/// <summary>
/// Binds the boolean property to a check box control.
/// </summary>
protected virtual ConfigurationGuiBinding BindBoolean(string control, string property, bool defaultValue)
{
return helper.BindBoolean(control, property, defaultValue);
}
/// <summary>
/// Associates a location button with a control.
/// </summary>
protected virtual ChooseStorageLocationButton CreateLocationButton(ConfigurationGuiBinding binding, string controlName)
{
return binding.CreateLocationButton(controlName);
}
/// <summary>
/// Connects the browse folder button control to the target control.
/// </summary>
protected virtual void ConnectBrowseFolderButtonControl(string browseButton, string target, string description, TextBoxEditMode textBoxEditMode)
{
ConnectBrowseFolder(browseButton, target, description, textBoxEditMode);
}
/// <summary>
/// Adds a configuration selector to the specified control.
/// </summary>
protected virtual void AddConfigurationSelector(Control control)
{
helper.AddConfigurationSelector(control);
}
/// <summary>
/// Creates the platform target combo box.
/// </summary>
protected virtual ConfigurationGuiBinding CreatePlatformTargetComboBox()
{
return base.CreatePlatformTarget();
}
}
}

68
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConstructorInfo.cs

@ -1,68 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.Ast;
namespace ICSharpCode.PythonBinding
{
public class PythonConstructorInfo
{
ConstructorDeclaration constructor;
List<FieldDeclaration> fields = new List<FieldDeclaration>();
PythonConstructorInfo(ConstructorDeclaration constructor, List<FieldDeclaration> fields)
{
this.constructor = constructor;
this.fields = fields;
}
/// <summary>
/// Gets the constructor information from a type declaration. Returns null if there is no
/// constructor defined or if there are no fields defined.
/// </summary>
public static PythonConstructorInfo GetConstructorInfo(TypeDeclaration type)
{
List<FieldDeclaration> fields = new List<FieldDeclaration>();
ConstructorDeclaration constructor = null;
foreach (INode node in type.Children) {
ConstructorDeclaration currentConstructor = node as ConstructorDeclaration;
FieldDeclaration field = node as FieldDeclaration;
if (currentConstructor != null) {
constructor = currentConstructor;
} else if (field != null) {
fields.Add(field);
}
}
if ((fields.Count > 0) || (constructor != null)) {
return new PythonConstructorInfo(constructor, fields);
}
return null;
}
public ConstructorDeclaration Constructor {
get { return constructor; }
}
public List<FieldDeclaration> Fields {
get { return fields; }
}
}
}

170
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertProjectToPythonProjectCommand.cs

@ -1,170 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.IO;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Project.Converter;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Converts a C# or VB.NET project to Python.
/// </summary>
public class ConvertProjectToPythonProjectCommand : LanguageConverter
{
public override string TargetLanguageName {
get { return PythonProjectBinding.LanguageName; }
}
/// <summary>
/// Creates an PythonProject.
/// </summary>
protected override IProject CreateProject(string targetProjectDirectory, IProject sourceProject)
{
// Add IronPython reference.
PythonProject targetProject = (PythonProject)base.CreateProject(targetProjectDirectory, sourceProject);
IProjectItemListProvider targetProjectItems = targetProject as IProjectItemListProvider;
targetProjectItems.AddProjectItem(CreateIronPythonReference(targetProject));
return targetProject;
}
/// <summary>
/// Converts C# and VB.NET files to Python and saves the files.
/// </summary>
protected override void ConvertFile(FileProjectItem sourceItem, FileProjectItem targetItem)
{
NRefactoryToPythonConverter converter = NRefactoryToPythonConverter.Create(sourceItem.Include);
if (converter != null) {
targetItem.Include = ChangeFileExtensionToPythonFileExtension(sourceItem.Include);
string code = GetParseableFileContent(sourceItem.FileName);
string pythonCode = converter.Convert(code);
PythonProject pythonTargetProject = (PythonProject)targetItem.Project;
if ((converter.EntryPointMethods.Count > 0) && !pythonTargetProject.HasMainFile) {
pythonTargetProject.AddMainFile(targetItem.Include);
// Add code to call main method at the end of the file.
pythonCode += "\r\n\r\n" + converter.GenerateMainMethodCall(converter.EntryPointMethods[0]);
}
SaveFile(targetItem.FileName, pythonCode, GetDefaultFileEncoding());
} else {
LanguageConverterConvertFile(sourceItem, targetItem);
}
}
/// <summary>
/// Adds the MainFile property since adding it in the CreateProject method would mean
/// it gets removed via the base class CopyProperties method.
/// </summary>
protected override void CopyProperties(IProject sourceProject, IProject targetProject)
{
base.CopyProperties(sourceProject, targetProject);
AddMainFile(sourceProject, (PythonProject)targetProject);
}
/// <summary>
/// Calls the LanguageConverter class method ConvertFile which copies the source file to the target
/// file without any modifications.
/// </summary>
protected virtual void LanguageConverterConvertFile(FileProjectItem sourceItem, FileProjectItem targetItem)
{
base.ConvertFile(sourceItem, targetItem);
}
/// <summary>
/// Writes the specified file to disk.
/// </summary>
protected virtual void SaveFile(string fileName, string content, Encoding encoding)
{
File.WriteAllText(fileName, content, encoding);
}
protected virtual Encoding GetDefaultFileEncoding()
{
return FileService.DefaultFileEncoding.GetEncoding();
}
/// <summary>
/// Gets the content of the file from the parser service.
/// </summary>
protected virtual string GetParseableFileContent(string fileName)
{
return ParserService.GetParseableFileContent(fileName).Text;
}
/// <summary>
/// Gets the project content for the specified project.
/// </summary>
protected virtual IProjectContent GetProjectContent(IProject project)
{
return ParserService.GetProjectContent(project);
}
ReferenceProjectItem CreateIronPythonReference(IProject project)
{
ReferenceProjectItem reference = new ReferenceProjectItem(project, "IronPython");
reference.SetMetadata("HintPath", @"$(PythonBinPath)\IronPython.dll");
return reference;
}
/// <summary>
/// Adds a MainFile if the source project has a StartupObject.
/// </summary>
void AddMainFile(IProject sourceProject, PythonProject targetProject)
{
string startupObject = GetStartupObject(sourceProject);
if (startupObject != null) {
IClass c = FindClass(sourceProject, startupObject);
if (c != null) {
string fileName = FileUtility.GetRelativePath(sourceProject.Directory, c.CompilationUnit.FileName);
targetProject.AddMainFile(ChangeFileExtensionToPythonFileExtension(fileName));
}
}
}
string GetStartupObject(IProject project)
{
MSBuildBasedProject msbuildProject = project as MSBuildBasedProject;
if (msbuildProject != null) {
return msbuildProject.GetProperty(null, null, "StartupObject");
}
return null;
}
IClass FindClass(IProject project, string name)
{
return GetProjectContent(project).GetClass(name, 0);
}
/// <summary>
/// Changes the extension to ".py"
/// </summary>
static string ChangeFileExtensionToPythonFileExtension(string fileName)
{
return Path.ChangeExtension(fileName, ".py");
}
}
}

66
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertToPythonMenuCommand.cs

@ -1,66 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Converts VB.NET or C# code to Python.
/// </summary>
public class ConvertToPythonMenuCommand : AbstractMenuCommand
{
ScriptingTextEditorViewContent view;
public override void Run()
{
Run(new PythonWorkbench());
}
protected void Run(IScriptingWorkbench workbench)
{
view = new ScriptingTextEditorViewContent(workbench);
string code = GeneratePythonCode();
ShowPythonCodeInNewWindow(code);
}
string GeneratePythonCode()
{
NRefactoryToPythonConverter converter = NRefactoryToPythonConverter.Create(view.PrimaryFileName);
converter.IndentString = view.TextEditorOptions.IndentationString;
return converter.Convert(view.EditableView.Text);
}
void ShowPythonCodeInNewWindow(string code)
{
NewFile("Generated.py", "Python", code);
}
/// <summary>
/// Creates a new file using the FileService by default.
/// </summary>
protected virtual void NewFile(string defaultName, string language, string content)
{
FileService.NewFile(defaultName, content);
}
}
}

28
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonResolver.cs

@ -1,28 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.PythonBinding
{
public interface IPythonResolver
{
ResolveResult Resolve(PythonResolverContext resolverContext);
}
}

90
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/MemberName.cs

@ -1,90 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Split up an expression into a member name and a type name.
/// </summary>
/// <example>
/// "myObject.Field" => "myObject" + "Field"
/// "System.Console.WriteLine" => "System.Console" + "Console.WriteLine"
/// </example>
public class MemberName
{
string name = String.Empty;
string type = String.Empty;
public MemberName(string expression)
{
Parse(expression);
}
public MemberName(string typeName, string memberName)
{
this.type = typeName;
this.name = memberName;
}
void Parse(string expression)
{
if (!String.IsNullOrEmpty(expression)) {
int index = expression.LastIndexOf('.');
if (index > 0) {
type = expression.Substring(0, index);
name = expression.Substring(index + 1);
} else {
type = expression;
}
}
}
public string Name {
get { return name; }
}
public bool HasName {
get { return !String.IsNullOrEmpty(name); }
}
public string Type {
get { return type; }
}
public override string ToString()
{
return String.Format("Type: {0}, Member: {1}", type, name);
}
public override bool Equals(object obj)
{
MemberName rhs = obj as MemberName;
if (rhs != null) {
return (name == rhs.name) && (type == rhs.type);
}
return false;
}
public override int GetHashCode()
{
return name.GetHashCode() ^ type.GetHashCode();
}
}
}

2074
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs

File diff suppressed because it is too large Load Diff

159
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonAstWalker.cs

@ -1,159 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using Microsoft.Scripting;
using System;
using System.Collections.Generic;
using System.IO;
using ICSharpCode.SharpDevelop.Dom;
using IronPython.Compiler;
using IronPython.Compiler.Ast;
using IronPython.Runtime;
namespace ICSharpCode.PythonBinding
{
/// <summary>
/// Walks the python parse tree.
/// </summary>
public class PythonAstWalker : PythonWalker
{
PythonCompilationUnit compilationUnit;
IClass currentClass;
PythonModule module;
/// <summary>
/// All classes in a file take the namespace of the filename.
/// </summary>
public PythonAstWalker(IProjectContent projectContent, string fileName)
{
compilationUnit = new PythonCompilationUnit(projectContent, fileName);
}
/// <summary>
/// Returns the compilation unit created after the Walk method
/// has been called.
/// </summary>
public ICompilationUnit CompilationUnit {
get { return compilationUnit; }
}
/// <summary>
/// Walks the python statement returned from the parser.
/// </summary>
public void Walk(Statement statement)
{
statement.Walk(this);
}
public override bool Walk(ClassDefinition classDefinition)
{
if (classDefinition.Parent != null) {
PythonClass c = new PythonClass(compilationUnit, classDefinition);
WalkClassBody(c, classDefinition.Body);
}
return false;
}
void WalkClassBody(IClass c, Statement classBody)
{
currentClass = c;
classBody.Walk(this);
currentClass = null;
}
public override bool Walk(FunctionDefinition functionDefinition)
{
if (functionDefinition.Body == null) {
return false;
}
IClass c = GetClassBeingWalked();
PythonMethodDefinition methodDefinition = new PythonMethodDefinition(functionDefinition);
PythonMethod method = methodDefinition.CreateMethod(c);
if (method is PythonConstructor) {
FindFields(c, functionDefinition);
}
return false;
}
/// <summary>
/// If the current class is null then create a module so a method outside of a class can be
/// parsed.
/// </summary>
IClass GetClassBeingWalked()
{
if (currentClass == null) {
// Walking a method outside a class.
CreateModule();
return module;
}
return currentClass;
}
/// <summary>
/// Creates the module which will act as a class so it can hold any methods defined in the module.
/// </summary>
void CreateModule()
{
if (module == null) {
module = new PythonModule(compilationUnit);
}
}
void FindFields(IClass c, FunctionDefinition functionDefinition)
{
PythonClassFields fields = new PythonClassFields(functionDefinition);
fields.AddFields(c);
}
/// <summary>
/// Walks an import statement and adds it to the compilation unit's
/// Usings.
/// </summary>
public override bool Walk(ImportStatement node)
{
PythonImport import = new PythonImport(compilationUnit.ProjectContent, node);
compilationUnit.UsingScope.Usings.Add(import);
return false;
}
public override bool Walk(FromImportStatement node)
{
PythonFromImport import = new PythonFromImport(compilationUnit.ProjectContent, node);
compilationUnit.UsingScope.Usings.Add(import);
return false;
}
public override bool Walk(AssignmentStatement node)
{
if (currentClass != null) {
FindProperty(node);
return false;
}
return base.Walk(node);
}
void FindProperty(AssignmentStatement node)
{
PythonPropertyAssignment propertyAssignment = new PythonPropertyAssignment(node);
propertyAssignment.CreateProperty(currentClass);
}
}
}

37
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonBuiltInModuleMemberName.cs

@ -1,37 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
namespace ICSharpCode.PythonBinding
{
public class PythonBuiltInModuleMemberName : MemberName
{
public const string PythonBuiltInModuleName = "__builtin__";
public PythonBuiltInModuleMemberName(string memberName)
: base(PythonBuiltInModuleName, memberName)
{
}
public static bool IsBuiltInModule(string name)
{
return name == PythonBuiltInModuleName;
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save