Browse Source

Merge remote-tracking branch 'origin/master' into xmlForms

pull/30/head
Daniel Grunwald 13 years ago
parent
commit
152062f5ce
  1. 21
      data/resources/StringResources.de.resx
  2. 57
      data/resources/StringResources.fr.resx
  3. 21
      data/resources/StringResources.nl.resx
  4. 15
      data/resources/StringResources.resx
  5. BIN
      data/templates/packages/Modernizr.1.7.nupkg
  6. BIN
      data/templates/packages/Modernizr.2.5.3.nupkg
  7. BIN
      data/templates/packages/jQuery.1.6.1.nupkg
  8. BIN
      data/templates/packages/jQuery.1.7.2.nupkg
  9. 8
      data/templates/project/CSharp/MvcRazorProject.xpt
  10. 8
      data/templates/project/CSharp/MvcWebProject.xpt
  11. 8
      data/templates/project/VB/MvcRazorProject.xpt
  12. 8
      data/templates/project/VB/MvcWebProject.xpt
  13. 69
      samples/MSTest/MSTest.SharpDevelop.Tests/MSTest.SharpDevelop.Tests.csproj
  14. 338
      samples/MSTest/MSTest.SharpDevelop.Tests/MSTestFrameworkTests.cs
  15. 184
      samples/MSTest/MSTest.SharpDevelop.Tests/MSTestResultsTests.cs
  16. 31
      samples/MSTest/MSTest.SharpDevelop.Tests/Properties/AssemblyInfo.cs
  17. 24
      samples/MSTest/MSTest.SharpDevelop.sln
  18. 103
      samples/MSTest/MSTest.SharpDevelop/MSTest.SharpDevelop.csproj
  19. 30
      samples/MSTest/MSTest.SharpDevelop/MSTest.addin
  20. 46
      samples/MSTest/MSTest.SharpDevelop/MSTestApplication.cs
  21. 37
      samples/MSTest/MSTest.SharpDevelop/MSTestApplicationCommandLine.cs
  22. 134
      samples/MSTest/MSTest.SharpDevelop/MSTestDebugger.cs
  23. 109
      samples/MSTest/MSTest.SharpDevelop/MSTestFramework.cs
  24. 26
      samples/MSTest/MSTest.SharpDevelop/MSTestOptions.cs
  25. 32
      samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml
  26. 64
      samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml.cs
  27. 31
      samples/MSTest/MSTest.SharpDevelop/MSTestQualifiedClassName.cs
  28. 93
      samples/MSTest/MSTest.SharpDevelop/MSTestResult.cs
  29. 91
      samples/MSTest/MSTest.SharpDevelop/MSTestResults.cs
  30. 27
      samples/MSTest/MSTest.SharpDevelop/MSTestResultsFileName.cs
  31. 138
      samples/MSTest/MSTest.SharpDevelop/MSTestRunner.cs
  32. 28
      samples/MSTest/MSTest.SharpDevelop/ProjectItemExtensions.cs
  33. 31
      samples/MSTest/MSTest.SharpDevelop/Properties/AssemblyInfo.cs
  34. 4
      src/AddIns/Analysis/CodeCoverage/Test/Testing/CodeCoverageTestRunnerTests.cs
  35. 4
      src/AddIns/Analysis/CodeCoverage/Test/Testing/PartCoverApplicationTests.cs
  36. 10
      src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleApplication.cs
  37. 29
      src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleCommandLineTests.cs
  38. 2
      src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleProcessStartInfoTestFixture.cs
  39. 2
      src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsForMethodTestFixture.cs
  40. 4
      src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsWithDebuggerTestFixture.cs
  41. 2
      src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestInPadCommandTestFixture.cs
  42. 4
      src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestWithDebuggerCommandTestFixture.cs
  43. 2
      src/AddIns/Analysis/UnitTesting/UnitTesting.csproj
  44. 1
      src/AddIns/BackendBindings/AspNet.Mvc/Project/AspNet.Mvc.csproj
  45. 77
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/ViewInBrowser.cs
  46. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonComponentWalker.cs
  47. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolverContext.cs
  48. 108
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormWithButtonFollowedByTimerTestFixture.cs
  49. 1
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
  50. 30
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs
  51. 2
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs
  52. 47
      src/AddIns/BackendBindings/VBNetBinding/Test/FormattingStrategy/EndSubTests.cs
  53. 2
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs
  54. 10
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs
  55. 21
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
  56. 14
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs
  57. 10
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs
  58. 39
      src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs
  59. 11
      src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs
  60. 10
      src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs
  61. 7
      src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs
  62. 35
      src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchListAutoCompleteCell.cs
  63. 86
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchInputBox.xaml.cs
  64. 17
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
  65. 8
      src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs
  66. 12
      src/AddIns/Debugger/Debugger.Core/Process.cs
  67. 11
      src/AddIns/Debugger/Debugger.Core/ThreadCollection.cs
  68. 3
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
  69. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs
  70. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
  71. 22
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs
  72. 6
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs
  73. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml
  74. 15
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs
  75. 12
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs
  76. 20
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs
  77. 4
      src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs
  78. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/IdeChooseClassService.cs
  79. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs
  80. 7
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs
  81. 3
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeViewContainerControl.cs
  82. 5
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
  83. 6
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
  84. 9
      src/AddIns/DisplayBindings/XmlEditor/Test/Editor/IndentChildElementEndTagAfterNewLineTypedTestFixture.cs
  85. BIN
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.4.1.0.8000.nupkg
  86. 4
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec
  87. BIN
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.nupkg
  88. BIN
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.symbols.nupkg
  89. 2
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec
  90. 1
      src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
  91. 10
      src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs
  92. 24
      src/AddIns/Misc/PackageManagement/Project/Src/ConfigSettingsFileSystem.cs
  93. 2
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs
  94. 10
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
  95. 4
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs
  96. 3
      src/AddIns/Misc/PackageManagement/Project/Src/ISharpDevelopPackageRepositoryFactory.cs
  97. 2
      src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs
  98. 2
      src/AddIns/Misc/PackageManagement/Project/Src/PackageReferenceFileNameForProject.cs
  99. 4
      src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs
  100. 2
      src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs
  101. Some files were not shown because too many files have changed in this diff Show More

21
data/resources/StringResources.de.resx

@ -4033,6 +4033,12 @@ Grund: Der Wert zu dem zurückgesetzt werden soll ist ungültig weil sich eine a @@ -4033,6 +4033,12 @@ Grund: Der Wert zu dem zurückgesetzt werden soll ist ungültig weil sich eine a
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.PublicKeyToken.Description" xml:space="preserve">
<value>Das öffentliche Schlüsseltoken der Assembly</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly" xml:space="preserve">
<value>Assembly referenzieren</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly.Description" xml:space="preserve">
<value>Wenn auf false gesetzt, gibt diese Referenz nur eine Build-Reihenfolgenabhängigkeit an und fügt keine Assembly-Referenz zum Projekt hinzu.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.SpecificVersion" xml:space="preserve">
<value>Festgelegte Version</value>
</data>
@ -4979,6 +4985,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< @@ -4979,6 +4985,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="MainWindow.Windows.Debug.LocalVariables.CopyToClipboard" xml:space="preserve">
<value>Kopiere Wert in Zwischenablage</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NameColumn" xml:space="preserve">
<value>Name</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NonPublicMembers" xml:space="preserve">
<value>Nicht-öffentliche Mitglieder</value>
</data>
@ -5000,6 +5009,12 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< @@ -5000,6 +5009,12 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="MainWindow.Windows.Debug.LocalVariables.StaticMembers" xml:space="preserve">
<value>Statische Mitglieder</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.TypeColumn" xml:space="preserve">
<value>Typ</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.ValueColumn" xml:space="preserve">
<value>Wert</value>
</data>
<data name="MainWindow.Windows.Debug.MemoryPad" xml:space="preserve">
<value>Speicher</value>
</data>
@ -5375,6 +5390,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< @@ -5375,6 +5390,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="OpenFileTabEventHandler.FileContainingFolderInExplorer" xml:space="preserve">
<value>Öffne beinhaltenden Ordner im Explorer</value>
</data>
<data name="OpenFileTabEventHandler.OpenCommandPromptHere" xml:space="preserve">
<value>Kommandozeile hier öffnen</value>
</data>
<data name="ProjectBrowser.Toolbar.CollapseAll" xml:space="preserve">
<value>Alle Knoten einklappen</value>
</data>
@ -5510,6 +5528,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< @@ -5510,6 +5528,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="ProjectComponent.ContextMenu.RunProject" xml:space="preserve">
<value>Projekt sta&amp;rten</value>
</data>
<data name="ProjectComponent.ContextMenu.RunProjectWithoutDebugger" xml:space="preserve">
<value>Projekt ohne Debugger starten</value>
</data>
<data name="ProjectComponent.ContextMenu.SetAsStartupProject" xml:space="preserve">
<value>Als St&amp;artprojekt festlegen</value>
</data>

57
data/resources/StringResources.fr.resx

@ -1862,6 +1862,9 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value> @@ -1862,6 +1862,9 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping" xml:space="preserve">
<value>Pas-à-pas en cours</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.DecompileCodeWithoutSymbols" xml:space="preserve">
<value>Décompiler le code sans symboles</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.EnableJustMyCode" xml:space="preserve">
<value>Utiliser 'Seulement mon code' pour le pas-à-pas</value>
</data>
@ -3379,6 +3382,9 @@ Configurez le chemin vers NAnt dans les options de SharpDevelop.</value> @@ -3379,6 +3382,9 @@ Configurez le chemin vers NAnt dans les options de SharpDevelop.</value>
<data name="ICSharpCode.Refactoring.NoClassOrOverridableSymbolUnderCursorError" xml:space="preserve">
<value>L'élément sélectionné n'est ni une classe ni un membre surchargeable: aucun symbole dérivé n'est disponible.</value>
</data>
<data name="ICSharpCode.Refactoring.NoClassUnderCursorError" xml:space="preserve">
<value>Impossible de trouver la définition du type sous le curseur.</value>
</data>
<data name="ICSharpCode.RubyBinding.SendLineToRubyConsole" xml:space="preserve">
<value>Envoyer cette ligne vers la console Ruby</value>
</data>
@ -3774,6 +3780,9 @@ Toutes les modifications seront perdues.</value> @@ -3774,6 +3780,9 @@ Toutes les modifications seront perdues.</value>
<data name="ICSharpCode.SharpDevelop.FormDesigner.LoadErrorCheckSourceCodeForErrors" xml:space="preserve">
<value>Impossible de charger le concepteur. Vérifier les erreurs de syntaxe du code source et si toutes les références sont disponibles.</value>
</data>
<data name="ICSharpCode.SharpDevelop.FormDesigner.ReportFlushErrors" xml:space="preserve">
<value>Une ou plusieurs erreurs sont survenues en essayant de vider le contenu du concepteur. C'est peut-être une exception non gérée dans un composant tiers sur le formulaire ou le contrôle.</value>
</data>
<data name="ICSharpCode.SharpDevelop.FormDesigner.ToolboxProvider.CantLoadSidbarComponentLibraryWarning" xml:space="preserve">
<value>Ne peut charger la librairie contenant la barre de composants.
Les composants Windows Form ne seront pas accessibles, veuillez configurer manuellement la barre de composants (clic droit sur une catégorie de la barre de menu -&gt; Paramétrer la barre de menu).</value>
@ -3988,6 +3997,12 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value> @@ -3988,6 +3997,12 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.Culture.Description" xml:space="preserve">
<value>La culture supportée par la référence</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.EmbedInteropTypes" xml:space="preserve">
<value>Embarquer les types interop</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.EmbedInteropTypes.Description" xml:space="preserve">
<value>Précise si les type d'interop COM définis dans l'assembly référencé sont embarqués dans l'assembly cible.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.LocalCopy" xml:space="preserve">
<value>Copie locale</value>
</data>
@ -4006,6 +4021,12 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value> @@ -4006,6 +4021,12 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.PublicKeyToken.Description" xml:space="preserve">
<value>Le jeton de clé publique</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly" xml:space="preserve">
<value>Référencer l'assembly</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly.Description" xml:space="preserve">
<value>Si positionné à Faux, cette référence spécifie uniquement une dépendance dans l'ordre de la construction sans référencer l'assembly.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.SpecificVersion" xml:space="preserve">
<value>Version Spécifique</value>
</data>
@ -4051,6 +4072,9 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value> @@ -4051,6 +4072,9 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value>
<data name="ICSharpCode.SharpDevelop.LoadingFile" xml:space="preserve">
<value>Chargement de ${Filename}...</value>
</data>
<data name="ICSharpCode.SharpDevelop.Project.CloseSolution" xml:space="preserve">
<value>Fermer la solution</value>
</data>
<data name="ICSharpCode.SharpDevelop.Project.KeepOldSolution" xml:space="preserve">
<value>Laisser la solution précédente ouverte</value>
</data>
@ -4084,6 +4108,14 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value> @@ -4084,6 +4108,14 @@ Utilisez seulement des lettres, chiffres, espace, '.' ou '_'.</value>
<data name="ICSharpCode.SharpDevelop.Project.UpgradeView.Title" xml:space="preserve">
<value>Mettre à jour le projet</value>
</data>
<data name="ICSharpCode.SharpDevelop.Project.UpgradeView.UpdateOnLoadDueToMissingMSBuild" xml:space="preserve">
<value>Le projet '${ProjectName}' cible MSBuild ${OldToolsVersion}, mais cette version n'est pas installée.
Voulez vous mettre à jour le projet vers MSBuild ${NewToolsVersion}?
Le projet ne sera pas ouvert sans cette mise à jour.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Project.UpgradeView.UpdateToMSBuildButton" xml:space="preserve">
<value>Mettre à jour vers MSBuild ${NewToolsVersion}</value>
</data>
<data name="ICSharpCode.SharpDevelop.Project.UpgradeView.UpgradeFromPreviousVersionDescription" xml:space="preserve">
<value>Cette solution a été créée par une précédente version de SharpDevelop.
La mettre à jour vous permet d'utiliser de nouveaux languages, ou les évolutions du framework.</value>
@ -4165,7 +4197,7 @@ Allez dans 'Outils/Options-&gt;Style Visuel pour changer l'ambiance actuelle.</v @@ -4165,7 +4197,7 @@ Allez dans 'Outils/Options-&gt;Style Visuel pour changer l'ambiance actuelle.</v
<value>Processus de travail {0} ASP.NET/IIS(Express) introuvable.</value>
</data>
<data name="ICSharpCode.WebProjectOptionsPanel.NoProjectUrlOrProgramAction" xml:space="preserve">
<value>Pas d'URL du projet spécifiée ou de programme externe. Vérifier le serveur web dans Propriétés du projet - Onglet debug.</value>
<value>Aucun programme externe ni URL spécifié. Vérifier le serveur web dans Propriétés du projet - onglet Web.</value>
</data>
<data name="ICSharpCode.WebProjectOptionsPanel.Port" xml:space="preserve">
<value>Port:</value>
@ -4783,7 +4815,7 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace @@ -4783,7 +4815,7 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
<value>Vous ne pouvez pas changer pour une fonction sans symboles.</value>
</data>
<data name="MainWindow.Windows.Debug.CallStack.CannotSwitchWithoutSymbolsOrDecompiledCodeOptions" xml:space="preserve">
<value>Les options de décompilation du code doivent être activés pour aller vers une fonction sans symboles.</value>
<value>Impossible de basculer vers une méthode sans symboles de déboguage.Recompilez avec les symboles ou activer l'option de décompilation du code sans symboles.</value>
</data>
<data name="MainWindow.Windows.Debug.CallStack.ExternalMethods" xml:space="preserve">
<value>[Méthodes externes]</value>
@ -4941,6 +4973,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace @@ -4941,6 +4973,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
<data name="MainWindow.Windows.Debug.LocalVariables.CopyToClipboard" xml:space="preserve">
<value>Copier la valeur dans le presse-papier</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NameColumn" xml:space="preserve">
<value>Nom</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NonPublicMembers" xml:space="preserve">
<value>Membres non publics</value>
</data>
@ -4962,6 +4997,12 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace @@ -4962,6 +4997,12 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
<data name="MainWindow.Windows.Debug.LocalVariables.StaticMembers" xml:space="preserve">
<value>Membres statiques</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.TypeColumn" xml:space="preserve">
<value>Type</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.ValueColumn" xml:space="preserve">
<value>Valeur</value>
</data>
<data name="MainWindow.Windows.Debug.MemoryPad" xml:space="preserve">
<value>Mémoire</value>
</data>
@ -5001,12 +5042,18 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace @@ -5001,12 +5042,18 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
<data name="MainWindow.Windows.Debug.Modules.AddressColumn" xml:space="preserve">
<value>Adresse</value>
</data>
<data name="MainWindow.Windows.Debug.Modules.DynamicModule" xml:space="preserve">
<value>(dynamique)</value>
</data>
<data name="MainWindow.Windows.Debug.Modules.HasNoSymbols" xml:space="preserve">
<value>Aucun symbole n'est chargé.</value>
</data>
<data name="MainWindow.Windows.Debug.Modules.HasSymbols" xml:space="preserve">
<value>Symboles chargés.</value>
</data>
<data name="MainWindow.Windows.Debug.Modules.InMemoryModule" xml:space="preserve">
<value>(en mémoire)</value>
</data>
<data name="MainWindow.Windows.Debug.Modules.OrderColumn" xml:space="preserve">
<value>Ordre</value>
</data>
@ -5331,6 +5378,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace @@ -5331,6 +5378,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
<data name="OpenFileTabEventHandler.FileContainingFolderInExplorer" xml:space="preserve">
<value>Ouvrir le répertoire dans l'explorateur</value>
</data>
<data name="OpenFileTabEventHandler.OpenCommandPromptHere" xml:space="preserve">
<value>Ouvrir une invite de commande ici</value>
</data>
<data name="ProjectBrowser.Toolbar.CollapseAll" xml:space="preserve">
<value>Réduire tous les noeuds</value>
</data>
@ -5466,6 +5516,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace @@ -5466,6 +5516,9 @@ Soit ils n'existent pas, soit le document Wix n'est pas pour WiX 3.0 et l'espace
<data name="ProjectComponent.ContextMenu.RunProject" xml:space="preserve">
<value>Lance&amp;r projet</value>
</data>
<data name="ProjectComponent.ContextMenu.RunProjectWithoutDebugger" xml:space="preserve">
<value>Exécuter ce projet sans débogueur</value>
</data>
<data name="ProjectComponent.ContextMenu.SetAsStartupProject" xml:space="preserve">
<value>Définir comme projet de dém&amp;arrage</value>
</data>

21
data/resources/StringResources.nl.resx

@ -4023,6 +4023,12 @@ Alleen letters, getallen, spatie, '.' of '_' zijn toegestaan.</value> @@ -4023,6 +4023,12 @@ Alleen letters, getallen, spatie, '.' of '_' zijn toegestaan.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.PublicKeyToken.Description" xml:space="preserve">
<value>De openbare sleutel token</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly" xml:space="preserve">
<value>Referentie assembly</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly.Description" xml:space="preserve">
<value>Indien false, specificeert deze referentie enkel een bouw-volgorde afhankelijkheid en heeft niet tot gevolg dat de assembly gerefereerd wordt.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.SpecificVersion" xml:space="preserve">
<value>Specifieke versie</value>
</data>
@ -4969,6 +4975,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -4969,6 +4975,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<data name="MainWindow.Windows.Debug.LocalVariables.CopyToClipboard" xml:space="preserve">
<value>Kopieer waarde naar klembord</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NameColumn" xml:space="preserve">
<value>Naam</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NonPublicMembers" xml:space="preserve">
<value>Niet openbare leden</value>
</data>
@ -4990,6 +4999,12 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -4990,6 +4999,12 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<data name="MainWindow.Windows.Debug.LocalVariables.StaticMembers" xml:space="preserve">
<value>Statische leden</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.TypeColumn" xml:space="preserve">
<value>Type</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.ValueColumn" xml:space="preserve">
<value>Waarde</value>
</data>
<data name="MainWindow.Windows.Debug.MemoryPad" xml:space="preserve">
<value>Geheugen</value>
</data>
@ -5365,6 +5380,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -5365,6 +5380,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<data name="OpenFileTabEventHandler.FileContainingFolderInExplorer" xml:space="preserve">
<value>Open de document bevattende map in de Explorer</value>
</data>
<data name="OpenFileTabEventHandler.OpenCommandPromptHere" xml:space="preserve">
<value>Open hier de commando prompt</value>
</data>
<data name="ProjectBrowser.Toolbar.CollapseAll" xml:space="preserve">
<value>Alle knooppunten invouwen</value>
</data>
@ -5500,6 +5518,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -5500,6 +5518,9 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<data name="ProjectComponent.ContextMenu.RunProject" xml:space="preserve">
<value>P&amp;roject starten</value>
</data>
<data name="ProjectComponent.ContextMenu.RunProjectWithoutDebugger" xml:space="preserve">
<value>Project uitvoeren zonder foutopsporing</value>
</data>
<data name="ProjectComponent.ContextMenu.SetAsStartupProject" xml:space="preserve">
<value>Als startproject instellen.</value>
</data>

15
data/resources/StringResources.resx

@ -5270,6 +5270,9 @@ Stop/terminate the debuggee.</comment> @@ -5270,6 +5270,9 @@ Stop/terminate the debuggee.</comment>
<value>Copy value to clipboard</value>
<comment>Item in variable's context menu</comment>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NameColumn" xml:space="preserve">
<value>Name</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.NonPublicMembers" xml:space="preserve">
<value>Non-Public members</value>
</data>
@ -5297,6 +5300,12 @@ Shows the full callstack of the error.</comment> @@ -5297,6 +5300,12 @@ Shows the full callstack of the error.</comment>
<data name="MainWindow.Windows.Debug.LocalVariables.StaticMembers" xml:space="preserve">
<value>Static members</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.TypeColumn" xml:space="preserve">
<value>Type</value>
</data>
<data name="MainWindow.Windows.Debug.LocalVariables.ValueColumn" xml:space="preserve">
<value>Value</value>
</data>
<data name="MainWindow.Windows.Debug.MemoryPad" xml:space="preserve">
<value>Memory</value>
</data>
@ -5686,6 +5695,9 @@ Removed the end part of the original message ", reason '${Message}'" since this @@ -5686,6 +5695,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
<value>Open containing folder in Explorer</value>
<comment>String for the editor tab context menu that will open the directory in which a documents file is contained in Windows Explorer.</comment>
</data>
<data name="OpenFileTabEventHandler.OpenCommandPromptHere" xml:space="preserve">
<value>Open command prompt here</value>
</data>
<data name="ProjectBrowser.Toolbar.CollapseAll" xml:space="preserve">
<value>Collapse all nodes</value>
</data>
@ -5830,6 +5842,9 @@ Removed the end part of the original message ", reason '${Message}'" since this @@ -5830,6 +5842,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
<data name="ProjectComponent.ContextMenu.RunProject" xml:space="preserve">
<value>&amp;Run Project</value>
</data>
<data name="ProjectComponent.ContextMenu.RunProjectWithoutDebugger" xml:space="preserve">
<value>Run Project without Debugger</value>
</data>
<data name="ProjectComponent.ContextMenu.SetAsStartupProject" xml:space="preserve">
<value>Set as St&amp;artUp Project</value>
</data>

BIN
data/templates/packages/Modernizr.1.7.nupkg

Binary file not shown.

BIN
data/templates/packages/Modernizr.2.5.3.nupkg

Binary file not shown.

BIN
data/templates/packages/jQuery.1.6.1.nupkg

Binary file not shown.

BIN
data/templates/packages/jQuery.1.7.2.nupkg

Binary file not shown.

8
data/templates/project/CSharp/MvcRazorProject.xpt

@ -273,8 +273,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p> @@ -273,8 +273,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css">
<script src="@Url.Content("~/Scripts/modernizer-1.7.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.6.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-2.5.3.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
</head>
<body>
<div id="page">
@ -300,8 +300,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p> @@ -300,8 +300,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p>
<File name="packages.config">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="jQuery" version="1.6.1" />
<package id="Modernizr" version="1.7" />
<package id="jQuery" version="1.7.2" />
<package id="Modernizr" version="2.5.3" />
</packages>
]]>
</File>

8
data/templates/project/CSharp/MvcWebProject.xpt

@ -280,8 +280,8 @@ namespace ${StandardNamespace} @@ -280,8 +280,8 @@ namespace ${StandardNamespace}
<head runat="server">
<title><asp:ContentPlaceHolder id="Title" runat="server"/></title>
<link href="<%: Url.Content("~/Content/Site.css") %>" rel="stylesheet" type="text/css">
<script src="<%: Url.Content("~/Scripts/modernizer-1.7.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.6.1.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/modernizr-2.5.3.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.7.2.min.js") %>" type="text/javascript"></script>
</head>
<body>
<div id="page">
@ -307,8 +307,8 @@ namespace ${StandardNamespace} @@ -307,8 +307,8 @@ namespace ${StandardNamespace}
<File name="packages.config">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="jQuery" version="1.6.1" />
<package id="Modernizr" version="1.7" />
<package id="jQuery" version="1.7.2" />
<package id="Modernizr" version="2.5.3" />
</packages>
]]>
</File>

8
data/templates/project/VB/MvcRazorProject.xpt

@ -265,8 +265,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p> @@ -265,8 +265,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p>
<head>
<title>@ViewData("Title")</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css">
<script src="@Url.Content("~/Scripts/modernizer-1.7.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.6.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-2.5.3.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
</head>
<body>
<div id="page">
@ -292,8 +292,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p> @@ -292,8 +292,8 @@ Aliquam suscipit tellus vel nunc elementum fringilla.</p>
<File name="packages.config">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="jQuery" version="1.6.1" />
<package id="Modernizr" version="1.7" />
<package id="jQuery" version="1.7.2" />
<package id="Modernizr" version="2.5.3" />
</packages>
]]>
</File>

8
data/templates/project/VB/MvcWebProject.xpt

@ -272,8 +272,8 @@ End Class @@ -272,8 +272,8 @@ End Class
<head runat="server">
<title><asp:ContentPlaceHolder id="Title" runat="server"/></title>
<link href="<%: Url.Content("~/Content/Site.css") %>" rel="stylesheet" type="text/css">
<script src="<%: Url.Content("~/Scripts/modernizer-1.7.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.6.1.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/modernizr-2.5.3.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.7.2.min.js") %>" type="text/javascript"></script>
</head>
<body>
<div id="page">
@ -299,8 +299,8 @@ End Class @@ -299,8 +299,8 @@ End Class
<File name="packages.config">
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="jQuery" version="1.6.1" />
<package id="Modernizr" version="1.7" />
<package id="jQuery" version="1.7.2" />
<package id="Modernizr" version="2.5.3" />
</packages>
]]>
</File>

69
samples/MSTest/MSTest.SharpDevelop.Tests/MSTest.SharpDevelop.Tests.csproj

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectGuid>{51D56190-67B7-4A49-BA0A-24010460CCC6}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Library</OutputType>
<RootNamespace>MSTest.SharpDevelop.Tests</RootNamespace>
<AssemblyName>MSTest.SharpDevelop.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.Core">
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Dom">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\..\src\Tools\NUnit\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks">
<HintPath>..\..\..\src\Libraries\RhinoMocks\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="UnitTesting">
<HintPath>..\..\..\AddIns\Analysis\UnitTesting\UnitTesting.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MSTestFrameworkTests.cs" />
<Compile Include="MSTestResultsTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MSTest.SharpDevelop\MSTest.SharpDevelop.csproj">
<Project>{8DF3A610-47F9-4448-B455-952BD57CB5CC}</Project>
<Name>MSTest.SharpDevelop</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

338
samples/MSTest/MSTest.SharpDevelop.Tests/MSTestFrameworkTests.cs

@ -0,0 +1,338 @@ @@ -0,0 +1,338 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using ICSharpCode.MSTest;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.UnitTesting;
using NUnit.Framework;
using Rhino.Mocks;
namespace MSTest.SharpDevelop.Tests
{
[TestFixture]
public class MSTestFrameworkTests
{
MSTestFramework testFramework;
IProject fakeProject;
[SetUp]
public void Init()
{
testFramework = new MSTestFramework();
fakeProject = MockRepository.GenerateStub<IProject>();
fakeProject.Stub(p => p.SyncRoot).Return(fakeProject);
}
void AddReferencesToProject(params string[] referenceNames)
{
List<ProjectItem> projectItems = referenceNames
.Select(name => new ReferenceProjectItem(fakeProject, name) as ProjectItem)
.ToList();
AddItemsToProject(projectItems);
}
void AddItemsToProject(List<ProjectItem> projectItems)
{
fakeProject
.Stub(project => project.Items)
.Return(new ReadOnlyCollection<ProjectItem>(projectItems));
}
void AddFileAndReferenceToProject(string fileName, string reference)
{
var projectItems = new List<ProjectItem>();
projectItems.Add(new FileProjectItem(fakeProject, ItemType.Compile, fileName));
projectItems.Add(new ReferenceProjectItem(fakeProject, reference));
AddItemsToProject(projectItems);
}
void NoItemsInProject()
{
AddReferencesToProject();
}
IClass CreateClassWithoutAnyAttributes()
{
IClass fakeClass = MockRepository.GenerateStub<IClass>();
AddAttributesToClass(fakeClass, new List<IAttribute>());
return fakeClass;
}
void AddAttributesToClass(IClass fakeClass, List<IAttribute> attributes)
{
fakeClass.Stub(c => c.Attributes).Return(attributes);
}
IClass CreateClassWithAttributes(params string[] attributeNames)
{
IClass fakeClass = MockRepository.GenerateStub<IClass>();
List<IAttribute> attributes = CreateAttributes(attributeNames);
AddAttributesToClass(fakeClass, attributes);
return fakeClass;
}
List<IAttribute> CreateAttributes(params string[] attributeNames)
{
return attributeNames.Select(name => CreateAttribute(name)).ToList();
}
IAttribute CreateAttribute(string name)
{
IReturnType returnType = MockRepository.GenerateStub<IReturnType>();
returnType.Stub(t => t.FullyQualifiedName).Return(name);
IAttribute attribute = MockRepository.GenerateStub<IAttribute>();
attribute.Stub(a => a.AttributeType).Return(returnType);
return attribute;
}
void MakeClassAbstract(IClass fakeClass)
{
fakeClass.Stub(c => c.IsAbstract).Return(true);
}
IMethod CreateMethodWithoutAnyAttributes()
{
IMethod fakeMethod = MockRepository.GenerateStub<IMethod>();
AddAttributesToMethod(fakeMethod, new List<IAttribute>());
return fakeMethod;
}
IMethod CreateMethodWithAttributes(params string[] attributeNames)
{
IMethod fakeMethod = MockRepository.GenerateStub<IMethod>();
List<IAttribute> attributes = CreateAttributes(attributeNames);
AddAttributesToMethod(fakeMethod, attributes);
return fakeMethod;
}
void AddAttributesToMethod(IMethod method, List<IAttribute> attributes)
{
method.Stub(m => m.Attributes).Return(attributes);
}
List<TestMember> GetTestMembersFor(IClass fakeClass)
{
return testFramework.GetTestMembersFor(fakeClass).ToList();
}
void AddMethodsToClass(IClass fakeClass, List<IMethod> methods)
{
fakeClass.Stub(c => c.Methods).Return(methods);
}
[Test]
public void IsTestProject_NullProject_ReturnsFalse()
{
bool result = testFramework.IsTestProject(null);
Assert.IsFalse(result);
}
[Test]
public void IsTestProject_ProjectWithMSTestAssemblyReference_ReturnsTrue()
{
AddReferencesToProject("System", "Microsoft.VisualStudio.QualityTools.UnitTestFramework");
bool result = testFramework.IsTestProject(fakeProject);
Assert.IsTrue(result);
}
[Test]
public void IsTestProject_ProjectWithoutMSTestAssemblyReference_ReturnsFalse()
{
NoItemsInProject();
bool result = testFramework.IsTestProject(fakeProject);
Assert.IsFalse(result);
}
[Test]
public void IsTestProject_ProjectWithMSTestAssemblyReferenceInUpperCase_ReturnsTrue()
{
AddReferencesToProject("MICROSOFT.VISUALSTUDIO.QUALITYTOOLS.UNITTESTFRAMEWORK");
bool result = testFramework.IsTestProject(fakeProject);
Assert.IsTrue(result);
}
[Test]
public void IsTestProject_ProjectWithMSTestAssemblyReferenceAndFileProjectItem_ReturnsTrue()
{
AddFileAndReferenceToProject("test.cs", "Microsoft.VisualStudio.QualityTools.UnitTestFramework");
bool result = testFramework.IsTestProject(fakeProject);
Assert.IsTrue(result);
}
[Test]
public void IsTestProject_ProjectWithMSTestAssemblyReferenceUsingFullName_ReturnsTrue()
{
AddReferencesToProject("Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=2.5.3.9345, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77");
bool result = testFramework.IsTestProject(fakeProject);
Assert.IsTrue(result);
}
[Test]
public void IsTestClass_ClassHasNoAttributes_ReturnsFalse()
{
IClass fakeClass = CreateClassWithoutAnyAttributes();
bool result = testFramework.IsTestClass(fakeClass);
Assert.IsFalse(result);
}
[Test]
public void IsTestClass_ClassHasTestFixtureAttributeMissingAttributePart_ReturnsTrue()
{
IClass fakeClass = CreateClassWithAttributes("TestClass");
bool result = testFramework.IsTestClass(fakeClass);
Assert.IsTrue(result);
}
[Test]
public void IsTestClass_ClassHasTestClassAttributeAndIsAbstract_ReturnsFalse()
{
IClass fakeClass = CreateClassWithAttributes("TestClass");
MakeClassAbstract(fakeClass);
bool result = testFramework.IsTestClass(fakeClass);
Assert.IsFalse(result);
}
[Test]
public void IsTestClass_ClassHasTestClassAttributeIncludingAttributePart_ReturnsTrue()
{
IClass fakeClass = CreateClassWithAttributes("TestClassAttribute");
bool result = testFramework.IsTestClass(fakeClass);
Assert.IsTrue(result);
}
[Test]
public void IsTestClass_ClassHasFullyQualifiedMSTestClassAttribute_ReturnsTrue()
{
IClass fakeClass = CreateClassWithAttributes("Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute");
bool result = testFramework.IsTestClass(fakeClass);
Assert.IsTrue(result);
}
[Test]
public void IsTestClass_ClassIsNull_ReturnsFalse()
{
bool result = testFramework.IsTestClass(null);
Assert.IsFalse(result);
}
[Test]
public void IsTestMember_MethodHasNoAttributes_ReturnsFalse()
{
IMethod method = CreateMethodWithoutAnyAttributes();
bool result = testFramework.IsTestMember(method);
Assert.IsFalse(result);
}
[Test]
public void IsTestMember_MethodHasTestMethodAttributeWithoutAttributePart_ReturnsTrue()
{
IMethod method = CreateMethodWithAttributes("TestMethod");
bool result = testFramework.IsTestMember(method);
Assert.IsTrue(result);
}
[Test]
public void IsTestMember_MethodHasTestMethodAttributeAttribute_ReturnsTrue()
{
IMethod method = CreateMethodWithAttributes("TestMethodAttribute");
bool result = testFramework.IsTestMember(method);
Assert.IsTrue(result);
}
[Test]
public void IsTestMember_MethodHasFullyQualifiedMSTestTestMethodAttribute_ReturnsTrue()
{
IMethod method = CreateMethodWithAttributes("Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute");
bool result = testFramework.IsTestMember(method);
Assert.IsTrue(result);
}
[Test]
public void IsTestMember_MethodIsNull_ReturnsFalse()
{
bool result = testFramework.IsTestMember(null);
Assert.IsFalse(result);
}
[Test]
public void IsTestMember_MemberNotMethod_ReturnsFalse()
{
IMember member = MockRepository.GenerateStub<IMember>();
bool result = testFramework.IsTestMember(member);
Assert.IsFalse(result);
}
[Test]
public void GetTestMembersFor_ClassHasNoMethods_ReturnsFalse()
{
IClass fakeClass = CreateClassWithAttributes("TestClass");
AddMethodsToClass(fakeClass, new List<IMethod>());
List<TestMember> testMembers = GetTestMembersFor(fakeClass);
Assert.AreEqual(0, testMembers.Count);
}
[Test]
public void GetTestMembersFor_ClassHasTwoMethodsAndSecondOneIsTestMethod_ReturnsSecondTestMethodOnly()
{
IClass fakeClass = CreateClassWithAttributes("TestClass");
var methods = new List<IMethod>();
methods.Add(CreateMethodWithoutAnyAttributes());
IMethod testMethod = CreateMethodWithAttributes("TestMethod");
methods.Add(testMethod);
AddMethodsToClass(fakeClass, methods);
List<TestMember> testMembers = GetTestMembersFor(fakeClass);
Assert.AreEqual(1, testMembers.Count);
Assert.AreEqual(testMethod, testMembers[0].Member);
}
}
}

184
samples/MSTest/MSTest.SharpDevelop.Tests/MSTestResultsTests.cs

@ -0,0 +1,184 @@ @@ -0,0 +1,184 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using ICSharpCode.MSTest;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.UnitTesting;
using NUnit.Framework;
namespace MSTest.SharpDevelop.Tests
{
[TestFixture]
public class MSTestResultsTests
{
MSTestResults testResults;
void CreateMSTestResults(string xml)
{
using (var reader = new XmlTextReader(new StringReader(xml))) {
testResults = new MSTestResults(reader);
}
}
void AssertTestResultsAreEqual(TestResult[] expectedResults)
{
List<string> expectedResultsAsString = ConvertToStrings(expectedResults);
List<string> actualResultsAsString = ConvertToStrings(testResults);
CollectionAssert.AreEqual(expectedResultsAsString, actualResultsAsString);
}
List<string> ConvertToStrings(IEnumerable<TestResult> results)
{
return results.Select(
result => String.Format(
"Name: {0}, Result: {1}, Message: '{2}', StackTrace: '{3}', StackPosition: {4}",
result.Name,
result.ResultType,
result.Message,
result.StackTrace,
result.StackTraceFilePosition))
.ToList();
}
[Test]
public void Results_OneClassWithTwoPassingTestMethods_ReturnsTwoResults()
{
CreateMSTestResults(oneClassWithTwoPassingTestMethods);
var expectedResults = new TestResult[] {
new TestResult("FooTest.UnitTest1.TestMethod1") {
ResultType = TestResultType.Success
},
new TestResult("FooTest.UnitTest1.TestMethod2") {
ResultType = TestResultType.Success
},
};
AssertTestResultsAreEqual(expectedResults);
}
string oneClassWithTwoPassingTestMethods =
@"<?xml version=""1.0"" encoding=""UTF-8""?>
<TestRun id=""13473da1-70ea-422c-86a5-3b5d04610561"" name=""FEYNMAN 2012-05-06 11:02:13"" runUser=""Feynman\Matt"" xmlns=""http://microsoft.com/schemas/VisualStudio/TeamTest/2010"">
<TestSettings name=""Local"" id=""1af0c4fe-35c7-49e5-b22a-40677255db56"">
<Description>These are default test settings for a local test run.</Description>
<Deployment runDeploymentRoot=""FEYNMAN 2012-05-06 11_02_13"">
<DeploymentItem filename=""T4Scaffolding.Test\ExampleScripts\"" />
</Deployment>
<Execution>
<TestTypeSpecific>
<UnitTestRunConfig testTypeId=""13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"">
<AssemblyResolution>
<TestDirectory useLoadContext=""true"" />
</AssemblyResolution>
</UnitTestRunConfig>
<WebTestRunConfiguration testTypeId=""4e7599fa-5ecb-43e9-a887-cd63cf72d207"">
<Browser name=""Internet Explorer 7.0"">
<Headers>
<Header name=""User-Agent"" value=""Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"" />
<Header name=""Accept"" value=""*/*"" />
<Header name=""Accept-Language"" value=""{{$IEAcceptLanguage}}"" />
<Header name=""Accept-Encoding"" value=""GZIP"" />
</Headers>
</Browser>
</WebTestRunConfiguration>
</TestTypeSpecific>
<AgentRule name=""LocalMachineDefaultRole"">
</AgentRule>
</Execution>
</TestSettings>
<Times creation=""2012-05-06T11:02:13.0655060+01:00"" queuing=""2012-05-06T11:02:16.0845060+01:00"" start=""2012-05-06T11:02:16.4355060+01:00"" finish=""2012-05-06T11:02:17.8915060+01:00"" />
<ResultSummary outcome=""Completed"">
<Counters total=""2"" executed=""2"" passed=""2"" error=""0"" failed=""0"" timeout=""0"" aborted=""0"" inconclusive=""0"" passedButRunAborted=""0"" notRunnable=""0"" notExecuted=""0"" disconnected=""0"" warning=""0"" completed=""0"" inProgress=""0"" pending=""0"" />
</ResultSummary>
<TestDefinitions>
<UnitTest name=""TestMethod2"" storage=""d:\temp\test\mvcscaffolding_31fa7ea49b52\footest\bin\debug\footest.dll"" id=""760d70dc-fcd4-bd05-26dd-50b565053466"">
<Execution id=""4d09aff0-ba01-4c01-9c3c-dd6475e89ef2"" />
<TestMethod codeBase=""D:/projects/FooTest/bin/Debug/FooTest.DLL"" adapterTypeName=""Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" className=""FooTest.UnitTest1, FooTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"" name=""TestMethod2"" />
</UnitTest>
<UnitTest name=""TestMethod1"" storage=""d:\temp\test\mvcscaffolding_31fa7ea49b52\footest\bin\debug\footest.dll"" id=""752967dd-f45f-65ac-ca4a-dcd30f56a25a"">
<Execution id=""ba931d00-d381-43c3-b0f9-f4cf37015438"" />
<TestMethod codeBase=""D:/projects/FooTest/bin/Debug/FooTest.DLL"" adapterTypeName=""Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" className=""FooTest.UnitTest1, FooTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"" name=""TestMethod1"" />
</UnitTest>
</TestDefinitions>
<TestLists>
<TestList name=""Results Not in a List"" id=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" />
<TestList name=""All Loaded Results"" id=""19431567-8539-422a-85d7-44ee4e166bda"" />
</TestLists>
<TestEntries>
<TestEntry testId=""752967dd-f45f-65ac-ca4a-dcd30f56a25a"" executionId=""ba931d00-d381-43c3-b0f9-f4cf37015438"" testListId=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" />
<TestEntry testId=""760d70dc-fcd4-bd05-26dd-50b565053466"" executionId=""4d09aff0-ba01-4c01-9c3c-dd6475e89ef2"" testListId=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" />
</TestEntries>
<Results>
<UnitTestResult executionId=""ba931d00-d381-43c3-b0f9-f4cf37015438"" testId=""752967dd-f45f-65ac-ca4a-dcd30f56a25a"" testName=""TestMethod1"" computerName=""FEYNMAN"" duration=""00:00:00.0501283"" startTime=""2012-05-06T11:02:16.5755060+01:00"" endTime=""2012-05-06T11:02:17.7465060+01:00"" testType=""13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"" outcome=""Passed"" testListId=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" relativeResultsDirectory=""ba931d00-d381-43c3-b0f9-f4cf37015438"">
</UnitTestResult>
<UnitTestResult executionId=""4d09aff0-ba01-4c01-9c3c-dd6475e89ef2"" testId=""760d70dc-fcd4-bd05-26dd-50b565053466"" testName=""TestMethod2"" computerName=""FEYNMAN"" duration=""00:00:00.0018331"" startTime=""2012-05-06T11:02:17.7655060+01:00"" endTime=""2012-05-06T11:02:17.7785060+01:00"" testType=""13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"" outcome=""Passed"" testListId=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" relativeResultsDirectory=""4d09aff0-ba01-4c01-9c3c-dd6475e89ef2"">
</UnitTestResult>
</Results>
</TestRun>";
[Test]
public void Results_OneTestMethodThrowsException_ReturnsOneErrorResultWithStackTrace()
{
CreateMSTestResults(oneTestMethodThrowsException);
var expectedResults = new TestResult[] {
new TestResult("FooTest.UnitTest1.TestMethod1") {
ResultType = TestResultType.Failure,
Message = "System.ApplicationException: asdfafds",
StackTrace = " at FooTest.UnitTest1.TestMethod1() in d:\\projects\\FooTest\\UnitTest1.cs:line 21\r\n",
StackTraceFilePosition = new FilePosition(@"d:\projects\FooTest\UnitTest1.cs", 21, 1)
}
};
AssertTestResultsAreEqual(expectedResults);
}
string oneTestMethodThrowsException =
@"<?xml version=""1.0"" encoding=""UTF-8""?>
<TestRun id=""7c0b0a20-13c6-4c28-b74c-e29c271f2ec4"" name=""FEYNMAN 2012-05-06 13:07:05"" runUser=""Feynman\Matt"" xmlns=""http://microsoft.com/schemas/VisualStudio/TeamTest/2010"">
<TestSettings name=""Default Test Settings"" id=""03cf0958-a7e3-4b25-b98b-435f01359ee1"">
<Execution>
<TestTypeSpecific />
<AgentRule name=""Execution Agents"">
</AgentRule>
</Execution>
<Deployment runDeploymentRoot=""FEYNMAN 2012-05-06 13_07_05"" />
</TestSettings>
<Times creation=""2012-05-06T13:07:05.9187060+01:00"" queuing=""2012-05-06T13:07:06.6519060+01:00"" start=""2012-05-06T13:07:06.8235060+01:00"" finish=""2012-05-06T13:07:08.0403060+01:00"" />
<ResultSummary outcome=""Failed"">
<Counters total=""1"" executed=""1"" passed=""0"" error=""0"" failed=""1"" timeout=""0"" aborted=""0"" inconclusive=""0"" passedButRunAborted=""0"" notRunnable=""0"" notExecuted=""0"" disconnected=""0"" warning=""0"" completed=""0"" inProgress=""0"" pending=""0"" />
</ResultSummary>
<TestDefinitions>
<UnitTest name=""TestMethod1"" storage=""d:\projects\footest\bin\debug\footest.dll"" id=""752967dd-f45f-65ac-ca4a-dcd30f56a25a"">
<Execution id=""c147e8ae-7ee7-4f28-9db3-a708e350c68d"" />
<TestMethod codeBase=""D:/projects/FooTest/bin/Debug/FooTest.DLL"" adapterTypeName=""Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" className=""FooTest.UnitTest1, FooTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"" name=""TestMethod1"" />
</UnitTest>
</TestDefinitions>
<TestLists>
<TestList name=""Results Not in a List"" id=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" />
<TestList name=""All Loaded Results"" id=""19431567-8539-422a-85d7-44ee4e166bda"" />
</TestLists>
<TestEntries>
<TestEntry testId=""752967dd-f45f-65ac-ca4a-dcd30f56a25a"" executionId=""c147e8ae-7ee7-4f28-9db3-a708e350c68d"" testListId=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" />
</TestEntries>
<Results>
<UnitTestResult executionId=""c147e8ae-7ee7-4f28-9db3-a708e350c68d"" testId=""752967dd-f45f-65ac-ca4a-dcd30f56a25a"" testName=""TestMethod1"" computerName=""FEYNMAN"" duration=""00:00:00.0404760"" startTime=""2012-05-06T13:07:06.9015060+01:00"" endTime=""2012-05-06T13:07:07.8375060+01:00"" testType=""13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"" outcome=""Failed"" testListId=""8c84fa94-04c1-424b-9868-57a2d4851a1d"" relativeResultsDirectory=""c147e8ae-7ee7-4f28-9db3-a708e350c68d"">
<Output>
<ErrorInfo>
<Message>Test method FooTest.UnitTest1.TestMethod1 threw exception:
System.ApplicationException: asdfafds</Message>
<StackTrace> at FooTest.UnitTest1.TestMethod1() in d:\projects\FooTest\UnitTest1.cs:line 21
</StackTrace>
</ErrorInfo>
</Output>
</UnitTestResult>
</Results>
</TestRun>";
}
}

31
samples/MSTest/MSTest.SharpDevelop.Tests/Properties/AssemblyInfo.cs

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
#region Using directives
using System;
using System.Reflection;
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("MSTest.SharpDevelop.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MSTest.SharpDevelop.Tests")]
[assembly: AssemblyCopyright("Copyright 2012")]
[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("1.0.0")]

24
samples/MSTest/MSTest.SharpDevelop.sln

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.2.0.8749-Beta 2
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTest.SharpDevelop", "MSTest.SharpDevelop\MSTest.SharpDevelop.csproj", "{8DF3A610-47F9-4448-B455-952BD57CB5CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTest.SharpDevelop.Tests", "MSTest.SharpDevelop.Tests\MSTest.SharpDevelop.Tests.csproj", "{51D56190-67B7-4A49-BA0A-24010460CCC6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8DF3A610-47F9-4448-B455-952BD57CB5CC}.Debug|x86.Build.0 = Debug|x86
{8DF3A610-47F9-4448-B455-952BD57CB5CC}.Debug|x86.ActiveCfg = Debug|x86
{8DF3A610-47F9-4448-B455-952BD57CB5CC}.Release|x86.Build.0 = Release|x86
{8DF3A610-47F9-4448-B455-952BD57CB5CC}.Release|x86.ActiveCfg = Release|x86
{51D56190-67B7-4A49-BA0A-24010460CCC6}.Debug|x86.Build.0 = Debug|x86
{51D56190-67B7-4A49-BA0A-24010460CCC6}.Debug|x86.ActiveCfg = Debug|x86
{51D56190-67B7-4A49-BA0A-24010460CCC6}.Release|x86.Build.0 = Release|x86
{51D56190-67B7-4A49-BA0A-24010460CCC6}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
EndGlobal

103
samples/MSTest/MSTest.SharpDevelop/MSTest.SharpDevelop.csproj

@ -0,0 +1,103 @@ @@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectGuid>{8DF3A610-47F9-4448-B455-952BD57CB5CC}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Library</OutputType>
<RootNamespace>ICSharpCode.MSTest</RootNamespace>
<AssemblyName>MSTest.SharpDevelop</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<OutputPath>..\..\..\AddIns\Samples\MSTest</OutputPath>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.Core">
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.Core.Presentation">
<HintPath>..\..\..\bin\ICSharpCode.Core.Presentation.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Dom">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Widgets">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Widgets.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="UnitTesting">
<HintPath>..\..\..\AddIns\Analysis\UnitTesting\UnitTesting.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="MSTestApplication.cs" />
<Compile Include="MSTestApplicationCommandLine.cs" />
<Compile Include="MSTestDebugger.cs" />
<Compile Include="MSTestFramework.cs" />
<Compile Include="MSTestOptions.cs" />
<Compile Include="MSTestOptionsPanel.xaml.cs">
<DependentUpon>MSTestOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MSTestQualifiedClassName.cs" />
<Compile Include="MSTestResult.cs" />
<Compile Include="MSTestResults.cs" />
<Compile Include="MSTestResultsFileName.cs" />
<Compile Include="MSTestRunner.cs" />
<Compile Include="ProjectItemExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="MSTest.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="MSTestOptionsPanel.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

30
samples/MSTest/MSTest.SharpDevelop/MSTest.addin

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
<AddIn
name="MSTest"
author="Matt Ward"
copyright="prj:///doc/copyright.txt"
description="MSTest support">
<Manifest>
<Identity name="ICSharpCode.MSTest"/>
</Manifest>
<Runtime>
<Import assembly=":ICSharpCode.SharpDevelop"/>
<Import assembly="$ICSharpCode.UnitTesting/UnitTesting.dll"/>
<Import assembly="MSTest.SharpDevelop.dll"/>
</Runtime>
<Path name="/SharpDevelop/UnitTesting/TestFrameworks">
<TestFramework
id="mstest"
class="ICSharpCode.MSTest.MSTestFramework"
supportedProjects=".csproj"/>
</Path>
<Path name="/SharpDevelop/Dialogs/OptionsDialog/ToolsOptions">
<OptionPanel
id="MSTestOptionsPanel"
label="MS Test"
class="ICSharpCode.MSTest.MSTestOptionsPanel"/>
</Path>
</AddIn>

46
samples/MSTest/MSTest.SharpDevelop/MSTestApplication.cs

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestApplication
{
SelectedTests selectedTests;
string resultsFileName;
public MSTestApplication(SelectedTests selectedTests, string resultsFileName)
{
this.selectedTests = selectedTests;
this.resultsFileName = resultsFileName;
GetProcessStartInfo();
}
void GetProcessStartInfo()
{
ProcessStartInfo = new ProcessStartInfo(MSTestOptions.MSTestPath, GetCommandLine());
}
string GetCommandLine()
{
var commandLine = new MSTestApplicationCommandLine();
commandLine.AppendQuoted("testcontainer", selectedTests.Project.OutputAssemblyFullPath);
commandLine.AppendQuoted("resultsfile", resultsFileName);
commandLine.Append("detail", "errorstacktrace");
if (selectedTests.NamespaceFilter != null) {
commandLine.Append("test", selectedTests.NamespaceFilter);
} else if (selectedTests.Member != null) {
commandLine.Append("test", selectedTests.Member.FullyQualifiedName);
} else if (selectedTests.Class != null) {
commandLine.Append("test", selectedTests.Class.FullyQualifiedName);
}
return commandLine.ToString();
}
public ProcessStartInfo ProcessStartInfo { get; private set; }
}
}

37
samples/MSTest/MSTest.SharpDevelop/MSTestApplicationCommandLine.cs

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Text;
namespace ICSharpCode.MSTest
{
public class MSTestApplicationCommandLine
{
StringBuilder commandLine = new StringBuilder();
public MSTestApplicationCommandLine()
{
}
public void Append(string argument, string value)
{
AppendFormat("/{0}:{1} ", argument, value);
}
public void AppendQuoted(string argument, string value)
{
AppendFormat("/{0}:\"{1}\" ", argument, value);
}
void AppendFormat(string format, string argument, string value)
{
commandLine.AppendFormat(format, argument, value);
}
public override string ToString()
{
return commandLine.ToString();
}
}
}

134
samples/MSTest/MSTest.SharpDevelop/MSTestDebugger.cs

@ -0,0 +1,134 @@ @@ -0,0 +1,134 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
using System.IO;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestDebugger : TestRunnerBase
{
IUnitTestDebuggerService debuggerService;
IUnitTestMessageService messageService;
IDebugger debugger;
string resultsFileName;
public MSTestDebugger()
: this(
new UnitTestDebuggerService(),
new UnitTestMessageService())
{
}
public MSTestDebugger(
IUnitTestDebuggerService debuggerService,
IUnitTestMessageService messageService)
{
this.debuggerService = debuggerService;
this.messageService = messageService;
this.debugger = debuggerService.CurrentDebugger;
}
public override void Start(SelectedTests selectedTests)
{
ProcessStartInfo startInfo = GetProcessStartInfo(selectedTests);
if (IsDebuggerRunning) {
if (CanStopDebugging()) {
debugger.Stop();
Start(startInfo);
}
} else {
Start(startInfo);
}
}
protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests)
{
resultsFileName = new MSTestResultsFileName(selectedTests).FileName;
CreateDirectoryForResultsFile();
var mstestApplication = new MSTestApplication(selectedTests, resultsFileName);
return mstestApplication.ProcessStartInfo;
}
public bool IsDebuggerRunning {
get { return debuggerService.IsDebuggerLoaded && debugger.IsDebugging; }
}
bool CanStopDebugging()
{
string question = "${res:XML.MainMenu.RunMenu.Compile.StopDebuggingQuestion}";
string caption = "${res:XML.MainMenu.RunMenu.Compile.StopDebuggingTitle}";
return messageService.AskQuestion(question, caption);
}
void CreateDirectoryForResultsFile()
{
string path = Path.GetDirectoryName(resultsFileName);
if (!Directory.Exists(path)) {
Directory.CreateDirectory(path);
}
}
void Start(ProcessStartInfo startInfo)
{
StartDebugger(startInfo);
}
void StartDebugger(ProcessStartInfo startInfo)
{
LogCommandLine(startInfo);
bool running = false;
debugger.DebugStopped += DebugStopped;
try {
debugger.Start(startInfo);
running = true;
} finally {
if (!running) {
debugger.DebugStopped -= DebugStopped;
}
}
}
void DebugStopped(object source, EventArgs e)
{
debugger.DebugStopped -= DebugStopped;
if (File.Exists(resultsFileName)) {
var testResults = new MSTestResults(resultsFileName);
var workbench = new UnitTestWorkbench();
workbench.SafeThreadAsyncCall(() => UpdateTestResults(testResults));
} else {
messageService.ShowFormattedErrorMessage("Unable to find test results file: '{0}'.", resultsFileName);
OnAllTestsFinished(source, e);
}
}
void UpdateTestResults(MSTestResults testResults)
{
foreach (TestResult result in testResults) {
OnTestFinished(this, new TestFinishedEventArgs(result));
}
OnAllTestsFinished(this, new EventArgs());
}
public override void Stop()
{
if (debugger.IsDebugging) {
debugger.Stop();
}
}
public override void Dispose()
{
Stop();
try {
File.Delete(resultsFileName);
} catch { }
}
}
}

109
samples/MSTest/MSTest.SharpDevelop/MSTestFramework.cs

@ -0,0 +1,109 @@ @@ -0,0 +1,109 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestFramework : ITestFramework
{
public bool IsBuildNeededBeforeTestRun {
get { return true; }
}
public bool IsTestMember(IMember member)
{
var method = member as IMethod;
if (method == null)
return false;
return IsTestMethod(method);
}
bool IsTestMethod(IMethod method)
{
foreach (IAttribute attribute in method.Attributes) {
if (IsMSTestMethodAttribute(attribute)) {
return true;
}
}
return false;
}
bool IsMSTestMethodAttribute(IAttribute attribute)
{
return IsMSTestMethodAttribute(attribute.AttributeType.FullyQualifiedName);
}
bool IsMSTestMethodAttribute(string name)
{
return
name == "TestMethod" ||
name == "TestMethodAttribute" ||
name == "Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute";
}
public bool IsTestClass(IClass c)
{
if ((c == null) || (c.IsAbstract))
return false;
foreach (IAttribute attribute in c.Attributes) {
if (IsMSTestClassAttribute(attribute)) {
return true;
}
}
return false;
}
bool IsMSTestClassAttribute(IAttribute attribute)
{
return IsMSTestClassAttribute(attribute.AttributeType.FullyQualifiedName);
}
bool IsMSTestClassAttribute(string name)
{
return
name == "TestClass" ||
name == "TestClassAttribute" ||
name == "Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute";
}
public bool IsTestProject(IProject project)
{
if (project == null)
return false;
foreach (ProjectItem item in project.Items) {
if (item.IsMSTestAssemblyReference()) {
return true;
}
}
return false;
}
public IEnumerable<TestMember> GetTestMembersFor(IClass c)
{
return c.Methods
.Where(IsTestMethod)
.Select(method => new TestMember(method));
}
public ITestRunner CreateTestRunner()
{
return new MSTestRunner();
}
public ITestRunner CreateTestDebugger()
{
return new MSTestDebugger();
}
}
}

26
samples/MSTest/MSTest.SharpDevelop/MSTestOptions.cs

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.Core;
namespace ICSharpCode.MSTest
{
public static class MSTestOptions
{
static Properties properties = PropertyService.Get("MSTestOptions", new Properties());
public static string MSTestPath {
get { return properties.Get<string>("MSTestPath", GetDefaultMSTestPath()); }
set { properties.Set("MSTestPath", value); }
}
static string GetDefaultMSTestPath()
{
return Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
@"Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe");
}
}
}

32
samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
<gui:OptionPanel
x:Class="ICSharpCode.MSTest.MSTestOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels">
<StackPanel>
<GroupBox Header="MS Test">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Content="Path:"/>
<TextBox
Grid.Column="1"
Text="{Binding MSTestPath}"/>
<Button
Grid.Column="2"
Content="..."
Command="{Binding BrowseCommand}"
Padding="4, 0"
Margin="4,0"/>
</Grid>
</GroupBox>
</StackPanel>
</gui:OptionPanel>

64
samples/MSTest/MSTest.SharpDevelop/MSTestOptionsPanel.xaml.cs

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Input;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Widgets;
using Microsoft.Win32;
namespace ICSharpCode.MSTest
{
public partial class MSTestOptionsPanel : OptionPanel, INotifyPropertyChanged
{
string msTestPath;
bool changed;
public MSTestOptionsPanel()
{
InitializeComponent();
BrowseCommand = new RelayCommand(Browse);
msTestPath = MSTestOptions.MSTestPath;
DataContext = this;
}
public ICommand BrowseCommand { get; private set; }
void Browse()
{
var dialog = new OpenFileDialog();
if (dialog.ShowDialog() ?? false) {
MSTestPath = dialog.FileName;
}
}
public string MSTestPath {
get { return msTestPath; }
set {
msTestPath = value;
changed = true;
OnPropertyChanged("MSTestPath");
}
}
public override bool SaveOptions()
{
if (changed) {
MSTestOptions.MSTestPath = msTestPath;
}
return true;
}
public event PropertyChangedEventHandler PropertyChanged;
void OnPropertyChanged(string name)
{
if (PropertyChanged != null) {
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}
}

31
samples/MSTest/MSTest.SharpDevelop/MSTestQualifiedClassName.cs

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.MSTest
{
public class MSTestQualifiedClassName
{
public MSTestQualifiedClassName(string qualifiedClassName)
{
ClassName = GetClassName(qualifiedClassName);
}
string GetClassName(string qualifiedClassName)
{
int index = qualifiedClassName.IndexOf(',');
if (index > 0) {
return qualifiedClassName.Substring(0, index);
}
return qualifiedClassName;
}
public string ClassName { get; private set; }
public string GetQualifiedMethodName(string methodName)
{
return String.Format("{0}.{1}", ClassName, methodName);
}
}
}

93
samples/MSTest/MSTest.SharpDevelop/MSTestResult.cs

@ -0,0 +1,93 @@ @@ -0,0 +1,93 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestResult
{
public MSTestResult(string id)
{
this.Id = id;
}
public string Id { get; private set; }
public string Name { get; private set; }
public TestResultType ResultType { get; private set; }
public string StackTrace { get; set; }
public string Message { get; set; }
public void UpdateTestName(string qualifiedClassName, string methodName)
{
UpdateTestName(new MSTestQualifiedClassName(qualifiedClassName), methodName);
}
public void UpdateTestName(MSTestQualifiedClassName qualifiedClassName, string methodName)
{
this.Name = qualifiedClassName.GetQualifiedMethodName(methodName);
}
public void UpdateResult(string result)
{
if (result == "Passed") {
this.ResultType = TestResultType.Success;
} else if (result == "Failed") {
this.ResultType = TestResultType.Failure;
}
}
public bool IsError {
get { return ResultType == TestResultType.Failure; }
}
public TestResult ToTestResult()
{
return new TestResult(Name) {
ResultType = ResultType,
Message = GetMessage(),
StackTrace = StackTrace,
StackTraceFilePosition = GetStackTraceFilePosition()
};
}
string GetMessage()
{
if (String.IsNullOrEmpty(Message))
return String.Empty;
int index = Message.IndexOf('\n');
if (index > 0) {
return Message.Substring(index + 1);
}
return Message;
}
FilePosition GetStackTraceFilePosition()
{
if (!String.IsNullOrEmpty(StackTrace)) {
return ParseFilePositionFromStackTrace();
}
return FilePosition.Empty;
}
FilePosition ParseFilePositionFromStackTrace()
{
FileLineReference fileLineRef = OutputTextLineParser.GetNUnitOutputFileLineReference(StackTrace, true);
if (fileLineRef != null) {
return CreateFilePosition(fileLineRef);
}
return FilePosition.Empty;
}
FilePosition CreateFilePosition(FileLineReference fileLineRef)
{
string fileName = Path.GetFullPath(fileLineRef.FileName);
return new FilePosition(fileName, fileLineRef.Line, fileLineRef.Column + 1);
}
}
}

91
samples/MSTest/MSTest.SharpDevelop/MSTestResults.cs

@ -0,0 +1,91 @@ @@ -0,0 +1,91 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Xml;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestResults : List<TestResult>
{
Dictionary<string, MSTestResult> testDefinitions = new Dictionary<string, MSTestResult>();
public MSTestResults(string fileName)
: this(new XmlTextReader(fileName))
{
}
public MSTestResults(XmlTextReader reader)
{
ReadResults(reader);
}
void ReadResults(XmlTextReader reader)
{
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.Element:
if (reader.Name == "UnitTest") {
ReadUnitTest(reader);
} else if (reader.Name == "UnitTestResult") {
ReadUnitTestResult(reader);
}
break;
}
}
}
void ReadUnitTest(XmlTextReader reader)
{
var testResult = new MSTestResult(reader.GetAttribute("id"));
testDefinitions.Add(testResult.Id, testResult);
if (reader.ReadToDescendant("TestMethod")) {
testResult.UpdateTestName(reader.GetAttribute("className"), reader.GetAttribute("name"));
}
}
void ReadUnitTestResult(XmlTextReader reader)
{
string testId = reader.GetAttribute("testId");
MSTestResult testResult = FindTestResult(testId);
if (testResult != null) {
testResult.UpdateResult(reader.GetAttribute("outcome"));
if (testResult.IsError) {
ReadErrorInformation(testResult, reader);
}
Add(testResult.ToTestResult());
}
}
void ReadErrorInformation(MSTestResult testResult, XmlTextReader reader)
{
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.EndElement:
if (reader.Name == "UnitTestResult") {
return;
}
break;
case XmlNodeType.Element:
if (reader.Name == "Message") {
testResult.Message = reader.ReadElementContentAsString();
} else if (reader.Name == "StackTrace") {
testResult.StackTrace = reader.ReadElementContentAsString();
}
break;
}
}
}
MSTestResult FindTestResult(string testId)
{
MSTestResult testResult = null;
testDefinitions.TryGetValue(testId, out testResult);
return testResult;
}
}
}

27
samples/MSTest/MSTest.SharpDevelop/MSTestResultsFileName.cs

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestResultsFileName
{
public MSTestResultsFileName(SelectedTests selectedTests)
{
FileName = GetFileName(selectedTests);
}
public string FileName { get; private set; }
string GetFileName(SelectedTests selectedTests)
{
return Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Temp",
selectedTests.Project.Name + "-Results.trx");
}
}
}

138
samples/MSTest/MSTest.SharpDevelop/MSTestRunner.cs

@ -0,0 +1,138 @@ @@ -0,0 +1,138 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
using System.IO;
using ICSharpCode.SharpDevelop.Util;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.MSTest
{
public class MSTestRunner : TestRunnerBase
{
IUnitTestProcessRunner processRunner;
IFileSystem fileSystem;
IUnitTestMessageService messageService;
string resultsFileName;
public MSTestRunner()
: this(new UnitTestProcessRunner(),
new UnitTestFileService(),
new UnitTestMessageService())
{
}
public MSTestRunner(
IUnitTestProcessRunner processRunner,
IFileSystem fileSystem,
IUnitTestMessageService messageService)
{
this.processRunner = processRunner;
this.fileSystem = fileSystem;
this.messageService = messageService;
processRunner.LogStandardOutputAndError = false;
processRunner.OutputLineReceived += OutputLineReceived;
processRunner.ErrorLineReceived += OutputLineReceived;
processRunner.ProcessExited += ProcessRunnerExited;
}
void ProcessRunnerExited(object source, EventArgs e)
{
// Read all tests.
if (FileExists(resultsFileName)) {
var testResults = new MSTestResults(resultsFileName);
var workbench = new UnitTestWorkbench();
workbench.SafeThreadAsyncCall(() => UpdateTestResults(testResults));
} else {
messageService.ShowFormattedErrorMessage("Unable to find test results file: '{0}'.", resultsFileName);
OnAllTestsFinished(source, e);
}
}
void UpdateTestResults(MSTestResults testResults)
{
foreach (TestResult result in testResults) {
OnTestFinished(this, new TestFinishedEventArgs(result));
}
OnAllTestsFinished(this, new EventArgs());
}
void OutputLineReceived(object source, LineReceivedEventArgs e)
{
OnMessageReceived(e.Line);
}
public override void Start(SelectedTests selectedTests)
{
ProcessStartInfo startInfo = GetProcessStartInfo(selectedTests);
TryDeleteResultsFile();
Start(startInfo);
}
protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests)
{
resultsFileName = new MSTestResultsFileName(selectedTests).FileName;
CreateDirectoryForResultsFile();
var mstestApplication = new MSTestApplication(selectedTests, resultsFileName);
return mstestApplication.ProcessStartInfo;
}
void Start(ProcessStartInfo processStartInfo)
{
LogCommandLine(processStartInfo);
if (FileExists(processStartInfo.FileName)) {
processRunner.WorkingDirectory = processStartInfo.WorkingDirectory;
processRunner.Start(processStartInfo.FileName, processStartInfo.Arguments);
} else {
ShowApplicationDoesNotExistMessage(processStartInfo.FileName);
}
}
void CreateDirectoryForResultsFile()
{
string path = Path.GetDirectoryName(resultsFileName);
if (!Directory.Exists(path)) {
Directory.CreateDirectory(path);
}
}
bool FileExists(string fileName)
{
return fileSystem.FileExists(fileName);
}
void ShowApplicationDoesNotExistMessage(string fileName)
{
string resourceString = "${res:ICSharpCode.UnitTesting.TestRunnerNotFoundMessageFormat}";
messageService.ShowFormattedErrorMessage(resourceString, fileName);
}
public override void Stop()
{
processRunner.Kill();
}
public override void Dispose()
{
processRunner.ErrorLineReceived -= OutputLineReceived;
processRunner.OutputLineReceived -= OutputLineReceived;
processRunner.ProcessExited -= ProcessRunnerExited;
TryDeleteResultsFile();
}
void TryDeleteResultsFile()
{
try {
Console.WriteLine("Deleting results file: " + resultsFileName);
File.Delete(resultsFileName);
} catch (Exception ex) {
Console.WriteLine(ex.Message);
}
}
}
}

28
samples/MSTest/MSTest.SharpDevelop/ProjectItemExtensions.cs

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.MSTest
{
public static class ProjectItemExtensions
{
public static bool IsMSTestAssemblyReference(this ProjectItem item)
{
var referenceItem = item as ReferenceProjectItem;
if (referenceItem == null)
return false;
return IsMSTestAssemblyReference(referenceItem);
}
public static bool IsMSTestAssemblyReference(this ReferenceProjectItem item)
{
return String.Equals(
item.ShortName,
"Microsoft.VisualStudio.QualityTools.UnitTestFramework",
StringComparison.OrdinalIgnoreCase);
}
}
}

31
samples/MSTest/MSTest.SharpDevelop/Properties/AssemblyInfo.cs

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
#region Using directives
using System;
using System.Reflection;
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("MSTest.SharpDevelop")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MSTest.SharpDevelop")]
[assembly: AssemblyCopyright("Copyright 2012")]
[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("1.0.0")]

4
src/AddIns/Analysis/CodeCoverage/Test/Testing/CodeCoverageTestRunnerTests.cs

@ -118,7 +118,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing @@ -118,7 +118,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
string expectedCommandLine =
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /results=\\\"d:\\temp\\results.txt\\\"\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml /results=\\\"d:\\temp\\results.txt\\\"\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [MyTests]*";
@ -218,7 +218,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing @@ -218,7 +218,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
"\"d:\\sharpdevelop\\bin\\Tools\\PartCover\\PartCover.exe\" " +
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\"\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [*]*";
}

4
src/AddIns/Analysis/CodeCoverage/Test/Testing/PartCoverApplicationTests.cs

@ -133,7 +133,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing @@ -133,7 +133,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
string expectedCommandLine =
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\"\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [*]*";
@ -157,7 +157,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing @@ -157,7 +157,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
string expectedCommandLine =
"--target \"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"--target-work-dir \"c:\\projects\\MyTests\\bin\\Debug\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\"\" " +
"--target-args \"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"--output \"c:\\projects\\MyTests\\PartCover\\coverage.xml\" " +
"--include [MyTests]* " +
"--include [MoreTests]* " +

10
src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleCommandLine.cs → src/AddIns/Analysis/UnitTesting/Src/NUnitConsoleApplication.cs

@ -51,6 +51,7 @@ namespace ICSharpCode.UnitTesting @@ -51,6 +51,7 @@ namespace ICSharpCode.UnitTesting
NoDots = options.NoDots;
Labels = options.Labels;
ShadowCopy = !options.NoShadow;
NoXmlOutputFile = !options.CreateXmlOutputFile;
if (options.CreateXmlOutputFile) {
GenerateXmlOutputFileName();
@ -121,6 +122,11 @@ namespace ICSharpCode.UnitTesting @@ -121,6 +122,11 @@ namespace ICSharpCode.UnitTesting
/// </summary>
public string XmlOutputFile;
/// <summary>
/// Use /noxml.
/// </summary>
public bool NoXmlOutputFile = true;
/// <summary>
/// Fixture to test. Null = test all fixtures.
/// </summary>
@ -195,7 +201,9 @@ namespace ICSharpCode.UnitTesting @@ -195,7 +201,9 @@ namespace ICSharpCode.UnitTesting
b.Append(" /labels");
if (NoDots)
b.Append(" /nodots");
if (XmlOutputFile != null) {
if (NoXmlOutputFile) {
b.Append(" /noxml");
} else if (XmlOutputFile != null) {
b.Append(" /xml=\"");
b.Append(XmlOutputFile);
b.Append('"');

29
src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleCommandLineTests.cs

@ -32,6 +32,7 @@ namespace UnitTesting.Tests.Frameworks @@ -32,6 +32,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
app.NoXmlOutputFile = false;
app.Results = @"C:\results.txt";
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /results=\"C:\\results.txt\"";
@ -45,6 +46,7 @@ namespace UnitTesting.Tests.Frameworks @@ -45,6 +46,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = true;
app.ShadowCopy = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /nologo";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -57,6 +59,7 @@ namespace UnitTesting.Tests.Frameworks @@ -57,6 +59,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = false;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /noshadow";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -70,6 +73,7 @@ namespace UnitTesting.Tests.Frameworks @@ -70,6 +73,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.NoThread = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /nothread";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -83,6 +87,7 @@ namespace UnitTesting.Tests.Frameworks @@ -83,6 +87,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.NoDots = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /nodots";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -96,6 +101,7 @@ namespace UnitTesting.Tests.Frameworks @@ -96,6 +101,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.Labels = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /labels";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -109,6 +115,7 @@ namespace UnitTesting.Tests.Frameworks @@ -109,6 +115,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.Fixture = "TestFixture";
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -122,6 +129,7 @@ namespace UnitTesting.Tests.Frameworks @@ -122,6 +129,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.NamespaceFilter = "TestFixture";
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -135,11 +143,26 @@ namespace UnitTesting.Tests.Frameworks @@ -135,11 +143,26 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.XmlOutputFile = @"C:\NUnit.xml";
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /xml=\"C:\\NUnit.xml\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
}
[Test]
public void NoXmlWhenXmlOutputFileSpecified()
{
SelectedTests selectedTests = new SelectedTests(project);
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
app.XmlOutputFile = @"C:\NUnit.xml";
app.NoXmlOutputFile = true;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /noxml";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
}
[Test]
public void TestMethod()
{
@ -149,6 +172,7 @@ namespace UnitTesting.Tests.Frameworks @@ -149,6 +172,7 @@ namespace UnitTesting.Tests.Frameworks
app.ShadowCopy = true;
app.Fixture = "TestFixture";
app.Test = "Test";
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture.Test\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -163,6 +187,7 @@ namespace UnitTesting.Tests.Frameworks @@ -163,6 +187,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"TestFixture.Test\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -175,6 +200,7 @@ namespace UnitTesting.Tests.Frameworks @@ -175,6 +200,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"Project.MyTests\"";
Assert.AreEqual(expectedCommandLine, app.GetArguments());
@ -187,6 +213,7 @@ namespace UnitTesting.Tests.Frameworks @@ -187,6 +213,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = true;
app.ShadowCopy = true;
app.NoXmlOutputFile = false;
FileUtility.ApplicationRootPath = @"C:\SharpDevelop";
@ -211,6 +238,7 @@ namespace UnitTesting.Tests.Frameworks @@ -211,6 +238,7 @@ namespace UnitTesting.Tests.Frameworks
app.NoLogo = false;
app.ShadowCopy = true;
app.Results = @"C:\results.txt";
app.NoXmlOutputFile = false;
string expectedCommandLine =
"\"C:\\Projects\\MyTests\\MyTests.dll\" " +
@ -235,6 +263,7 @@ namespace UnitTesting.Tests.Frameworks @@ -235,6 +263,7 @@ namespace UnitTesting.Tests.Frameworks
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests);
app.NoLogo = false;
app.ShadowCopy = true;
app.NoXmlOutputFile = false;
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" " +
"/run=\"MyTests.TestFixture+InnerTest\"";

2
src/AddIns/Analysis/UnitTesting/Test/Frameworks/NUnitConsoleProcessStartInfoTestFixture.cs

@ -50,7 +50,7 @@ namespace UnitTesting.Tests.Frameworks @@ -50,7 +50,7 @@ namespace UnitTesting.Tests.Frameworks
public void CommandLineArgumentsAreNUnitConsoleExeCommandLineArguments()
{
string expectedCommandLine =
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"";
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml";
Assert.AreEqual(expectedCommandLine, info.Arguments);
}

2
src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsForMethodTestFixture.cs

@ -173,7 +173,7 @@ namespace UnitTesting.Tests.Tree @@ -173,7 +173,7 @@ namespace UnitTesting.Tests.Tree
StartNUnitTestRunner();
string expectedArgs =
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" " +
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml " +
"/results=\"c:\\temp\\tmp66.tmp\" " +
"/run=\"MyTests.MyTestClass.MyTestMethod\"";
Assert.AreEqual(expectedArgs, context.MockProcessRunner.CommandArgumentsPassedToStartMethod);

4
src/AddIns/Analysis/UnitTesting/Test/Tree/RunNUnitTestsWithDebuggerTestFixture.cs

@ -57,7 +57,7 @@ namespace UnitTesting.Tests.Tree @@ -57,7 +57,7 @@ namespace UnitTesting.Tests.Tree
StartTestDebugger();
string expectedArguments =
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" " +
"/noshadow " +
"/noshadow /noxml " +
"/results=\"c:\\temp\\tmp66.tmp\" " +
"/run=\"MyTests.MyTestClass.MyTestMethod\"";
@ -167,7 +167,7 @@ namespace UnitTesting.Tests.Tree @@ -167,7 +167,7 @@ namespace UnitTesting.Tests.Tree
string commandLine = "\"C:\\SharpDevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" " +
"/noshadow " +
"/noshadow /noxml " +
"/results=\"c:\\temp\\tmp66.tmp\" " +
"/run=\"MyTests.MyTestClass.MyTestMethod\"";
Assert.AreEqual(commandLine, message);

2
src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestInPadCommandTestFixture.cs

@ -79,7 +79,7 @@ namespace UnitTesting.Tests.Tree @@ -79,7 +79,7 @@ namespace UnitTesting.Tests.Tree
{
runCommand.Run();
buildProject.FireBuildCompleteEvent();
string expectedArgs = "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"";
string expectedArgs = "\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml";
Assert.AreEqual(expectedArgs, processRunner.CommandArgumentsPassedToStartMethod);
}

4
src/AddIns/Analysis/UnitTesting/Test/Tree/RunTestWithDebuggerCommandTestFixture.cs

@ -34,7 +34,7 @@ namespace UnitTesting.Tests.Tree @@ -34,7 +34,7 @@ namespace UnitTesting.Tests.Tree
public void DebuggerStartsUnitTestApplicationWithCorrectCommandLineArguments()
{
string expectedArguments =
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"";
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml";
string actualArguments = debuggerService.MockDebugger.ProcessStartInfo.Arguments;
Assert.AreEqual(expectedArguments, actualArguments);
@ -54,7 +54,7 @@ namespace UnitTesting.Tests.Tree @@ -54,7 +54,7 @@ namespace UnitTesting.Tests.Tree
{
string expectedText =
"\"D:\\SharpDevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\"\r\n";
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\" /noxml\r\n";
string actualText = context.UnitTestCategory.Text;
Assert.AreEqual(expectedText, actualText);

2
src/AddIns/Analysis/UnitTesting/UnitTesting.csproj

@ -126,7 +126,7 @@ @@ -126,7 +126,7 @@
<Compile Include="Src\TestTreeView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\NUnitConsoleCommandLine.cs" />
<Compile Include="Src\NUnitConsoleApplication.cs" />
<Compile Include="Src\AbstractRunTestCommand.cs" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="..\..\..\Main\GlobalAssemblyInfo.cs">

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

@ -231,7 +231,6 @@ @@ -231,7 +231,6 @@
<Compile Include="Src\SelectedMvcFolder.cs" />
<Compile Include="Src\SelectedMvcViewFolder.cs" />
<Compile Include="Src\SlideBehaviour.cs" />
<Compile Include="Src\ViewInBrowser.cs" />
<Compile Include="Src\ViewModelBase.cs" />
<Compile Include="Src\VisualStudioProjectExtension.cs" />
<Compile Include="Src\WebBehavior.cs" />

77
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/ViewInBrowser.cs

@ -1,77 +0,0 @@ @@ -1,77 +0,0 @@
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
//
//using System;
//using System.IO;
//using System.Linq;
//
//using ICSharpCode.Core;
//using ICSharpCode.SharpDevelop.Gui.OptionPanels;
//using ICSharpCode.SharpDevelop.Project;
//using ICSharpCode.SharpDevelop.Project.Commands;
//
//namespace ICSharpCode.AspNet.Mvc
//{
// public class ViewInBrowser : AbstractMenuCommand
// {
// public override void Run()
// {
// var node = ProjectBrowserPad.Instance.SelectedNode as FileNode;
// if (node == null) {
// return;
// }
//
// var project = ProjectService.CurrentProject as CompilableProject;
// if (project == null) {
// return;
// }
//
// if (!project.IsWebProject) {
// MessageService.ShowError("${res:ProjectComponent.ContextMenu.NotAWebProject}");
// return;
// }
//
// if (!WebProjectService.IsIISOrIISExpressInstalled) {
// MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.IISNotFound}");
// return;
// }
//
// string fileName = node.FileName;
//
//// // set project options
//// project.StartAction = StartAction.StartURL;
//// string directoryName = Path.GetDirectoryName(project.FileName) + "\\";
//// project.StartUrl = fileName.Replace(directoryName, "/").Replace("\\", "/");
//
// // set web server options
// string projectName = project.Name;
// WebProjectOptions existingOptions = WebProjectsOptions.Instance.GetWebProjectOptions(projectName);
//
// var options = new WebProjectOptions {
// Data = new WebProjectDebugData {
// WebServer = WebProjectService.IsIISExpressInstalled ? WebServer.IISExpress : WebServer.IIS,
// Port = (existingOptions != null && existingOptions.Data != null) ? existingOptions.Data.Port : "8080", //TODO: port collision detection
// ProjectUrl = string.Format("{0}/{1}", WebBehavior.LocalHost, project.Name)
// },
// ProjectName = projectName
// };
//
// if (options.Data.WebServer == WebServer.IISExpress) {
// options.Data.ProjectUrl = string.Format(
// @"{0}:{1}/{2}", WebBehavior.LocalHost, options.Data.Port, projectName);
// }
//
// WebProjectsOptions.Instance.SetWebProjectOptions(projectName, options);
//
// // create virtual directory
// string error = WebProjectService.CreateVirtualDirectory(
// options.Data.WebServer,
// projectName,
// Path.GetDirectoryName(ProjectService.CurrentProject.FileName));
// LoggingService.Info(error ?? string.Empty);
//
// // RunProject
// new RunProject().Run();
// }
// }
//}

2
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonComponentWalker.cs

@ -165,7 +165,7 @@ namespace ICSharpCode.PythonBinding @@ -165,7 +165,7 @@ namespace ICSharpCode.PythonBinding
MemberExpression eventExpression = node.Left as MemberExpression;
string eventName = eventExpression.Name.ToString();
PythonControlFieldExpression field = PythonControlFieldExpression.Create(eventExpression);
fieldExpression = PythonControlFieldExpression.Create(eventExpression);
MemberExpression eventHandlerExpression = node.Right as MemberExpression;
string eventHandlerName = eventHandlerExpression.Name.ToString();

4
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonResolverContext.cs

@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.PythonBinding
@ -118,7 +120,7 @@ namespace ICSharpCode.PythonBinding @@ -118,7 +120,7 @@ namespace ICSharpCode.PythonBinding
public bool PartialNamespaceExistsInProjectReferences(string name)
{
foreach (IProjectContent referencedContent in projectContent.ReferencedContents) {
foreach (IProjectContent referencedContent in projectContent.ThreadSafeGetReferencedContents()) {
if (PartialNamespaceExists(referencedContent, name)) {
return true;
}

108
src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/LoadFormWithButtonFollowedByTimerTestFixture.cs

@ -0,0 +1,108 @@ @@ -0,0 +1,108 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting.Tests.Utils;
using NUnit.Framework;
using PythonBinding.Tests.Utils;
namespace PythonBinding.Tests.Designer
{
/// <summary>
/// Fix ArgumentNullException when form has a button followed by a timer and the
/// first timer statement is the setting of the event handler.
/// </summary>
[TestFixture]
public class LoadFormWithButtonFollowedByTimerTestFixture : LoadFormTestFixtureBase
{
MockPropertyDescriptor mockTickPropertyDescriptor;
public override string PythonCode {
get {
return
"import System.Drawing\r\n" +
"import System.Windows.Forms\r\n" +
"\r\n" +
"from System.Drawing import *\r\n" +
"from System.Windows.Forms import *\r\n" +
"\r\n" +
"class MainForm(Form):\r\n" +
" def __init__(self):\r\n" +
" self.InitializeComponent()\r\n" +
"\r\n" +
" def InitializeComponent(self):\r\n" +
" self._components = System.ComponentModel.Container()\r\n" +
" self._button1 = System.Windows.Forms.Button()\r\n" +
" self._timer1 = System.Windows.Forms.Timer(self._components)\r\n" +
" self.SuspendLayout()\r\n" +
" # \r\n" +
" # button1\r\n" +
" # \r\n" +
" self._button1.Location = System.Drawing.Point(37, 29)\r\n" +
" self._button1.Name = \"button1\"\r\n" +
" self._button1.Size = System.Drawing.Size(75, 23)\r\n" +
" self._button1.TabIndex = 0\r\n" +
" self._button1.Text = \"button1\"\r\n" +
" self._button1.UseVisualStyleBackColor = True\r\n" +
" # \r\n" +
" # timer1\r\n" +
" # \r\n" +
" self._timer1.Tick += self.Timer1Tick\r\n" +
" # \r\n" +
" # MainForm\r\n" +
" # \r\n" +
" self.ClientSize = System.Drawing.Size(284, 264)\r\n" +
" self.Controls.Add(self._button1)\r\n" +
" self.Name = \"MainForm\"\r\n" +
" self.Text = \"PyWinTest\"\r\n" +
" self.ResumeLayout(False)\r\n" +
"\r\n" +
"\r\n" +
" def Timer1Tick(self, sender, e):\r\n" +
" pass";
}
}
public override void BeforeSetUpFixture()
{
mockTickPropertyDescriptor = new MockPropertyDescriptor("Tick", null, false);
ComponentCreator.SetEventPropertyDescriptor(mockTickPropertyDescriptor);
}
[Test]
public void EventDescriptorUsedToGetEventProperty()
{
Assert.IsNotNull(ComponentCreator.EventDescriptorPassedToGetEventProperty);
}
[Test]
public void EventDescriptorNameUsedToGetEventPropertyIsTick()
{
Assert.AreEqual("Tick", ComponentCreator.EventDescriptorPassedToGetEventProperty.Name);
}
[Test]
public void GetPropertyValueSetForTimer()
{
string value = mockTickPropertyDescriptor.GetValue(null) as String;
Assert.AreEqual("Timer1Tick", value);
}
[Test]
public void GetComponentUsedWhenSettingTickHandler()
{
IComponent expectedComponent = ComponentCreator.GetComponent("timer1");
object component = mockTickPropertyDescriptor.GetSetValueComponent();
Assert.AreEqual(expectedComponent, component);
}
}
}

1
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj

@ -265,6 +265,7 @@ @@ -265,6 +265,7 @@
<Compile Include="Designer\LoadFontTestFixture.cs" />
<Compile Include="Designer\LoadFormTestFixtureBase.cs" />
<Compile Include="Designer\LoadFormWithBooleanPropertiesSetTestFixture.cs" />
<Compile Include="Designer\LoadFormWithButtonFollowedByTimerTestFixture.cs" />
<Compile Include="Designer\LoadFormWithSysPathAppendStatementTestFixture.cs" />
<Compile Include="Designer\LoadInheritedProtectedPanelFormTestFixture.cs" />
<Compile Include="Designer\LoadInheritedPublicPanelFormTestFixture.cs" />

30
src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs

@ -143,7 +143,7 @@ namespace ICSharpCode.VBNetBinding @@ -143,7 +143,7 @@ namespace ICSharpCode.VBNetBinding
InsertDocumentationComments(editor, lineNr, cursorOffset);
}
if (ch == '\n' && lineAboveText != null) {
if (ch == '\n' && lineAbove != null) {
if (LanguageUtils.IsInsideDocumentationComment(editor, lineAbove, lineAbove.EndOffset)) {
editor.Document.Insert(cursorOffset, "''' ");
return;
@ -410,7 +410,7 @@ namespace ICSharpCode.VBNetBinding @@ -410,7 +410,7 @@ namespace ICSharpCode.VBNetBinding
while ((currentToken = lexer.NextToken()).Kind != Tokens.EOF) {
if (prevToken == null)
prevToken = currentToken;
if (IsBlockStart(lexer, currentToken, prevToken)) {
if (IsBlockStart(lexer, currentToken, prevToken) && !IsAutomaticPropertyWithDefaultValue(lexer, currentToken, prevToken)) {
if ((tokens.Count > 0 && tokens.Peek().Kind != Tokens.Interface) || IsDeclaration(currentToken.Kind))
tokens.Push(currentToken);
}
@ -438,6 +438,30 @@ namespace ICSharpCode.VBNetBinding @@ -438,6 +438,30 @@ namespace ICSharpCode.VBNetBinding
return false;
}
static bool IsAutomaticPropertyWithDefaultValue(ILexer lexer, Token currentToken, Token prevToken)
{
if (currentToken.Kind != Tokens.Property)
return false;
lexer.StartPeek();
int parenthesesNesting = 0;
// look for parameter list, = or EOL
Token t;
while ((t = lexer.Peek()).Kind != Tokens.EOF) {
if (t.Kind == Tokens.OpenParenthesis)
parenthesesNesting++;
if (t.Kind == Tokens.CloseParenthesis)
parenthesesNesting--;
if (parenthesesNesting == 0 && t.Kind == Tokens.Assign)
return true;
if (t.Kind == Tokens.EOL)
return false;
}
return false;
}
static Token GetClosestMissing(List<Token> missingEnds, VBStatement statement, ITextEditor editor, int lineNr)
{
Token closest = null;
@ -612,7 +636,7 @@ namespace ICSharpCode.VBNetBinding @@ -612,7 +636,7 @@ namespace ICSharpCode.VBNetBinding
Indent(editor, indentation, new string(' ', endColumn - startColumn - 1));
}
if (!inInterface && !isMustOverride && !isDeclare && !isDelegate) {
if (!inInterface && !isMustOverride && !isDeclare && !isDelegate && !IsAutomaticPropertyWithDefaultValue(lexer, currentToken, prevToken)) {
Indent(editor, indentation);
if (currentToken.Kind == Tokens.Select)

2
src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.VBNetBinding.OptionPanels @@ -35,7 +35,7 @@ namespace ICSharpCode.VBNetBinding.OptionPanels
}
IProjectContent projectContent = ParserService.GetProjectContent(project);
foreach(IProjectContent refProjectContent in projectContent.ReferencedContents) {
foreach(IProjectContent refProjectContent in projectContent.ThreadSafeGetReferencedContents()) {
AddNamespaces(refProjectContent);
}

47
src/AddIns/BackendBindings/VBNetBinding/Test/FormattingStrategy/EndSubTests.cs

@ -173,5 +173,52 @@ namespace ICSharpCode.VBNetBinding.Tests @@ -173,5 +173,52 @@ namespace ICSharpCode.VBNetBinding.Tests
RunTest(code, cursorOffset, expectedCode, expectedOffset, '\n');
}
[Test]
public void AutomaticPropertyWithInitializer()
{
string code = "Public Class Foo\r\n" +
"\tPublic Property Bar As Boolean = True\r\n" +
"\r\n" + // This extra new line is required. This is the new line just entered by the user.
"End Class";
string bar = "= True\r\n";
int cursorOffset = code.IndexOf(bar) + bar.Length;
string expectedCode = "Public Class Foo\r\n" +
"\tPublic Property Bar As Boolean = True\r\n" +
"\t\r\n" +
"End Class";
int expectedOffset = ("Public Class Foo\r\n" +
"\tPublic Property Bar As Boolean = True\r\n" +
"\t").Length;
RunTest(code, cursorOffset, expectedCode, expectedOffset, '\n');
}
[Test]
public void StandardProperty()
{
string code = "Public Class Foo\r\n" +
"\tPublic Property Bar As Boolean\r\n" +
"\r\n" + // This extra new line is required. This is the new line just entered by the user.
"End Class";
string bar = "As Boolean\r\n";
int cursorOffset = code.IndexOf(bar) + bar.Length;
string expectedCode = "Public Class Foo\r\n" +
"\tPublic Property Bar As Boolean\r\n" +
"\t\t\r\n" +
"\tEnd Property\r\n" +
"End Class";
int expectedOffset = ("Public Class Foo\r\n" +
"\tPublic Property Bar As Boolean\r\n" +
"\t\t").Length;
RunTest(code, cursorOffset, expectedCode, expectedOffset, '\n');
}
}
}

2
src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataHelper.cs

@ -311,7 +311,7 @@ namespace ICSharpCode.XamlBinding @@ -311,7 +311,7 @@ namespace ICSharpCode.XamlBinding
{
List<XmlnsCompletionItem> list = new List<XmlnsCompletionItem>();
foreach (IProjectContent content in projectContent.ReferencedContents) {
foreach (IProjectContent content in projectContent.ThreadSafeGetReferencedContents()) {
foreach (IAttribute att in content.GetAssemblyAttributes()) {
if (att.PositionalArguments.Count == 2
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {

10
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompilationUnit.cs

@ -2,10 +2,12 @@ @@ -2,10 +2,12 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Linq;
using ICSharpCode.SharpDevelop.Dom;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.XamlBinding
{
@ -81,7 +83,7 @@ namespace ICSharpCode.XamlBinding @@ -81,7 +83,7 @@ namespace ICSharpCode.XamlBinding
IReturnType type = FindTypeInAssembly(pc, xmlNamespace, className);
if (type != null)
return type;
foreach (IProjectContent p in pc.ReferencedContents) {
foreach (IProjectContent p in pc.ThreadSafeGetReferencedContents()) {
type = FindTypeInAssembly(p, xmlNamespace, className);
if (type != null)
return type;
@ -117,7 +119,7 @@ namespace ICSharpCode.XamlBinding @@ -117,7 +119,7 @@ namespace ICSharpCode.XamlBinding
else {
var list = new List<ICompletionEntry>();
AddNamespaceMembersInAssembly(pc, xmlNamespace, list);
foreach (IProjectContent p in pc.ReferencedContents) {
foreach (IProjectContent p in pc.ThreadSafeGetReferencedContents()) {
AddNamespaceMembersInAssembly(p, xmlNamespace, list);
}
return list.OfType<IClass>();

21
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs

@ -41,5 +41,26 @@ namespace ICSharpCode.SharpDevelop.Services @@ -41,5 +41,26 @@ namespace ICSharpCode.SharpDevelop.Services
// Properties for the DebuggeeExceptionForm
public FormWindowState DebuggeeExceptionWindowState { get; set; }
/// <summary>
/// Used to update status of some debugger properties while debugger is running.
/// </summary>
internal static void ResetStatus(Action<Process> resetStatus)
{
Process proc = WindowsDebugger.CurrentProcess;
// debug session is running
if (proc != null) {
bool wasPausedNow = false;
// if it is not paused, break execution
if (!proc.IsPaused) {
proc.Break();
wasPausedNow = true;
}
resetStatus(proc);
// continue if it was not paused before
if (wasPausedNow)
proc.AsyncContinue();
}
}
}
}

14
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs

@ -50,19 +50,7 @@ namespace Debugger.AddIn.Options @@ -50,19 +50,7 @@ namespace Debugger.AddIn.Options
public override bool SaveOptions()
{
bool result = base.SaveOptions();
Process proc = WindowsDebugger.CurrentProcess;
// debug session is running
if (proc != null) {
bool wasPausedNow = false;
// if it is not paused, break execution
if (!proc.IsPaused) {
proc.Break();
wasPausedNow = true;
}
proc.Debugger.ResetJustMyCodeStatus();
// continue if it was not paused before
if (wasPausedNow) proc.AsyncContinue();
}
DebuggingOptions.ResetStatus(proc => proc.Debugger.ResetJustMyCodeStatus());
return result;
}
}

10
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs

@ -30,11 +30,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -30,11 +30,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
public override bool StorePanelContents()
{
DebuggingOptions.Instance.SymbolsSearchPaths = pathList.GetList();
Process proc = WindowsDebugger.CurrentProcess;
if (proc != null) {
proc.Debugger.ReloadModuleSymbols();
proc.Debugger.ResetJustMyCodeStatus();
}
DebuggingOptions.ResetStatus(
proc => {
proc.Debugger.ReloadModuleSymbols();
proc.Debugger.ResetJustMyCodeStatus();
});
return true;
}
}

39
src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs

@ -12,6 +12,7 @@ using System.Windows.Media; @@ -12,6 +12,7 @@ using System.Windows.Media;
using Debugger;
using Debugger.AddIn.TreeModel;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.Pads;
using ICSharpCode.SharpDevelop.Services;
namespace ICSharpCode.SharpDevelop.Gui.Pads
@ -21,10 +22,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -21,10 +22,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
/// </summary>
public partial class CallStackPadContent : UserControl
{
CallStackPad callStackPad;
Process debuggedProcess;
public CallStackPadContent()
public CallStackPadContent(CallStackPad pad)
{
this.callStackPad = pad;
InitializeComponent();
view.ContextMenu = CreateMenu();
@ -40,7 +43,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -40,7 +43,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
extMethodsItem.IsChecked = DebuggingOptions.Instance.ShowExternalMethods;
extMethodsItem.Click += delegate {
extMethodsItem.IsChecked = DebuggingOptions.Instance.ShowExternalMethods = !DebuggingOptions.Instance.ShowExternalMethods;
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
};
MenuItem moduleItem = new MenuItem();
@ -49,7 +52,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -49,7 +52,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
moduleItem.Click += delegate {
moduleItem.IsChecked = DebuggingOptions.Instance.ShowModuleNames = !DebuggingOptions.Instance.ShowModuleNames;
((GridView)view.View).Columns[0].Width = DebuggingOptions.Instance.ShowModuleNames ? 100d : 0d;
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
};
MenuItem argNamesItem = new MenuItem();
@ -57,7 +60,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -57,7 +60,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
argNamesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentNames;
argNamesItem.Click += delegate {
argNamesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentNames = !DebuggingOptions.Instance.ShowArgumentNames;
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
};
MenuItem argValuesItem = new MenuItem();
@ -65,7 +68,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -65,7 +68,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
argValuesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentValues;
argValuesItem.Click += delegate {
argValuesItem.IsChecked = DebuggingOptions.Instance.ShowArgumentValues = !DebuggingOptions.Instance.ShowArgumentValues;
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
};
MenuItem lineItem = new MenuItem();
@ -74,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -74,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
lineItem.Click += delegate {
lineItem.IsChecked = DebuggingOptions.Instance.ShowLineNumbers = !DebuggingOptions.Instance.ShowLineNumbers;
((GridView)view.View).Columns[2].Width = DebuggingOptions.Instance.ShowLineNumbers ? 50d : 0d;
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
};
return new ContextMenu() {
@ -98,12 +101,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -98,12 +101,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
if (debuggedProcess != null) {
debuggedProcess.Paused += debuggedProcess_Paused;
}
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
}
void debuggedProcess_Paused(object sender, ProcessEventArgs e)
{
CallStackPad.InvalidateCallstackPad();
callStackPad.InvalidatePad();
}
void View_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
@ -150,13 +153,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -150,13 +153,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
var items = new ObservableCollection<CallStackItem>();
using(new PrintTimes("Callstack refresh")) {
bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods;
bool previousItemIsExternalMethod = false;
bool previousItemIsExternalMethod = false;
debuggedProcess.EnqueueForEach(
Dispatcher,
debuggedProcess.SelectedThread.GetCallstack(100),
f => items.AddIfNotNull(CreateItem(f, showExternalMethods, ref previousItemIsExternalMethod))
);
debuggedProcess.EnqueueForEach(
Dispatcher,
debuggedProcess.SelectedThread.GetCallstack(100),
f => items.AddIfNotNull(CreateItem(f, showExternalMethods, ref previousItemIsExternalMethod))
);
}
view.ItemsSource = items;
}
@ -287,7 +290,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -287,7 +290,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
protected override void InitializeComponents()
{
callStackList = new CallStackPadContent();
callStackList = new CallStackPadContent(this);
}
protected override void SelectProcess(Process process)
@ -299,11 +302,5 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -299,11 +302,5 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
callStackList.RefreshPad();
}
public static void InvalidateCallstackPad()
{
if (instance != null)
instance.InvalidatePad();
}
}
}

11
src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs

@ -29,20 +29,13 @@ namespace Debugger.AddIn @@ -29,20 +29,13 @@ namespace Debugger.AddIn
var inputWindow = new WatchInputBox(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.AddWatch}"),
StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.EnterExpression}"));
inputWindow.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow;
var result = inputWindow.ShowDialog();
if (!result.HasValue || !result.Value)
if (inputWindow.ShowDialog() != true)
return;
string input = inputWindow.CommandText;
if (!string.IsNullOrEmpty(input)) {
// get language
if (ProjectService.CurrentProject == null) return;
string language = ProjectService.CurrentProject.Language;
var text = new TextNode(null, input,
language == "VB" || language == "VBNet" ? SupportedLanguage.VBNet : SupportedLanguage.CSharp).ToSharpTreeNode();
var text = new TextNode(null, input, inputWindow.ScriptLanguage).ToSharpTreeNode();
var list = pad.WatchList;
if(!list.WatchItems.Any(n => text.Node.FullName == ((TreeNodeWrapper)n).Node.FullName))

10
src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs

@ -39,6 +39,16 @@ namespace Debugger.AddIn.Pads.Controls @@ -39,6 +39,16 @@ namespace Debugger.AddIn.Pads.Controls
get { return Node.HasChildNodes; }
}
public override bool CanDelete()
{
return Parent is WatchRootNode;
}
public override void Delete()
{
Parent.Children.Remove(this);
}
protected override void LoadChildren()
{
if (Node.HasChildNodes) {

7
src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs

@ -69,17 +69,18 @@ namespace Debugger.AddIn.Pads.Controls @@ -69,17 +69,18 @@ namespace Debugger.AddIn.Pads.Controls
void WatchListAutoCompleteCellCommandEntered(object sender, EventArgs e)
{
if (SelectedNode == null) return;
var selectedNode = SelectedNode;
if (selectedNode == null) return;
if (WatchType != WatchListType.Watch) return;
var cell = ((WatchListAutoCompleteCell)sender);
SelectedNode.Node.Name = cell.CommandText;
selectedNode.Node.Name = cell.CommandText;
myList.UnselectAll();
if (WatchType == WatchListType.Watch && WatchPad.Instance != null) {
WatchPad.Instance.InvalidatePad();
}
SelectedNode.IsEditing = false;
selectedNode.IsEditing = false;
}
void MyListPreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)

35
src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchListAutoCompleteCell.cs

@ -25,7 +25,7 @@ namespace Debugger.AddIn.Pads.Controls @@ -25,7 +25,7 @@ namespace Debugger.AddIn.Pads.Controls
{
public partial class WatchListAutoCompleteCell : UserControl
{
private string language;
string language;
protected ConsoleControl console;
@ -33,7 +33,7 @@ namespace Debugger.AddIn.Pads.Controls @@ -33,7 +33,7 @@ namespace Debugger.AddIn.Pads.Controls
DependencyProperty.Register("CommandText", typeof(string), typeof(WatchListAutoCompleteCell),
new UIPropertyMetadata(null, new PropertyChangedCallback(OnCommandTextChanged)));
private NRefactoryResolver resolver;
NRefactoryResolver resolver;
public event EventHandler CommandEntered;
@ -72,7 +72,7 @@ namespace Debugger.AddIn.Pads.Controls @@ -72,7 +72,7 @@ namespace Debugger.AddIn.Pads.Controls
this.Process = debugger.DebuggedProcess;
}
private Process Process { get; set; }
Process Process { get; set; }
/// <summary>
/// Gets/sets the command text displayed at the command prompt.
@ -82,13 +82,13 @@ namespace Debugger.AddIn.Pads.Controls @@ -82,13 +82,13 @@ namespace Debugger.AddIn.Pads.Controls
set { console.CommandText = value; }
}
private ITextEditor TextEditor {
ITextEditor TextEditor {
get {
return console.TextEditor;
}
}
private void console_TextAreaPreviewKeyDown(object sender, KeyEventArgs e)
void console_TextAreaPreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return || e.Key == Key.Escape) {
@ -106,7 +106,7 @@ namespace Debugger.AddIn.Pads.Controls @@ -106,7 +106,7 @@ namespace Debugger.AddIn.Pads.Controls
}
}
private void console_LostFocus(object sender, RoutedEventArgs e)
void console_LostFocus(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(CommandText) || !this.CheckSyntax())
return;
@ -115,15 +115,15 @@ namespace Debugger.AddIn.Pads.Controls @@ -115,15 +115,15 @@ namespace Debugger.AddIn.Pads.Controls
CommandEntered(this, EventArgs.Empty);
}
private bool CheckSyntax()
bool CheckSyntax()
{
string command = CommandText;
// FIXME workaround the NRefactory issue that needs a ; at the end
if (language == "C#" || language == "CSharp") {
if(!command.EndsWith(";"))
if (!command.EndsWith(";"))
command += ";";
// FIXME only one string should be available; highlighting expects C#, supproted language, CSharp
// FIXME only one string should be available; highlighting expects C#, supported language, CSharp
language = "CSharp";
}
@ -139,7 +139,7 @@ namespace Debugger.AddIn.Pads.Controls @@ -139,7 +139,7 @@ namespace Debugger.AddIn.Pads.Controls
return true;
}
private void consoleControl_TextAreaTextEntered(object sender, TextCompositionEventArgs e)
void consoleControl_TextAreaTextEntered(object sender, TextCompositionEventArgs e)
{
foreach (char ch in e.Text) {
if (ch == '.') {
@ -148,21 +148,15 @@ namespace Debugger.AddIn.Pads.Controls @@ -148,21 +148,15 @@ namespace Debugger.AddIn.Pads.Controls
}
}
private void ShowDotCompletion(string currentText)
void ShowDotCompletion(string currentText)
{
var seg = Process.SelectedStackFrame.NextStatement;
var expressionFinder = ParserService.GetExpressionFinder(seg.Filename);
var info = ParserService.GetParseInformation(seg.Filename);
string text = ParserService.GetParseableFileContent(seg.Filename).Text;
int currentOffset = TextEditor.Caret.Offset - console.CommandOffset - 1;
var expr = expressionFinder.FindExpression(currentText, currentOffset);
expr.Region = new DomRegion(seg.StartLine, seg.StartColumn, seg.EndLine, seg.EndColumn);
var rr = resolver.Resolve(expr, info, text);
if (rr != null) {
@ -170,9 +164,12 @@ namespace Debugger.AddIn.Pads.Controls @@ -170,9 +164,12 @@ namespace Debugger.AddIn.Pads.Controls
}
}
private static void OnCommandTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
static void OnCommandTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var cell = d as WatchListAutoCompleteCell;
cell.CommandText = e.NewValue.ToString();
if (cell != null && e.NewValue != null) {
cell.CommandText = e.NewValue.ToString();
}
}
}
}

86
src/AddIns/Debugger/Debugger.AddIn/Pads/WatchInputBox.xaml.cs

@ -13,7 +13,9 @@ using ICSharpCode.SharpDevelop; @@ -13,7 +13,9 @@ using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Dom.NRefactoryResolver;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.Pads;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Services;
@ -25,8 +27,12 @@ namespace Debugger.AddIn.Pads @@ -25,8 +27,12 @@ namespace Debugger.AddIn.Pads
/// </summary>
public partial class WatchInputBox : BaseWatchBox
{
private NRefactoryResolver resolver;
private string language;
NRefactoryResolver resolver;
SupportedLanguage language;
public SupportedLanguage ScriptLanguage {
get { return language; }
}
public WatchInputBox(string text, string caption) : base()
{
@ -37,18 +43,20 @@ namespace Debugger.AddIn.Pads @@ -37,18 +43,20 @@ namespace Debugger.AddIn.Pads
this.Title = StringParser.Parse(caption);
this.ConsolePanel.Content = console;
if (ProjectService.CurrentProject == null) return;
// get language
language = ProjectService.CurrentProject.Language;
resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language));
// FIXME set language
if (language == "VB" || language == "VBNet") {
console.SetHighlighting("VBNET");
} else {
language = "C#";
console.SetHighlighting("C#");
if (ProjectService.CurrentProject == null)
language = GetLanguageFromActiveViewContent();
else
language = GetLanguage(ProjectService.CurrentProject.Language);
resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language.ToString()));
switch (language) {
case SupportedLanguage.CSharp:
console.SetHighlighting("C#");
break;
case SupportedLanguage.VBNet:
console.SetHighlighting("VBNET");
break;
}
// get process
@ -72,7 +80,7 @@ namespace Debugger.AddIn.Pads @@ -72,7 +80,7 @@ namespace Debugger.AddIn.Pads
}
}
private void ShowDotCompletion(string currentText)
void ShowDotCompletion(string currentText)
{
var seg = Process.SelectedStackFrame.NextStatement;
@ -94,20 +102,15 @@ namespace Debugger.AddIn.Pads @@ -94,20 +102,15 @@ namespace Debugger.AddIn.Pads
}
}
private bool CheckSyntax()
bool CheckSyntax()
{
string command = console.CommandText.Trim();
// FIXME workaround the NRefactory issue that needs a ; at the end
if (language == "C#") {
if(!command.EndsWith(";"))
command += ";";
// FIXME only one string should be available; highlighting expects C#, supproted language, CSharp
language = "CSharp";
}
if (language == SupportedLanguage.CSharp && !command.EndsWith(";"))
command += ";";
SupportedLanguage supportedLanguage = (SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), language, true);
using (var parser = ParserFactory.CreateParser(supportedLanguage, new StringReader(command))) {
using (var parser = ParserFactory.CreateParser(language, new StringReader(command))) {
parser.ParseExpression();
if (parser.Errors.Count > 0) {
MessageService.ShowError(parser.Errors.ErrorOutput);
@ -118,7 +121,38 @@ namespace Debugger.AddIn.Pads @@ -118,7 +121,38 @@ namespace Debugger.AddIn.Pads
return true;
}
private void AcceptButton_Click(object sender, RoutedEventArgs e)
SupportedLanguage GetLanguage(string language)
{
if ("VBNet".Equals(language, StringComparison.OrdinalIgnoreCase)
|| "VB".Equals(language, StringComparison.OrdinalIgnoreCase)
|| "VB.NET".Equals(language, StringComparison.OrdinalIgnoreCase))
return SupportedLanguage.VBNet;
return SupportedLanguage.CSharp;
}
/// <summary>
/// Gets the language used in the currently active view content. This is useful, when there is no project
/// opened and we still want to add watches (i.e. the debugger is attached to an existing process without a solution).
/// </summary>
SupportedLanguage GetLanguageFromActiveViewContent()
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
if (provider != null && provider.TextEditor != null) {
string extension = Path.GetExtension(provider.TextEditor.FileName).ToLowerInvariant();
switch (extension) {
case ".cs":
return SupportedLanguage.CSharp;
case ".vb":
return SupportedLanguage.VBNet;
}
}
return SupportedLanguage.CSharp;
}
void AcceptButton_Click(object sender, RoutedEventArgs e)
{
if (!this.CheckSyntax())
return;
@ -127,7 +161,7 @@ namespace Debugger.AddIn.Pads @@ -127,7 +161,7 @@ namespace Debugger.AddIn.Pads
this.Close();
}
private void CancelButton_Click(object sender, RoutedEventArgs e)
void CancelButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
this.Close();

17
src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

@ -55,12 +55,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -55,12 +55,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
watchList = new WatchList(WatchListType.Watch);
watchList.ContextMenu = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/WatchPad/ContextMenu");
watchList.MouseDoubleClick += watchList_DoubleClick;
watchList.KeyUp += watchList_KeyUp;
watchList.MouseDoubleClick += WatchListDoubleClick;
watchList.WatchItems.CollectionChanged += OnWatchItemsCollectionChanged;
panel.Children.Add(watchList);
panel.KeyUp += new KeyEventHandler(panel_KeyUp);
panel.KeyDown += PanelKeyDown;
// wire events that influence the items
LoadSavedNodes();
@ -122,23 +121,15 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -122,23 +121,15 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
#endregion
void panel_KeyUp(object sender, KeyEventArgs e)
void PanelKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Insert) {
AddNewWatch();
e.Handled = true;
}
}
void watchList_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Delete) {
RemoveWatchCommand cmd = new RemoveWatchCommand { Owner = this };
cmd.Run();
}
}
void watchList_DoubleClick(object sender, MouseEventArgs e)
void WatchListDoubleClick(object sender, MouseEventArgs e)
{
if (watchList.SelectedNode == null)
{

8
src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs

@ -74,7 +74,7 @@ namespace Debugger @@ -74,7 +74,7 @@ namespace Debugger
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
{
EnterCallback(pausedReason, name, pThread.GetProcess());
process.SelectedThread = process.Threads[pThread];
process.SelectedThread = process.GetThread(pThread);
}
void ExitCallback()
@ -128,7 +128,7 @@ namespace Debugger @@ -128,7 +128,7 @@ namespace Debugger
{
EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread);
Thread thread = process.Threads[pThread];
Thread thread = process.GetThread(pThread);
Stepper stepper = process.GetStepper(pStepper);
StackFrame currentStackFrame = process.SelectedThread.MostRecentStackFrame;
@ -378,7 +378,7 @@ namespace Debugger @@ -378,7 +378,7 @@ namespace Debugger
EnterCallback(PausedReason.Other, "NameChange: pThread", pThread);
Thread thread = process.Threads[pThread];
Thread thread = process.GetThread(pThread);
thread.NotifyNameChanged();
ExitCallback();
@ -445,7 +445,7 @@ namespace Debugger @@ -445,7 +445,7 @@ namespace Debugger
if (process.Threads.Contains(pThread)) {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.GetID(), pThread);
process.Threads[pThread].NotifyExited();
process.GetThread(pThread).NotifyExited();
} else {
EnterCallback(PausedReason.Other, "ExitThread " + pThread.GetID(), process.CorProcess);

12
src/AddIns/Debugger/Debugger.Core/Process.cs

@ -233,6 +233,18 @@ namespace Debugger @@ -233,6 +233,18 @@ namespace Debugger
return written;
}
internal Thread GetThread(ICorDebugThread corThread)
{
foreach(Thread thread in this.Threads) {
if (thread.CorThread == corThread) {
return thread;
}
}
Thread t = new Thread(this, corThread);
this.Threads.Add(t);
return t;
}
#region Exceptions
public event EventHandler<ExceptionEventArgs> ExceptionThrown;

11
src/AddIns/Debugger/Debugger.Core/ThreadCollection.cs

@ -38,16 +38,5 @@ namespace Debugger @@ -38,16 +38,5 @@ namespace Debugger
}
return false;
}
internal Thread this[ICorDebugThread corThread] {
get {
foreach(Thread thread in this) {
if (thread.CorThread == corThread) {
return thread;
}
}
throw new DebuggerException("Thread is not in collection");
}
}
}
}

3
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs

@ -275,7 +275,8 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -275,7 +275,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
if (trackedFeature != null)
trackedFeature.EndTracking();
this.PrimaryFile.IsDirtyChanged -= PrimaryFile_IsDirtyChanged;
if (PrimaryFile != null)
this.PrimaryFile.IsDirtyChanged -= PrimaryFile_IsDirtyChanged;
base.Dispose();
BookmarksDetach();
codeEditor.Dispose();

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs

@ -39,7 +39,6 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -39,7 +39,6 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
if (!disposed) {
changeWatcher.ChangeOccurred -= ChangeOccurred;
changeWatcher.Dispose();
disposed = true;
}
}

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs

@ -610,6 +610,8 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -610,6 +610,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (errorPainter != null)
errorPainter.Dispose();
if (changeWatcher != null)
changeWatcher.Dispose();
this.Document = null;
DisposeTextEditor(primaryTextEditor);
if (secondaryTextEditor != null)

22
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Commands/FoldingCommands.cs

@ -16,14 +16,14 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands @@ -16,14 +16,14 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
ITextEditor editor = provider.TextEditor;
ParserFoldingStrategy strategy = editor.GetService(typeof(ParserFoldingStrategy)) as ParserFoldingStrategy;
FoldingManager foldingManager = editor.GetService(typeof(FoldingManager)) as FoldingManager;
if (strategy != null) {
if (foldingManager != null) {
// look for folding on this line:
FoldingSection folding = strategy.FoldingManager.GetNextFolding(editor.Document.PositionToOffset(editor.Caret.Line, 1));
FoldingSection folding = foldingManager.GetNextFolding(editor.Document.PositionToOffset(editor.Caret.Line, 1));
if (folding == null || editor.Document.GetLineForOffset(folding.StartOffset).LineNumber != editor.Caret.Line) {
// no folding found on current line: find innermost folding containing the caret
folding = strategy.FoldingManager.GetFoldingsContaining(editor.Caret.Offset).LastOrDefault();
folding = foldingManager.GetFoldingsContaining(editor.Caret.Offset).LastOrDefault();
}
if (folding != null) {
folding.IsFolded = !folding.IsFolded;
@ -38,17 +38,17 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands @@ -38,17 +38,17 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
ITextEditor editor = provider.TextEditor;
ParserFoldingStrategy strategy = editor.GetService(typeof(ParserFoldingStrategy)) as ParserFoldingStrategy;
FoldingManager foldingManager = editor.GetService(typeof(FoldingManager)) as FoldingManager;
if (strategy != null) {
if (foldingManager != null) {
bool doFold = true;
foreach (FoldingSection fm in strategy.FoldingManager.AllFoldings) {
foreach (FoldingSection fm in foldingManager.AllFoldings) {
if (fm.IsFolded) {
doFold = false;
break;
}
}
foreach (FoldingSection fm in strategy.FoldingManager.AllFoldings) {
foreach (FoldingSection fm in foldingManager.AllFoldings) {
fm.IsFolded = doFold;
}
}
@ -61,10 +61,10 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands @@ -61,10 +61,10 @@ namespace ICSharpCode.AvalonEdit.AddIn.Commands
{
ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider;
ITextEditor editor = provider.TextEditor;
ParserFoldingStrategy strategy = editor.GetService(typeof(ParserFoldingStrategy)) as ParserFoldingStrategy;
FoldingManager foldingManager = editor.GetService(typeof(FoldingManager)) as FoldingManager;
if (strategy != null) {
foreach (FoldingSection fm in strategy.FoldingManager.AllFoldings) {
if (foldingManager != null) {
foreach (FoldingSection fm in foldingManager.AllFoldings) {
fm.IsFolded = ParserFoldingStrategy.IsDefinition(fm);
}
}

6
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DefaultChangeWatcher.cs

@ -197,8 +197,10 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -197,8 +197,10 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (!disposed) {
if (watcher != null)
watcher.Dispose();
this.textDocument.LineTrackers.Remove(this);
this.textDocument.UndoStack.PropertyChanged -= UndoStackPropertyChanged;
if (this.textDocument != null) {
this.textDocument.LineTrackers.Remove(this);
this.textDocument.UndoStack.PropertyChanged -= UndoStackPropertyChanged;
}
disposed = true;
}
}

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<UserControl.Resources>
<DataTemplate x:Key="comboBoxItemTemplate">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Image}" Width="16" Height="16" Margin="0,0,2,0"/>
<Image Source="{Binding Image}" Width="16" Height="16" Margin="0,-1,2,-1"/>
<TextBlock Text="{Binding Text}" Name="textBlock"/>
</StackPanel>
<DataTemplate.Triggers>

15
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs

@ -337,15 +337,18 @@ namespace ICSharpCode.FormsDesigner @@ -337,15 +337,18 @@ namespace ICSharpCode.FormsDesigner
foreach (var stmt in initializeComponent.Statements.OfType<CodeExpressionStatement>().Where(ces => ces.Expression is CodeMethodInvokeExpression)) {
CodeMethodInvokeExpression invocation = (CodeMethodInvokeExpression)stmt.Expression;
if (invocation.Method.TargetObject is CodeCastExpression) {
CodeCastExpression expr = (CodeCastExpression)invocation.Method.TargetObject;
CodeFieldReferenceExpression fieldRef = (CodeFieldReferenceExpression)expr.Expression;
if (!(fieldRef.TargetObject is CodeThisReferenceExpression))
CodeCastExpression expr = invocation.Method.TargetObject as CodeCastExpression;
if (expr != null) {
CodeFieldReferenceExpression fieldRef = expr.Expression as CodeFieldReferenceExpression;
if (fieldRef == null || !(fieldRef.TargetObject is CodeThisReferenceExpression))
continue;
if (expr.TargetType.BaseType != "System.ComponentModel.ISupportInitialize")
continue;
CodeMemberField field = formClass.Members.OfType<CodeMemberField>().First(f => this.formClass.ProjectContent.Language.NameComparer.Equals(fieldRef.FieldName, f.Name));
IClass fieldType = this.formClass.ProjectContent.GetClass(field.Type.BaseType, 0);
IField field = this.formClass.DefaultReturnType.GetFields()
.First(f => this.formClass.ProjectContent.Language.NameComparer.Equals(fieldRef.FieldName, f.Name));
if (field.ReturnType == null)
continue;
IClass fieldType = field.ReturnType.GetUnderlyingClass();
if (fieldType == null)
continue;
if (!fieldType.IsTypeInInheritanceTree(iSupportInitializeInterface))

12
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/ResourceStore.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.FormsDesigner.Services @@ -37,7 +37,7 @@ namespace ICSharpCode.FormsDesigner.Services
{
ResourceStorage storage;
if (!resources.TryGetValue(culture.Name, out storage)) {
storage = resources[culture.Name] = new ResourceStorage(culture.Name);
storage = resources[culture.Name] = new ResourceStorage(culture.Name, viewContent.PrimaryFileName);
string fileName = CalcResourceFileName(viewContent.PrimaryFileName, culture.Name);
CreateOpenedFileForStorage(storage, fileName, File.Exists(fileName));
}
@ -108,12 +108,14 @@ namespace ICSharpCode.FormsDesigner.Services @@ -108,12 +108,14 @@ namespace ICSharpCode.FormsDesigner.Services
IResourceWriter writer;
byte[] buffer;
readonly string cultureName;
string parentDesignerSourceFileName;
internal OpenedFile OpenedFile;
internal bool IsNewFile;
public ResourceStorage(string cultureName)
public ResourceStorage(string cultureName, string parentDesignerSourceFileName)
{
this.cultureName = cultureName;
this.parentDesignerSourceFileName = parentDesignerSourceFileName;
}
public void Dispose()
@ -204,7 +206,7 @@ namespace ICSharpCode.FormsDesigner.Services @@ -204,7 +206,7 @@ namespace ICSharpCode.FormsDesigner.Services
public IResourceWriter GetWriter()
{
this.stream = new MemoryStream();
this.writer = CreateResourceWriter(this.stream, GetResourceType(OpenedFile.FileName));
this.writer = CreateResourceWriter(this.stream, GetResourceType(OpenedFile.FileName), parentDesignerSourceFileName);
return this.writer;
}
@ -335,12 +337,12 @@ namespace ICSharpCode.FormsDesigner.Services @@ -335,12 +337,12 @@ namespace ICSharpCode.FormsDesigner.Services
return new ResXResourceReader(stream);
}
internal static IResourceWriter CreateResourceWriter(Stream stream, ResourceType type)
internal static IResourceWriter CreateResourceWriter(Stream stream, ResourceType type, string parentDesignerSourceFileName)
{
if (type == ResourceType.Resources) {
return new ResourceWriter(stream);
}
return new ResXResourceWriter(stream);
return new ResXResourceWriter(stream, t => ResXConverter.ConvertTypeName(t, parentDesignerSourceFileName));
}
internal static ResourceType GetResourceType(string fileName)

20
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs

@ -122,9 +122,13 @@ namespace ICSharpCode.FormsDesigner.Services @@ -122,9 +122,13 @@ namespace ICSharpCode.FormsDesigner.Services
if (!projectContentsCurrentlyLoadingAssembly.Add(pc))
return null;
Assembly sdAssembly;
if (IsSharpDevelopAssembly(pc, out sdAssembly))
return sdAssembly;
try {
// load dependencies of current assembly
foreach (IProjectContent rpc in pc.ReferencedContents) {
foreach (IProjectContent rpc in pc.ThreadSafeGetReferencedContents()) {
if (rpc is ParseProjectContent) {
LoadAssembly(rpc);
} else if (rpc is ReflectionProjectContent) {
@ -151,6 +155,20 @@ namespace ICSharpCode.FormsDesigner.Services @@ -151,6 +155,20 @@ namespace ICSharpCode.FormsDesigner.Services
}
}
readonly string sharpDevelopRoot = Directory.GetParent(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)).FullName;
bool IsSharpDevelopAssembly(IProjectContent pc, out Assembly assembly)
{
assembly = null;
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
if (!asm.IsDynamic && asm.Location.StartsWith(sharpDevelopRoot, StringComparison.OrdinalIgnoreCase) && pc.AssemblyName == asm.GetName().Name) {
assembly = asm;
return true;
}
}
return false;
}
static string GetHash(string fileName)
{
return Path.GetFileName(fileName).ToLowerInvariant() + File.GetLastWriteTimeUtc(fileName).Ticks.ToString();

4
src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/ResourceList.cs

@ -8,9 +8,9 @@ using System.Drawing.Printing; @@ -8,9 +8,9 @@ using System.Drawing.Printing;
using System.IO;
using System.Resources;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Widgets.ListViewSorting;
namespace ResourceEditor
@ -174,7 +174,7 @@ namespace ResourceEditor @@ -174,7 +174,7 @@ namespace ResourceEditor
// write XML resource
case ".resx":
ResXResourceWriter rxw = new ResXResourceWriter(stream);
ResXResourceWriter rxw = new ResXResourceWriter(stream, t => ResXConverter.ConvertTypeName(t, filename));
foreach (KeyValuePair<string, ResourceItem> entry in resources) {
if (entry.Value != null) {
ResourceItem item = entry.Value;

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/IdeChooseClassService.cs

@ -43,7 +43,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -43,7 +43,7 @@ namespace ICSharpCode.WpfDesign.AddIn
var pc = ParserService.CurrentProjectContent;
var a = GetAssembly(pc);
if (a != null) yield return a;
foreach (var r in pc.ReferencedContents) {
foreach (var r in pc.ThreadSafeGetReferencedContents()) {
a = GetAssembly(r);
if (a != null) yield return a;
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs

@ -52,7 +52,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -52,7 +52,7 @@ namespace ICSharpCode.WpfDesign.AddIn
Assembly FindAssemblyInProjectReferences(IProjectContent pc, string name)
{
foreach (IProjectContent referencedProjectContent in pc.ReferencedContents) {
foreach (IProjectContent referencedProjectContent in pc.ThreadSafeGetReferencedContents()) {
if (name == referencedProjectContent.AssemblyName) {
return this.typeResolutionService.LoadAssembly(referencedProjectContent);
}

7
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs

@ -149,12 +149,7 @@ namespace ICSharpCode.XmlEditor @@ -149,12 +149,7 @@ namespace ICSharpCode.XmlEditor
else
newText = currentIndentation + lineText.Trim();
if (newText != lineText) {
int extraCharsToBeAddedAtStartedOfLine = newText.Length - lineText.Length;
document.Replace(line.Offset, line.Length, newText);
Location caretPosition = document.OffsetToPosition(line.Offset + extraCharsToBeAddedAtStartedOfLine);
editor.Caret.Position = caretPosition;
}
document.SmartReplaceLine(line, newText);
nextLine++;
}
if (r.LineNumber > end)

3
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeViewContainerControl.cs

@ -200,7 +200,7 @@ namespace ICSharpCode.XmlEditor @@ -200,7 +200,7 @@ namespace ICSharpCode.XmlEditor
/// comment node currently on display.
/// </summary>
public string TextContent {
get { return textBox.Text; }
get { return textBox.Text.Replace("\n", "\r\n"); }
set { textBox.Text = value; }
}
@ -740,6 +740,7 @@ namespace ICSharpCode.XmlEditor @@ -740,6 +740,7 @@ namespace ICSharpCode.XmlEditor
//
this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox.Location = new System.Drawing.Point(0, 0);
this.textBox.Multiline = true;
this.textBox.Name = "textBox";
this.textBox.Size = new System.Drawing.Size(375, 326);
this.textBox.TabIndex = 2;

5
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

@ -141,8 +141,9 @@ namespace ICSharpCode.XmlEditor @@ -141,8 +141,9 @@ namespace ICSharpCode.XmlEditor
{
if (editor == null) return false;
try {
XmlDocument Document = new XmlDocument();
Document.LoadXml(editor.Document.Text);
XmlDocument document = new XmlDocument();
document.XmlResolver = null;
document.LoadXml(editor.Document.Text);
return true;
} catch (XmlException ex) {
AddTask(editor.FileName, ex.Message, ex.LinePosition, ex.LineNumber, TaskType.Error);

6
src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin

@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
<Path name="/AddIns/DefaultTextEditor/CodeCompletion">
<CodeCompletionBinding
id="Xml"
extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.build;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj"
extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.build;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj;.ps1xml"
class="ICSharpCode.XmlEditor.XmlCodeCompletionBinding"/>
</Path>
@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
<LanguageBinding
id="Xml"
class="ICSharpCode.XmlEditor.XmlLanguageBinding"
extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.build;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj" />
extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.build;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj;.ps1xml" />
</Path>
<Path name="/SharpDevelop/Workbench/DisplayBindings">
@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
<!-- Extra project browser icons -->
<Path name="/Workspace/Icons">
<Icon id="ExtraXmlFileIcon"
extensions=".manifest;.config;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.xaml;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj"
extensions=".manifest;.config;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.xfrm;.targets;.xpt;.xft;.map;.wsdl;.disco;.xaml;.nuspec;.booproj;.fsproj;.pyproj;.rbproj;.vcxproj;.wixproj;.ps1xml"
resource="FileIcons.XmlIcon" />
</Path>

9
src/AddIns/DisplayBindings/XmlEditor/Test/Editor/IndentChildElementEndTagAfterNewLineTypedTestFixture.cs

@ -71,14 +71,5 @@ namespace XmlEditor.Tests.Editor @@ -71,14 +71,5 @@ namespace XmlEditor.Tests.Editor
Assert.AreEqual(expectedText, textDocument.Text);
}
[Test]
public void CursorIsJustBeforeChildEndElementEndTagAfterIndent()
{
int line = 3;
int column = 2;
Location expectedLocation = new Location(column, line);
Assert.AreEqual(expectedLocation, textEditor.Caret.Position);
}
}
}

BIN
src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.4.1.0.8000.nupkg

Binary file not shown.

4
src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>AvalonEdit.Sample</id>
<version>4.1.0.8000</version>
<version>4.2.0.8783</version>
<authors>Daniel Grunwald</authors>
<owners>SharpDevelop</owners>
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
@ -16,7 +16,7 @@ StartupUri="/Samples/AvalonEdit/Window1.xaml"</description> @@ -16,7 +16,7 @@ StartupUri="/Samples/AvalonEdit/Window1.xaml"</description>
<summary>Sample code for AvalonEdit the WPF-based text editor used in SharpDevelop 4.0.</summary>
<language>en-US</language>
<dependencies>
<dependency id="AvalonEdit" version="4.1.0.8000" />
<dependency id="AvalonEdit" version="4.2.0.8783" />
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Windows.Forms" />

BIN
src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.nupkg

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.4.1.0.8000.symbols.nupkg

Binary file not shown.

2
src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>AvalonEdit</id>
<version>4.1.0.8000</version>
<version>4.2.0.8783</version>
<authors>Daniel Grunwald</authors>
<owners>SharpDevelop</owners>
<licenseUrl>http://www.opensource.org/licenses/lgpl-2.1.php</licenseUrl>

1
src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj

@ -70,6 +70,7 @@ @@ -70,6 +70,7 @@
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\AcceptLicensesEventArgs.cs" />
<Compile Include="Src\ConfigSettingsFileSystem.cs" />
<Compile Include="Src\Design\DesignTimeSelectProjectsViewModel.cs" />
<Compile Include="Src\Design\FakePackageOperation.cs" />
<Compile Include="Src\Design\FakeSelectedProject.cs" />

10
src/AddIns/Misc/PackageManagement/Project/Src/AvailablePackagesViewModel.cs

@ -43,13 +43,9 @@ namespace ICSharpCode.PackageManagement @@ -43,13 +43,9 @@ namespace ICSharpCode.PackageManagement
protected override IEnumerable<IPackage> GetFilteredPackagesBeforePagingResults(IQueryable<IPackage> allPackages)
{
IEnumerable<IPackage> filteredPackages = base.GetFilteredPackagesBeforePagingResults(allPackages);
return GetDistinctPackagesById(filteredPackages);
}
IEnumerable<IPackage> GetDistinctPackagesById(IEnumerable<IPackage> allPackages)
{
return allPackages.DistinctLast<IPackage>(PackageEqualityComparer.Id);
return base.GetFilteredPackagesBeforePagingResults(allPackages)
.Where(package => package.IsReleaseVersion())
.DistinctLast(PackageEqualityComparer.Id);
}
}
}

24
src/AddIns/Misc/PackageManagement/Project/Src/ConfigSettingsFileSystem.cs

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
namespace ICSharpCode.PackageManagement
{
public class ConfigSettingsFileSystem : PhysicalFileSystem
{
ConfigSettingsFileSystem(string root)
: base(root)
{
}
public static ConfigSettingsFileSystem CreateConfigSettingsFileSystem(Solution solution)
{
string configSettingsFolder = Path.Combine(solution.Directory, ".nuget");
return new ConfigSettingsFileSystem(configSettingsFolder);
}
}
}

2
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs

@ -54,5 +54,7 @@ namespace ICSharpCode.PackageManagement.Design @@ -54,5 +54,7 @@ namespace ICSharpCode.PackageManagement.Design
{
throw new NotImplementedException();
}
public bool IsBindingRedirectSupported { get; set; }
}
}

10
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs

@ -118,5 +118,15 @@ namespace ICSharpCode.PackageManagement.Design @@ -118,5 +118,15 @@ namespace ICSharpCode.PackageManagement.Design
AddFakePackageSource(packageSource);
}
}
public IList<KeyValuePair<string, string>> GetNestedValues(string section, string key)
{
throw new NotImplementedException();
}
public void SetNestedValues(string section, string key, IList<KeyValuePair<string, string>> values)
{
throw new NotImplementedException();
}
}
}

4
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs

@ -29,6 +29,10 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -29,6 +29,10 @@ namespace ICSharpCode.PackageManagement.EnvDTE
ItemOperations = new ItemOperations(fileService);
}
public string Version {
get { return "10.0"; }
}
public Solution Solution {
get {
if (IsSolutionOpen) {

3
src/AddIns/Misc/PackageManagement/Project/Src/ISharpDevelopPackageRepositoryFactory.cs

@ -11,7 +11,8 @@ namespace ICSharpCode.PackageManagement @@ -11,7 +11,8 @@ namespace ICSharpCode.PackageManagement
{
ISharedPackageRepository CreateSharedRepository(
IPackagePathResolver pathResolver,
IFileSystem fileSystem);
IFileSystem fileSystem,
IFileSystem configSettingsFileSystem);
IRecentPackageRepository CreateRecentPackageRepository(
IList<RecentPackageInfo> recentPackages,

2
src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs

@ -26,7 +26,7 @@ namespace ICSharpCode.PackageManagement @@ -26,7 +26,7 @@ namespace ICSharpCode.PackageManagement
}
public PackageManagementOptions(Properties properties)
: this(properties, Settings.DefaultSettings)
: this(properties, Settings.LoadDefaultSettings())
{
}

2
src/AddIns/Misc/PackageManagement/Project/Src/PackageReferenceFileNameForProject.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.PackageManagement @@ -17,7 +17,7 @@ namespace ICSharpCode.PackageManagement
void GetFileNameForProject(IProject project)
{
FileName = Path.Combine(project.Directory, PackageReferenceRepository.PackageReferenceFile);
FileName = Path.Combine(project.Directory, Constants.PackageReferenceFile);
}
public string FileName { get; private set; }

4
src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs

@ -62,9 +62,9 @@ namespace ICSharpCode.PackageManagement @@ -62,9 +62,9 @@ namespace ICSharpCode.PackageManagement
return repository;
}
public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem)
public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
{
return factory.CreateSharedRepository(pathResolver, fileSystem);
return factory.CreateSharedRepository(pathResolver, fileSystem, configSettingsFileSystem);
}
public IPackageRepository CreateAggregateRepository()

2
src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs

@ -46,7 +46,7 @@ namespace ICSharpCode.PackageManagement @@ -46,7 +46,7 @@ namespace ICSharpCode.PackageManagement
}
}
public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem)
public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
{
throw new NotImplementedException();
}

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

Loading…
Cancel
Save