Browse Source

Merge branch 'master' of github.com:icsharpcode/SharpDevelop into newNR

pull/32/merge
Daniel Grunwald 13 years ago
parent
commit
9d44d868c8
  1. 21
      data/resources/StringResources.es-mx.resx
  2. 21
      data/resources/StringResources.es.resx
  3. 59
      data/resources/StringResources.fr.resx
  4. 25
      data/resources/StringResources.nl.resx
  5. 15
      data/resources/StringResources.resx
  6. 6
      data/resources/StringResources.tr.resx
  7. 33
      samples/CSharpCodeCompletion/AssemblyInfo.cs
  8. 85
      samples/CSharpCodeCompletion/CSharpCodeCompletion.csproj
  9. 18
      samples/CSharpCodeCompletion/CSharpCodeCompletion.sln
  10. 167
      samples/CSharpCodeCompletion/CodeCompletionData.cs
  11. 103
      samples/CSharpCodeCompletion/CodeCompletionKeyHandler.cs
  12. 166
      samples/CSharpCodeCompletion/CodeCompletionProvider.cs
  13. 65
      samples/CSharpCodeCompletion/HostCallbackImplementation.cs
  14. 101
      samples/CSharpCodeCompletion/MainForm.Designer.cs
  15. 203
      samples/CSharpCodeCompletion/MainForm.cs
  16. 191
      samples/CSharpCodeCompletion/MainForm.resx
  17. 150
      samples/CSharpCodeCompletion/ToolTipProvider.cs
  18. BIN
      samples/CSharpCodeCompletion/readme.rtf
  19. BIN
      samples/CodeConverter/AppPoolSettings.png
  20. 2
      samples/CodeConverter/Dependencies/CopyDependencies.build
  21. 6
      samples/CodeConverter/DeploymentNotes.txt
  22. 13
      samples/CodeConverter/Source/CCSite/CCSite.csproj
  23. 20
      samples/CodeConverter/Source/CCSite/Properties/PublishProfiles/Local Profile.pubxml
  24. 4
      samples/CodeConverter/Source/CodeConverter.sln
  25. 6
      samples/CodeConverter/Source/ICSharpCode.CodeConversion/ICSharpCode.CodeConversion.csproj
  26. 14
      samples/CodonCreation/TestDoozer.cs
  27. 2
      samples/CppBackendBinding/CppBackendBinding.addin
  28. 6
      samples/CppBackendBinding/CppProjectBinding.cs
  29. BIN
      samples/CppBackendBinding/readme.rtf
  30. 10
      samples/DisplayBindings/AlternateEditor/AlternateEditorDisplayBinding.cs
  31. 5
      samples/DisplayBindings/AlternateEditor/Editor.cs
  32. 1
      samples/DisplayBindings/ImageViewer/ImageViewer.csproj
  33. 2
      samples/DisplayBindings/ImageViewer/ImageViewer.sln
  34. 10
      samples/DisplayBindings/ImageViewer/Src/ImageViewerDisplayBinding.cs
  35. 8
      samples/Gallio/Gallio.Extension/Gallio.Extension.csproj
  36. 7
      samples/Gallio/Gallio.SharpDevelop.Tests/Gallio.SharpDevelop.Tests.csproj
  37. 42
      samples/Gallio/Gallio.SharpDevelop.Tests/GallioTestFrameworkIsTestMemberTests.cs
  38. 3
      samples/Gallio/Gallio.SharpDevelop/Gallio.SharpDevelop.csproj
  39. 19
      samples/Gallio/Gallio.SharpDevelop/GallioTestFramework.cs
  40. 2
      samples/LineCounter/LineCounter.addin
  41. 8
      samples/LineCounter/Src/Extensibility.cs
  42. 3
      samples/SdaUser/SdaAddIns/SdaBase.addin
  43. 87
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebBehavior.cs
  44. 27
      src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebProjectOptions/WebProjectOptionsPanel.xaml.cs
  45. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
  46. 4
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit.Sample/AvalonEdit.Sample.nuspec
  47. 6
      src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/AvalonEdit.nuspec
  48. 3
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardFormatter.cs
  49. 23
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/Printing/FormattingFixture.cs
  50. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ReportingLanguage/DateTimeFunctionsFixture.cs
  51. 2
      src/AddIns/Misc/SharpRefactoring/Project/Src/MethodExtractorBase.cs
  52. 188
      src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj
  53. 18
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegment.cs
  54. 3
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs
  55. 30
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs
  56. 91
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeSupport.cs
  57. 5
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs
  58. 15
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingElementGenerator.cs
  59. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingManager.cs
  60. 60
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingSection.cs
  61. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs
  62. 71
      src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs

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

@ -1873,6 +1873,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value> @@ -1873,6 +1873,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Depuración</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Habilitar decompilador</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Habilitar Editar y Continuar</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Excepciones</value>
</data>
@ -1903,6 +1909,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value> @@ -1903,6 +1909,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Pasar por propiedades de una única línea</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Suprimir optimización JIT</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Suprimir optimización NGEN</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Símbolos</value>
</data>
@ -2362,6 +2374,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value> @@ -2362,6 +2374,12 @@ Ejemplo: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Cualquier procesador</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>Cualquier procesador (preferentemente 32-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>Cualquier procesador (preferentemente 32-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Procesador Intel Itanium de 64-bits</value>
</data>
@ -2715,6 +2733,9 @@ También puede elegir guardar la opción en el archivo .user en lugar de en el a @@ -2715,6 +2733,9 @@ También puede elegir guardar la opción en el archivo .user en lugar de en el a
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Código</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Avanzado</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Abortar</value>
</data>

21
data/resources/StringResources.es.resx

@ -1869,6 +1869,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib @@ -1869,6 +1869,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Depuración</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Habilitar decompilador</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Habilitar Editar y Continuar</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Excepciones</value>
</data>
@ -1899,6 +1905,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib @@ -1899,6 +1905,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Pasar por propiedades de una única línea</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Suprimir optimización JIT</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Suprimir optimización NGEN</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Símbolos</value>
</data>
@ -2358,6 +2370,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib @@ -2358,6 +2370,12 @@ Para crear/manipular un objeto ActiveX/COM, arrastre una clase de un Control/Bib
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Cualquier procesador</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>Cualquier procesador (preferentemente 32-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>Cualquier procesador (preferentemente 64-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Procesador Intel Itanium de 64 bits</value>
</data>
@ -2715,6 +2733,9 @@ También puede escoger almacenar el parámetro de configuración en el archivo . @@ -2715,6 +2733,9 @@ También puede escoger almacenar el parámetro de configuración en el archivo .
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Fuente</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Avanzado</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Abortar</value>
</data>

59
data/resources/StringResources.fr.resx

@ -1807,7 +1807,7 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value> @@ -1807,7 +1807,7 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<value>Paramètres de complétion de code</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.LanguageDependend" xml:space="preserve">
<value>Certaines des options ci-dessous ne sont accessibles que pour certains langages de programmation.</value>
<value>Les options suivantes dépendent du language, certaines ne sont donc pas accessibles.</value>
</data>
<data name="Dialog.Options.IDEOptions.CodeCompletion.MainOption" xml:space="preserve">
<value>Cette option permet de complètement désactiver la complétion de code:</value>
@ -1869,6 +1869,12 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value> @@ -1869,6 +1869,12 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Déboguage en cours</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Activer la décompilation</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Activer "Editer et Continuer"</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Exceptions</value>
</data>
@ -1899,6 +1905,12 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value> @@ -1899,6 +1905,12 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Pas-à-pas sur les propriétés d'une ligne</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Supprimer les optimisations JIT</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Supprimer les optimisations NGEN</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Symboles</value>
</data>
@ -2358,6 +2370,12 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value> @@ -2358,6 +2370,12 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Tout processeur</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>x86/x64 - préfère 64 bits</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>x86/x64 - préfère 64 bits</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Processeur Itanium 64bits</value>
</data>
@ -2712,6 +2730,9 @@ Vous pouvez aussi choisir de stocker la configuration dans le fichier .user-file @@ -2712,6 +2730,9 @@ Vous pouvez aussi choisir de stocker la configuration dans le fichier .user-file
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Source</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Avancé</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Stopper</value>
</data>
@ -6415,6 +6436,24 @@ Les fichiers de resources ont été renommés/déplacés en conséquence.</value @@ -6415,6 +6436,24 @@ Les fichiers de resources ont été renommés/déplacés en conséquence.</value
<data name="Templates.File.NAnt.NAntBuildFile.Name" xml:space="preserve">
<value>Fichier de construction NAnt</value>
</data>
<data name="Templates.File.PRISMViewAndViewModelUnity.Description" xml:space="preserve">
<value>Créée une vue pour un module PRISM depuis un ViewModel.</value>
</data>
<data name="Templates.File.PRISMViewAndViewModelUnity.Name" xml:space="preserve">
<value>Vue PRISM et ViewModel (Unity)</value>
</data>
<data name="Templates.File.PRISMViewModelUnity.Description" xml:space="preserve">
<value>Créée un ViewModel pour un module PRISM.</value>
</data>
<data name="Templates.File.PRISMViewModelUnity.Name" xml:space="preserve">
<value>ViewModel PRISM (Unity)</value>
</data>
<data name="Templates.File.PRISMViewUnity.Description" xml:space="preserve">
<value>Créée une vue pour un module PRISM.</value>
</data>
<data name="Templates.File.PRISMViewUnity.Name" xml:space="preserve">
<value>Vue PRISM (Unity)</value>
</data>
<data name="Templates.File.Properties.AddIFDEFTest" xml:space="preserve">
<value>Ajoute '#if TEST ... #endif'</value>
</data>
@ -6685,6 +6724,24 @@ Les fichiers de resources ont été renommés/déplacés en conséquence.</value @@ -6685,6 +6724,24 @@ Les fichiers de resources ont été renommés/déplacés en conséquence.</value
<data name="Templates.Project.PortableLibrary.Name" xml:space="preserve">
<value>Bibliothèque de classes portables</value>
</data>
<data name="Templates.Project.PRISMApplicationSmallUnity.Description" xml:space="preserve">
<value>Créée une petite application PRISM avec Bootstrapper et Infrastructure.</value>
</data>
<data name="Templates.Project.PRISMApplicationSmallUnity.Name" xml:space="preserve">
<value>Application PRISM - petite (Unity)</value>
</data>
<data name="Templates.Project.PRISMApplicationUnity.Description" xml:space="preserve">
<value>Créée une application PRISM avec Bootstrapper et Infrastructure.</value>
</data>
<data name="Templates.Project.PRISMApplicationUnity.Name" xml:space="preserve">
<value>Application PRISM (Unity)</value>
</data>
<data name="Templates.Project.PRISMModuleUnity.Description" xml:space="preserve">
<value>Créée un module PRISM avec une vue et selon un ViewModel.</value>
</data>
<data name="Templates.Project.PRISMModuleUnity.Name" xml:space="preserve">
<value>Module PRISM (Unity)</value>
</data>
<data name="Templates.Project.SetupProject.Description" xml:space="preserve">
<value>Un projet pour créer un installer MSI.</value>
</data>

25
data/resources/StringResources.nl.resx

@ -1875,6 +1875,12 @@ Wilt u het nieuwe bestand toevoegen aan project ${CurrentProjectName}?</value> @@ -1875,6 +1875,12 @@ Wilt u het nieuwe bestand toevoegen aan project ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Foutopsporing</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Decompiler inschakelen</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Bewerken en Doorgaan inschakelen</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Uitzonderingen</value>
</data>
@ -1905,6 +1911,12 @@ Wilt u het nieuwe bestand toevoegen aan project ${CurrentProjectName}?</value> @@ -1905,6 +1911,12 @@ Wilt u het nieuwe bestand toevoegen aan project ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Stap over éénregelige eigenschappen</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Onderdruk JIT optimalisering</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Onderdruk NGEN optimalisering</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Symbolen</value>
</data>
@ -2364,6 +2376,12 @@ Wilt u het nieuwe bestand toevoegen aan project ${CurrentProjectName}?</value> @@ -2364,6 +2376,12 @@ Wilt u het nieuwe bestand toevoegen aan project ${CurrentProjectName}?</value>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Elke processor</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>Elke processor (voorkeur 32-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>Elke processor (voorkeur 64-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Intel 64-bit Itanium processor</value>
</data>
@ -2716,6 +2734,9 @@ Er kan worden gekozen voor opslag van de instellingen in het .user bestand inpla @@ -2716,6 +2734,9 @@ Er kan worden gekozen voor opslag van de instellingen in het .user bestand inpla
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Bron</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Uitgebreid</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Afbreken</value>
</data>
@ -5139,10 +5160,10 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v @@ -5139,10 +5160,10 @@ Microsoft.Tools.WindowsInstallerXml.Extenties.NetFxCompiler, WixNetFxExtentie</v
<value>Prioriteit</value>
</data>
<data name="MainWindow.Windows.Debug.Threads.Priority.AboveNormal" xml:space="preserve">
<value>Bovengemiddeld</value>
<value>Boven normaal</value>
</data>
<data name="MainWindow.Windows.Debug.Threads.Priority.BelowNormal" xml:space="preserve">
<value>Benedengemiddeld</value>
<value>Beneden normaal</value>
</data>
<data name="MainWindow.Windows.Debug.Threads.Priority.Highest" xml:space="preserve">
<value>Hoogste</value>

15
data/resources/StringResources.resx

@ -1933,6 +1933,12 @@ Do you want to add the new file to the project ${CurrentProjectName}?</value> @@ -1933,6 +1933,12 @@ Do you want to add the new file to the project ${CurrentProjectName}?</value>
<value>Debugging</value>
<comment>The root node in the options dialog</comment>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Enable decompiler</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Enable Edit and Continue</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Exceptions</value>
</data>
@ -1963,6 +1969,12 @@ Do you want to add the new file to the project ${CurrentProjectName}?</value> @@ -1963,6 +1969,12 @@ Do you want to add the new file to the project ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Step over single-line properties</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Suppress JIT optimization</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Suppress NGEN optimization</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Symbols</value>
</data>
@ -2800,6 +2812,9 @@ You can also choose to store the setting in the .user-file instead of the projec @@ -2800,6 +2812,9 @@ You can also choose to store the setting in the .user-file instead of the projec
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Source</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Advanced</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Abort</value>
</data>

6
data/resources/StringResources.tr.resx

@ -2360,6 +2360,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value> @@ -2360,6 +2360,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Herhangi bir işlemci</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>Herhangi bir işlemci (32 bit tercih)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>Herhangi bir işlemci (64 bit tercih)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Intel 64-bit Itanium işlemci</value>
</data>

33
samples/CSharpCodeCompletion/AssemblyInfo.cs

@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("CSharpEditor")]
[assembly: AssemblyDescription("A small C# editor demonstrating code-completion" +
" using ICSharpCode.SharpDevelop.Dom and " +
"ICSharpCode.TextEditor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ICSharpCode")]
[assembly: AssemblyProduct("CSharpEditor")]
[assembly: AssemblyCopyright("2006, Daniel Grunwald")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

85
samples/CSharpCodeCompletion/CSharpCodeCompletion.csproj

@ -1,85 +0,0 @@ @@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<RootNamespace>CSharpEditor</RootNamespace>
<AssemblyName>CSharpCodeCompletion</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{489CFE09-FDF7-4C89-BAB5-BD09CADD61AD}</ProjectGuid>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="ICSharpCode.NRefactory">
<HintPath>..\..\bin\ICSharpCode.NRefactory.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Dom">
<HintPath>..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="ICSharpCode.TextEditor">
<HintPath>..\..\bin\ICSharpCode.TextEditor.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\bin\log4net.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Mono.Cecil">
<HintPath>..\..\bin\Mono.Cecil.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CodeCompletionData.cs" />
<Compile Include="MainForm.cs" />
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="CodeCompletionProvider.cs" />
<Compile Include="CodeCompletionKeyHandler.cs" />
<Compile Include="HostCallbackImplementation.cs" />
<Compile Include="ToolTipProvider.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

18
samples/CSharpCodeCompletion/CSharpCodeCompletion.sln

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.0.0.5571
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpCodeCompletion", "CSharpCodeCompletion.csproj", "{489CFE09-FDF7-4C89-BAB5-BD09CADD61AD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{489CFE09-FDF7-4C89-BAB5-BD09CADD61AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{489CFE09-FDF7-4C89-BAB5-BD09CADD61AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{489CFE09-FDF7-4C89-BAB5-BD09CADD61AD}.Release|Any CPU.Build.0 = Release|Any CPU
{489CFE09-FDF7-4C89-BAB5-BD09CADD61AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal

167
samples/CSharpCodeCompletion/CodeCompletionData.cs

@ -1,167 +0,0 @@ @@ -1,167 +0,0 @@
/*
* Erstellt mit SharpDevelop.
* Benutzer: grunwald
* Datum: 27.08.2007
* Zeit: 14:25
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
using System.IO;
using System.Text;
using System.Xml;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Dom.CSharp;
using ICSharpCode.SharpDevelop.Dom.VBNet;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
namespace CSharpEditor
{
/// <summary>
/// Represents an item in the code completion window.
/// </summary>
class CodeCompletionData : DefaultCompletionData, ICompletionData
{
IMember member;
IClass c;
static VBNetAmbience vbAmbience = new VBNetAmbience();
static CSharpAmbience csharpAmbience = new CSharpAmbience();
public CodeCompletionData(IMember member)
: base(member.Name, null, GetMemberImageIndex(member))
{
this.member = member;
}
public CodeCompletionData(IClass c)
: base(c.Name, null, GetClassImageIndex(c))
{
this.c = c;
}
int overloads = 0;
public void AddOverload()
{
overloads++;
}
static int GetMemberImageIndex(IMember member)
{
// Missing: different icons for private/public member
if (member is IMethod)
return 1;
if (member is IProperty)
return 2;
if (member is IField)
return 3;
if (member is IEvent)
return 6;
return 3;
}
static int GetClassImageIndex(IClass c)
{
switch (c.ClassType) {
case ClassType.Enum:
return 4;
default:
return 0;
}
}
string description;
// DefaultCompletionData.Description is not virtual, but we can reimplement
// the interface to get the same effect as overriding.
string ICompletionData.Description {
get {
if (description == null) {
IEntity entity = (IEntity)member ?? c;
description = GetText(entity);
if (overloads > 1) {
description += " (+" + overloads + " overloads)";
}
description += Environment.NewLine + XmlDocumentationToText(entity.Documentation);
}
return description;
}
}
/// <summary>
/// Converts a member to text.
/// Returns the declaration of the member as C# or VB code, e.g.
/// "public void MemberName(string parameter)"
/// </summary>
static string GetText(IEntity entity)
{
IAmbience ambience = MainForm.IsVisualBasic ? (IAmbience)vbAmbience : csharpAmbience;
if (entity is IMethod)
return ambience.Convert(entity as IMethod);
if (entity is IProperty)
return ambience.Convert(entity as IProperty);
if (entity is IEvent)
return ambience.Convert(entity as IEvent);
if (entity is IField)
return ambience.Convert(entity as IField);
if (entity is IClass)
return ambience.Convert(entity as IClass);
// unknown entity:
return entity.ToString();
}
public static string XmlDocumentationToText(string xmlDoc)
{
System.Diagnostics.Debug.WriteLine(xmlDoc);
StringBuilder b = new StringBuilder();
try {
using (XmlTextReader reader = new XmlTextReader(new StringReader("<root>" + xmlDoc + "</root>"))) {
reader.XmlResolver = null;
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.Text:
b.Append(reader.Value);
break;
case XmlNodeType.Element:
switch (reader.Name) {
case "filterpriority":
reader.Skip();
break;
case "returns":
b.AppendLine();
b.Append("Returns: ");
break;
case "param":
b.AppendLine();
b.Append(reader.GetAttribute("name") + ": ");
break;
case "remarks":
b.AppendLine();
b.Append("Remarks: ");
break;
case "see":
if (reader.IsEmptyElement) {
b.Append(reader.GetAttribute("cref"));
} else {
reader.MoveToContent();
if (reader.HasValue) {
b.Append(reader.Value);
} else {
b.Append(reader.GetAttribute("cref"));
}
}
break;
}
break;
}
}
}
return b.ToString();
} catch (XmlException) {
return xmlDoc;
}
}
}
}

103
samples/CSharpCodeCompletion/CodeCompletionKeyHandler.cs

@ -1,103 +0,0 @@ @@ -1,103 +0,0 @@
// CSharp Editor Example with Code Completion
// Copyright (c) 2006, Daniel Grunwald
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// - Neither the name of the ICSharpCode team nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Gui;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
namespace CSharpEditor
{
class CodeCompletionKeyHandler
{
MainForm mainForm;
TextEditorControl editor;
CodeCompletionWindow codeCompletionWindow;
private CodeCompletionKeyHandler(MainForm mainForm, TextEditorControl editor)
{
this.mainForm = mainForm;
this.editor = editor;
}
public static CodeCompletionKeyHandler Attach(MainForm mainForm, TextEditorControl editor)
{
CodeCompletionKeyHandler h = new CodeCompletionKeyHandler(mainForm, editor);
editor.ActiveTextAreaControl.TextArea.KeyEventHandler += h.TextAreaKeyEventHandler;
// When the editor is disposed, close the code completion window
editor.Disposed += h.CloseCodeCompletionWindow;
return h;
}
/// <summary>
/// Return true to handle the keypress, return false to let the text area handle the keypress
/// </summary>
bool TextAreaKeyEventHandler(char key)
{
if (codeCompletionWindow != null) {
// If completion window is open and wants to handle the key, don't let the text area
// handle it
if (codeCompletionWindow.ProcessKeyEvent(key))
return true;
}
if (key == '.') {
ICompletionDataProvider completionDataProvider = new CodeCompletionProvider(mainForm);
codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(
mainForm, // The parent window for the completion window
editor, // The text editor to show the window for
MainForm.DummyFileName, // Filename - will be passed back to the provider
completionDataProvider, // Provider to get the list of possible completions
key // Key pressed - will be passed to the provider
);
if (codeCompletionWindow != null) {
// ShowCompletionWindow can return null when the provider returns an empty list
codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow);
}
}
return false;
}
void CloseCodeCompletionWindow(object sender, EventArgs e)
{
if (codeCompletionWindow != null) {
codeCompletionWindow.Closed -= new EventHandler(CloseCodeCompletionWindow);
codeCompletionWindow.Dispose();
codeCompletionWindow = null;
}
}
}
}

166
samples/CSharpCodeCompletion/CodeCompletionProvider.cs

@ -1,166 +0,0 @@ @@ -1,166 +0,0 @@
// CSharp Editor Example with Code Completion
// Copyright (c) 2006, Daniel Grunwald
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// - Neither the name of the ICSharpCode team nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
using Dom = ICSharpCode.SharpDevelop.Dom;
using NRefactoryResolver = ICSharpCode.SharpDevelop.Dom.NRefactoryResolver.NRefactoryResolver;
namespace CSharpEditor
{
class CodeCompletionProvider : ICompletionDataProvider
{
MainForm mainForm;
public CodeCompletionProvider(MainForm mainForm)
{
this.mainForm = mainForm;
}
public ImageList ImageList {
get {
return mainForm.imageList1;
}
}
public string PreSelection {
get {
return null;
}
}
public int DefaultIndex {
get {
return -1;
}
}
public CompletionDataProviderKeyResult ProcessKey(char key)
{
if (char.IsLetterOrDigit(key) || key == '_') {
return CompletionDataProviderKeyResult.NormalKey;
} else {
// key triggers insertion of selected items
return CompletionDataProviderKeyResult.InsertionKey;
}
}
/// <summary>
/// Called when entry should be inserted. Forward to the insertion action of the completion data.
/// </summary>
public bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key)
{
textArea.Caret.Position = textArea.Document.OffsetToPosition(insertionOffset);
return data.InsertAction(textArea, key);
}
public ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
{
// We can return code-completion items like this:
//return new ICompletionData[] {
// new DefaultCompletionData("Text", "Description", 1)
//};
NRefactoryResolver resolver = new NRefactoryResolver(mainForm.myProjectContent.Language);
Dom.ResolveResult rr = resolver.Resolve(FindExpression(textArea),
mainForm.parseInformation,
textArea.MotherTextEditorControl.Text);
List<ICompletionData> resultList = new List<ICompletionData>();
if (rr != null) {
var completionData = rr.GetCompletionData(mainForm.myProjectContent);
if (completionData != null) {
AddCompletionData(resultList, completionData);
}
}
return resultList.ToArray();
}
/// <summary>
/// Find the expression the cursor is at.
/// Also determines the context (using statement, "new"-expression etc.) the
/// cursor is at.
/// </summary>
Dom.ExpressionResult FindExpression(TextArea textArea)
{
Dom.IExpressionFinder finder;
if (MainForm.IsVisualBasic) {
finder = new Dom.VBNet.VBExpressionFinder();
} else {
finder = new Dom.CSharp.CSharpExpressionFinder(mainForm.parseInformation);
}
Dom.ExpressionResult expression = finder.FindExpression(textArea.Document.TextContent, textArea.Caret.Offset);
if (expression.Region.IsEmpty) {
expression.Region = new Dom.DomRegion(textArea.Caret.Line + 1, textArea.Caret.Column + 1);
}
return expression;
}
void AddCompletionData(List<ICompletionData> resultList, IEnumerable<Dom.ICompletionEntry> completionData)
{
// used to store the method names for grouping overloads
Dictionary<string, CodeCompletionData> nameDictionary = new Dictionary<string, CodeCompletionData>();
// Add the completion data as returned by SharpDevelop.Dom to the
// list for the text editor
foreach (object obj in completionData) {
if (obj is Dom.NamespaceEntry) {
resultList.Add(new DefaultCompletionData(obj.ToString(), "namespace " + obj, 5));
} else if (obj is Dom.NRefactoryResolver.KeywordEntry) {
resultList.Add(new DefaultCompletionData(obj.ToString(), obj.ToString(), 5));
} else if (obj is Dom.IClass) {
Dom.IClass c = (Dom.IClass)obj;
resultList.Add(new CodeCompletionData(c));
} else if (obj is Dom.IMember) {
Dom.IMember m = (Dom.IMember)obj;
if (m is Dom.IMethod && ((m as Dom.IMethod).IsConstructor)) {
// Skip constructors
continue;
}
// Group results by name and add "(x Overloads)" to the
// description if there are multiple results with the same name.
CodeCompletionData data;
if (nameDictionary.TryGetValue(m.Name, out data)) {
data.AddOverload();
} else {
nameDictionary[m.Name] = data = new CodeCompletionData(m);
resultList.Add(data);
}
} else {
// Current ICSharpCode.SharpDevelop.Dom should never return anything else
throw new NotSupportedException();
}
}
}
}
}

65
samples/CSharpCodeCompletion/HostCallbackImplementation.cs

@ -1,65 +0,0 @@ @@ -1,65 +0,0 @@
// CSharp Editor Example with Code Completion
// Copyright (c) 2006, Daniel Grunwald
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// - Neither the name of the ICSharpCode team nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Dom;
namespace CSharpEditor
{
/// <summary>
/// ICSharpCode.SharpDevelop.Dom was created by extracting code from ICSharpCode.SharpDevelop.dll.
/// There are a few static method calls that refer to GUI code or the code for keeping the parse
/// information. These calls have to be implemented by the application hosting
/// ICSharpCode.SharpDevelop.Dom by settings static fields with a delegate to their method
/// implementation.
/// </summary>
static class HostCallbackImplementation
{
public static void Register(MainForm mainForm)
{
// Must be implemented. Gets the project content of the active project.
HostCallback.GetCurrentProjectContent = delegate {
return mainForm.myProjectContent;
};
// The default implementation just logs to Log4Net. We want to display a MessageBox.
// Note that we use += here - in this case, we want to keep the default Log4Net implementation.
HostCallback.ShowError += delegate(string message, Exception ex) {
MessageBox.Show(message + Environment.NewLine + ex.ToString());
};
HostCallback.ShowMessage += delegate(string message) {
MessageBox.Show(message);
};
HostCallback.ShowAssemblyLoadError += delegate(string fileName, string include, string message) {
MessageBox.Show("Error loading code-completion information for "
+ include + " from " + fileName
+ ":\r\n" + message + "\r\n");
};
}
}
}

101
samples/CSharpCodeCompletion/MainForm.Designer.cs generated

@ -1,101 +0,0 @@ @@ -1,101 +0,0 @@
namespace CSharpEditor
{
partial class MainForm : System.Windows.Forms.Form
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.textEditorControl1 = new ICSharpCode.TextEditor.TextEditorControl();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.parserThreadLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// textEditorControl1
//
this.textEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textEditorControl1.IsIconBarVisible = false;
this.textEditorControl1.Location = new System.Drawing.Point(0, 0);
this.textEditorControl1.Name = "textEditorControl1";
this.textEditorControl1.ShowEOLMarkers = true;
this.textEditorControl1.ShowInvalidLines = false;
this.textEditorControl1.ShowSpaces = true;
this.textEditorControl1.ShowTabs = true;
this.textEditorControl1.ShowVRuler = true;
this.textEditorControl1.Size = new System.Drawing.Size(556, 248);
this.textEditorControl1.TabIndex = 0;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.parserThreadLabel});
this.statusStrip1.Location = new System.Drawing.Point(0, 248);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(556, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// parserThreadLabel
//
this.parserThreadLabel.Name = "parserThreadLabel";
this.parserThreadLabel.Size = new System.Drawing.Size(109, 17);
this.parserThreadLabel.Text = "toolStripStatusLabel1";
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "Icons.16x16.Class.png");
this.imageList1.Images.SetKeyName(1, "Icons.16x16.Method.png");
this.imageList1.Images.SetKeyName(2, "Icons.16x16.Property.png");
this.imageList1.Images.SetKeyName(3, "Icons.16x16.Field.png");
this.imageList1.Images.SetKeyName(4, "Icons.16x16.Enum.png");
this.imageList1.Images.SetKeyName(5, "Icons.16x16.NameSpace.png");
this.imageList1.Images.SetKeyName(6, "Icons.16x16.Event.png");
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(556, 270);
this.Controls.Add(this.textEditorControl1);
this.Controls.Add(this.statusStrip1);
this.Name = "MainForm";
this.Text = "CSharpEditor";
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
internal System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ToolStripStatusLabel parserThreadLabel;
private System.Windows.Forms.StatusStrip statusStrip1;
private ICSharpCode.TextEditor.TextEditorControl textEditorControl1;
}
}

203
samples/CSharpCodeCompletion/MainForm.cs

@ -1,203 +0,0 @@ @@ -1,203 +0,0 @@
// CSharp Editor Example with Code Completion
// Copyright (c) 2006, Daniel Grunwald
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// - Neither the name of the ICSharpCode team nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using NRefactory = ICSharpCode.NRefactory;
using Dom = ICSharpCode.SharpDevelop.Dom;
namespace CSharpEditor
{
partial class MainForm
{
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
internal Dom.ProjectContentRegistry pcRegistry;
internal Dom.DefaultProjectContent myProjectContent;
internal Dom.ParseInformation parseInformation;
Dom.ICompilationUnit lastCompilationUnit;
Thread parserThread;
public static bool IsVisualBasic = false;
/// <summary>
/// Many SharpDevelop.Dom methods take a file name, which is really just a unique identifier
/// for a file - Dom methods don't try to access code files on disk, so the file does not have
/// to exist.
/// SharpDevelop itself uses internal names of the kind "[randomId]/Class1.cs" to support
/// code-completion in unsaved files.
/// </summary>
public const string DummyFileName = "edited.cs";
static readonly Dom.LanguageProperties CurrentLanguageProperties = IsVisualBasic ? Dom.LanguageProperties.VBNet : Dom.LanguageProperties.CSharp;
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
if (IsVisualBasic) {
textEditorControl1.Text = @"
Class A
Sub B
Dim xx As String
End Sub
End Class
";
textEditorControl1.SetHighlighting("VBNET");
} else {
textEditorControl1.Text = @"using System;
class A
{
void B()
{
string x;
}
}
";
textEditorControl1.SetHighlighting("C#");
}
textEditorControl1.ShowEOLMarkers = false;
textEditorControl1.ShowInvalidLines = false;
HostCallbackImplementation.Register(this);
CodeCompletionKeyHandler.Attach(this, textEditorControl1);
ToolTipProvider.Attach(this, textEditorControl1);
pcRegistry = new Dom.ProjectContentRegistry(); // Default .NET 2.0 registry
// Persistence lets SharpDevelop.Dom create a cache file on disk so that
// future starts are faster.
// It also caches XML documentation files in an on-disk hash table, thus
// reducing memory usage.
pcRegistry.ActivatePersistence(Path.Combine(Path.GetTempPath(),
"CSharpCodeCompletion"));
myProjectContent = new Dom.DefaultProjectContent();
myProjectContent.Language = CurrentLanguageProperties;
// create dummy parseInformation to prevent NullReferenceException when using CC before parsing
// for the first time
parseInformation = new Dom.ParseInformation(new Dom.DefaultCompilationUnit(myProjectContent));
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
parserThread = new Thread(ParserThread);
parserThread.IsBackground = true;
parserThread.Start();
}
void ParserThread()
{
BeginInvoke(new MethodInvoker(delegate { parserThreadLabel.Text = "Loading mscorlib..."; }));
myProjectContent.AddReferencedContent(pcRegistry.Mscorlib);
// do one initial parser step to enable code-completion while other
// references are loading
ParseStep();
string[] referencedAssemblies = {
"System", "System.Data", "System.Drawing", "System.Xml", "System.Windows.Forms", "Microsoft.VisualBasic"
};
foreach (string assemblyName in referencedAssemblies) {
string assemblyNameCopy = assemblyName; // copy for anonymous method
BeginInvoke(new MethodInvoker(delegate { parserThreadLabel.Text = "Loading " + assemblyNameCopy + "..."; }));
Dom.IProjectContent referenceProjectContent = pcRegistry.GetProjectContentForReference(assemblyName, assemblyName);
myProjectContent.AddReferencedContent(referenceProjectContent);
if (referenceProjectContent is Dom.ReflectionProjectContent) {
(referenceProjectContent as Dom.ReflectionProjectContent).InitializeReferences();
}
}
if (IsVisualBasic) {
myProjectContent.DefaultImports = new Dom.DefaultUsing(myProjectContent);
myProjectContent.DefaultImports.Usings.Add("System");
myProjectContent.DefaultImports.Usings.Add("System.Text");
myProjectContent.DefaultImports.Usings.Add("Microsoft.VisualBasic");
}
BeginInvoke(new MethodInvoker(delegate { parserThreadLabel.Text = "Ready"; }));
// Parse the current file every 2 seconds
while (!IsDisposed) {
ParseStep();
Thread.Sleep(2000);
}
}
void ParseStep()
{
string code = null;
Invoke(new MethodInvoker(delegate {
code = textEditorControl1.Text;
}));
TextReader textReader = new StringReader(code);
Dom.ICompilationUnit newCompilationUnit;
NRefactory.SupportedLanguage supportedLanguage;
if (IsVisualBasic)
supportedLanguage = NRefactory.SupportedLanguage.VBNet;
else
supportedLanguage = NRefactory.SupportedLanguage.CSharp;
using (NRefactory.IParser p = NRefactory.ParserFactory.CreateParser(supportedLanguage, textReader)) {
// we only need to parse types and method definitions, no method bodies
// so speed up the parser and make it more resistent to syntax
// errors in methods
p.ParseMethodBodies = false;
p.Parse();
newCompilationUnit = ConvertCompilationUnit(p.CompilationUnit);
}
// Remove information from lastCompilationUnit and add information from newCompilationUnit.
myProjectContent.UpdateCompilationUnit(lastCompilationUnit, newCompilationUnit, DummyFileName);
lastCompilationUnit = newCompilationUnit;
parseInformation = new Dom.ParseInformation(newCompilationUnit);
}
Dom.ICompilationUnit ConvertCompilationUnit(NRefactory.Ast.CompilationUnit cu)
{
Dom.NRefactoryResolver.NRefactoryASTConvertVisitor converter;
converter = new Dom.NRefactoryResolver.NRefactoryASTConvertVisitor(myProjectContent);
cu.AcceptVisitor(converter, null);
return converter.Cu;
}
}
}

191
samples/CSharpCodeCompletion/MainForm.resx

@ -1,191 +0,0 @@ @@ -1,191 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>128, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk
DQAAAk1TRnQBSQFMAgEBBwEAAQkBAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/9UAAg4DAAEQAQ4JAAEb
AXMBXxoACV8JAAEPAQ4FAAEQAQ4IAAHvAXUBKwFfGAABGgNuBEoBCAFfCQABEAEOBQABEAEOCQABmQEW
AUsBXxcAAVgFegJZAUoBXwkAARABDgUAARABDgkAAZkBegEWASkBXxYAAVgCmgGRAq4BeQFZAUoBXwkA
AQ8BDgUAAREBDgoAAXQBegEWASkBXxUAAVgBoAKaBHoBSgdfAgABEAEOBwABDwEOBwABcwFLAUoBSwF6
ARYBIgFfFAABWAKgAZECrgJ6AUoBbgRKAQgBXwMAAQ4GAAEPAQ4JAAJ6AZkClAEWASIUAAFYAcMCoAKa
AnoBSgJ6A1kBSgFfAwACDgUAARABDgkAAVkB9gF6ARYBSwFfFQABwwRYA1IBeQGRAq4BeQFZAUoBXwMA
Ag4FAAEQAQ4JAAFZAaABegGUARYBSwFfGgABWAGgApoEegFKAV8DAAEQAQ4FAAEQAQ8KAAFZAfYBegGU
ARYBSgFfGQABWAKgAZECrgJ6AUoBXwQAAREBDgMAARABDwsAAVkBoAF6AXkBlAEWARQBXxgAAVgBwwKg
ApoCegFKAV8XAAGZA3kCdAGZGAABwwRYA1IBGj0AAQYBXz0AAgYBawFfEgAMXx0AAQYBgQG4AQYBawFf
EAABrgtmAV8cAAFfAYEC/gG4AQYBaxAAAZEB/wL0AfIB8QPdAQkBuwFmAV8bAAPtAYEC/gG4AQYQAAGu
Af8B9wHtAf8C9wLtARkBuwFmAV8bAAGSAV8CAAEGAf4BaxEAAZEG/wH0AhkBuwFmAV8NAAFrAV8MAAH3
AV8CAAFiAQYNAAEMAV8DAAGRAf8C7QH/AvcB7QGRARkBBwFmAV8FAAGgARoBmQHvAfcCAAJrAQ0BXwYA
ASkBXwMAAfcBXwEAA2IBXwMAAaABGgGZAe8B9wMAAWEBDAFnAV8CAAHtCP8B9AEHAWYBXwsAAWsBBgFr
AQYBDQFfBAABAwIpAV8CAAGSAV8BYgGDAYQCYgFfCQADYQEFAWEBXwEAAfcB/wG8ARkB/wEJAbwB7wFK
Af8BvAFmAV8CAAFfAqACmQHvAfcBAAEGAoEBawEGAWsBSAFfAgABUQEDATcBAwEpAV8BAAHtAV8BBQH9
AX8BhAFiAQUCoAKZAe8B9wIAAWEDBQFhAQUBYQFfAfcB/wHzAUsB8wH/AbwBSgFYAQ8BvAGLA18BZgYA
AgYBgQEGAYEBawEGAWsBDQFfAlEB+wI3AQMCbQHrAe0B9wGCAf0BfwGEAWIHAAEFAYMBBQKDAQUDYQHV
Ad0BHAF6AUoB7QFKAXkBSgFZAg8BIgHsAWYBrgGgAQABmQHvAbQBAAIGAYECuAGBAWsBBgFrAQ0BUQP7
AjcBAwEpAV8DAAGIAf0BggEAAaABAAGZAe8BtAEAAWEBBQGDA6UBgwEFAWEBAAG0AdwBCQEcAXoBSgF6
AUoBegFKAVgBUgExAUQBZgGuBwABBgS4AYEDBgEAAVED+wI3AQMFAAGICQABYQSlAYMBYQIAAbQB1QG0
AQkBHAF6AUoBmgFKAnoCWQEyAa4BzwgAAZABuQK4AYEBBgFrAwABUQP7AQMRAAFhA6UBBQcAAfQBHAF6
AUoBoAN6AlkBjAHPCQABkAG5AbgBgQEGBQABUQH7AVETAAEMAaUBgwkAAfQBHAF6AqACegF5AewB7wG1
CgABBgG4AQYHAAFRFQABYQsAAfQDHAPsAbwB9wHvCwABBgQAAUIBTQE+BwABPgMAASgDAAFAAwABIAMA
AQEBAAEBBgABARYAA/8BAAb/AgAG/wIABv8CAAL/AfMBnwHxAf8CAAGAAT8B5wHPAfAB/wMAAT8B5wHP
AfgBfwMAAT8B5wHPAfgBPwMAAT8B5wHPAfwBHwQAAc8B5wHwAQ8EAAHnAc8B+AEPBAAB5wHPAfgBHwQA
AecBzwH4AQ8CAAH8AQAB5wHPAfwBBwIAAfwBAAHzAZ8B/AEDAgAB/AEAAv8B/gEDAgAB/AEBBP8CAAH/
AfMH/wHhAv8BgAEHA/8BwAL/AQABBwP/AYAC/wEAAQcD/wEAAv8BAAEHA/8BMQL/AQABBwH/Ac8B/wEz
Af8B5wEAAQcBwQGHAecBIQHBAcMBAAEHAf8BAwHDAQAB/wGBAQABBgECAQEBgQEAAQMDAAH8AwAB/gMA
AUQCAAFxAUQBAQIAAf4BAAGAAfsB/gEDAgAB/wEBAcEC/wEHAfABAAH/AYMB4wL/AY8B+AEAAf8BxwH3
Av8B3wH8AQAB/wHvCw==
</value>
</data>
</root>

150
samples/CSharpCodeCompletion/ToolTipProvider.cs

@ -1,150 +0,0 @@ @@ -1,150 +0,0 @@
// CSharp Editor Example with Code Completion
// Copyright (c) 2007, Daniel Grunwald
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// - Neither the name of the ICSharpCode team nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Text;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Dom.CSharp;
using ICSharpCode.SharpDevelop.Dom.VBNet;
using TextEditor = ICSharpCode.TextEditor;
using NRefactoryResolver = ICSharpCode.SharpDevelop.Dom.NRefactoryResolver.NRefactoryResolver;
namespace CSharpEditor
{
sealed class ToolTipProvider
{
MainForm mainForm;
TextEditor.TextEditorControl editor;
private ToolTipProvider(MainForm mainForm, TextEditor.TextEditorControl editor)
{
this.mainForm = mainForm;
this.editor = editor;
}
public static void Attach(MainForm mainForm, TextEditor.TextEditorControl editor)
{
ToolTipProvider tp = new ToolTipProvider(mainForm, editor);
editor.ActiveTextAreaControl.TextArea.ToolTipRequest += tp.OnToolTipRequest;
}
void OnToolTipRequest(object sender, TextEditor.ToolTipRequestEventArgs e)
{
if (e.InDocument && !e.ToolTipShown) {
IExpressionFinder expressionFinder;
if (MainForm.IsVisualBasic) {
expressionFinder = new VBExpressionFinder();
} else {
expressionFinder = new CSharpExpressionFinder(mainForm.parseInformation);
}
ExpressionResult expression = expressionFinder.FindFullExpression(
editor.Text,
editor.Document.PositionToOffset(e.LogicalPosition));
if (expression.Region.IsEmpty) {
expression.Region = new DomRegion(e.LogicalPosition.Line + 1, e.LogicalPosition.Column + 1);
}
TextEditor.TextArea textArea = editor.ActiveTextAreaControl.TextArea;
NRefactoryResolver resolver = new NRefactoryResolver(mainForm.myProjectContent.Language);
ResolveResult rr = resolver.Resolve(expression,
mainForm.parseInformation,
textArea.MotherTextEditorControl.Text);
string toolTipText = GetText(rr);
if (toolTipText != null) {
e.ShowToolTip(toolTipText);
}
}
}
static string GetText(ResolveResult result)
{
if (result == null) {
return null;
}
if (result is MixedResolveResult)
return GetText(((MixedResolveResult)result).PrimaryResult);
IAmbience ambience = MainForm.IsVisualBasic ? (IAmbience)new VBNetAmbience() : new CSharpAmbience();
ambience.ConversionFlags = ConversionFlags.StandardConversionFlags | ConversionFlags.ShowAccessibility;
if (result is MemberResolveResult) {
return GetMemberText(ambience, ((MemberResolveResult)result).ResolvedMember);
} else if (result is LocalResolveResult) {
LocalResolveResult rr = (LocalResolveResult)result;
ambience.ConversionFlags = ConversionFlags.UseFullyQualifiedTypeNames
| ConversionFlags.ShowReturnType;
StringBuilder b = new StringBuilder();
if (rr.IsParameter)
b.Append("parameter ");
else
b.Append("local variable ");
b.Append(ambience.Convert(rr.Field));
return b.ToString();
} else if (result is NamespaceResolveResult) {
return "namespace " + ((NamespaceResolveResult)result).Name;
} else if (result is TypeResolveResult) {
IClass c = ((TypeResolveResult)result).ResolvedClass;
if (c != null)
return GetMemberText(ambience, c);
else
return ambience.Convert(result.ResolvedType);
} else if (result is MethodGroupResolveResult) {
MethodGroupResolveResult mrr = result as MethodGroupResolveResult;
IMethod m = mrr.GetMethodIfSingleOverload();
if (m != null)
return GetMemberText(ambience, m);
else
return "Overload of " + ambience.Convert(mrr.ContainingType) + "." + mrr.Name;
} else {
return null;
}
}
static string GetMemberText(IAmbience ambience, IEntity member)
{
StringBuilder text = new StringBuilder();
if (member is IField) {
text.Append(ambience.Convert(member as IField));
} else if (member is IProperty) {
text.Append(ambience.Convert(member as IProperty));
} else if (member is IEvent) {
text.Append(ambience.Convert(member as IEvent));
} else if (member is IMethod) {
text.Append(ambience.Convert(member as IMethod));
} else if (member is IClass) {
text.Append(ambience.Convert(member as IClass));
} else {
text.Append("unknown member ");
text.Append(member.ToString());
}
string documentation = member.Documentation;
if (documentation != null && documentation.Length > 0) {
text.Append('\n');
text.Append(CodeCompletionData.XmlDocumentationToText(documentation));
}
return text.ToString();
}
}
}

BIN
samples/CSharpCodeCompletion/readme.rtf

Binary file not shown.

BIN
samples/CodeConverter/AppPoolSettings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

2
samples/CodeConverter/Dependencies/CopyDependencies.build

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
<ItemGroup>
<GenericDeps Include="..\..\..\bin\ICSharpCode.NRefactory.dll"/>
<GenericDeps Include="..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll"/>
<GenericDeps Include="..\..\..\bin\Mono.Cecil.dll"/>
<GenericDeps Include="..\..\..\bin\ICSharpCode.AvalonEdit.dll"/>
<GenericDeps Include="..\..\..\bin\log4net.dll"/>
@ -10,6 +11,7 @@ @@ -10,6 +11,7 @@
<BooDeps Include="..\..\..\AddIns\BackendBindings\BooBinding\Boo.Lang.Compiler.dll"/>
<BooDeps Include="..\..\..\AddIns\BackendBindings\BooBinding\NRefactoryToBooConverter.dll"/>
<PyDeps Include="..\..\..\bin\ICSharpCode.Scripting.dll"/>
<PyDeps Include="..\..\..\AddIns\BackendBindings\PythonBinding\PythonBinding.dll"/>
<IrDeps Include="..\..\..\AddIns\BackendBindings\RubyBinding\RubyBinding.dll"/>

6
samples/CodeConverter/DeploymentNotes.txt

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
If you get the following error:
Could not load file or assembly 'PythonBinding' or one of its dependencies. An attempt was made to load a program with an incorrect format.
See AppPoolSettings.png (DLR languages are compiled to x86, which, on x64 IIS leads to aforementioned error message)

13
samples/CodeConverter/Source/CCSite/CCSite.csproj

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -13,7 +14,7 @@ @@ -13,7 +14,7 @@
<AssemblyName>CCSite</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<OldToolsVersion>4.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
@ -179,8 +180,16 @@ @@ -179,8 +180,16 @@
<Name>ICSharpCode.CodeConversion</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Properties\PublishProfiles\Local Profile.pubxml" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

20
samples/CodeConverter/Source/CCSite/Properties/PublishProfiles/Local Profile.pubxml

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>True</EnableUpdateable>
<DebugSymbols>False</DebugSymbols>
<WDPMergeOption>DonotMerge</WDPMergeOption>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>D:\Temp\Test</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>

4
samples/CodeConverter/Source/CodeConverter.sln

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCSite", "CCSite\CCSite.csproj", "{6597D0F8-916A-45EB-98D1-831064914B77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeConvertServiceClient", "CCClient\CodeConvertServiceClient.csproj", "{93D91711-636F-4796-8572-F043D4CF8FA5}"

6
samples/CodeConverter/Source/ICSharpCode.CodeConversion/ICSharpCode.CodeConversion.csproj

@ -65,10 +65,16 @@ @@ -65,10 +65,16 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Dependencies\ICSharpCode.NRefactory.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.Scripting">
<HintPath>..\..\Dependencies\ICSharpCode.Scripting.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Dom, Version=3.0.0.3091, Culture=neutral, PublicKeyToken=f829da5c02be14ee, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Dependencies\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil">
<HintPath>..\..\Dependencies\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="NRefactoryToBooConverter, Version=3.0.0.3091, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Dependencies\NRefactoryToBooConverter.dll</HintPath>

14
samples/CodonCreation/TestDoozer.cs

@ -55,19 +55,21 @@ namespace CodonCreation @@ -55,19 +55,21 @@ namespace CodonCreation
// BuildItem:
// This method actually builds an object which is used by the add-in
//
// The BuildItem gets following arguments :
// a caller object : this is the object which creates the item
// a codon : the codon read from the .addin file, the doozer
// The BuildItem gets a BuildItemArgs with the following properties :
// Addin : the addin containing the codon
// Caller : this is the object which creates the item
// Codon : the codon read from the .addin file, the doozer
// uses the information in the codon to build
// a custom codon object.
// A arraylist with the subitems : if this codon has subitems in it's path here are the
// Conditions : the conditions applied to this item
// SubitemNode : if this codon has subitems in it's path here are the
// build items stored for these the codon may use these
// or not, if not they get lost, if any were there.
// 'Normal' codons don't need them (then the tree-path is a list)
// But for example menuitems use them.
public object BuildItem(object caller, Codon codon, ArrayList subItems)
public object BuildItem(BuildItemArgs args)
{
return new TestCodon(codon.Properties["text"]);
return new TestCodon(args.Codon.Properties["text"]);
}
}
}

2
samples/CppBackendBinding/CppBackendBinding.addin

@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
<!-- TODO: project option panels -->
</Path>
<Path name = "/SharpDevelop/Workbench/LanguageBindings">
<Path name = "/SharpDevelop/Workbench/ProjectBindings">
<ProjectBinding id = "C++"
guid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
supportedextensions = ".cpp;.c"

6
samples/CppBackendBinding/CppProjectBinding.cs

@ -33,5 +33,11 @@ namespace CppBackendBinding @@ -33,5 +33,11 @@ namespace CppBackendBinding
{
throw new NotImplementedException();
}
public bool HandlingMissingProject {
get {
return false;
}
}
}
}

BIN
samples/CppBackendBinding/readme.rtf

Binary file not shown.

10
samples/DisplayBindings/AlternateEditor/AlternateEditorDisplayBinding.cs

@ -45,5 +45,15 @@ namespace AlternateEditor @@ -45,5 +45,15 @@ namespace AlternateEditor
{
return new Editor(file);
}
public bool IsPreferredBindingForFile(string fileName)
{
return true;
}
public double AutoDetectFileContent(string fileName, Stream fileContent, string detectedMimeType)
{
return 0;
}
}
}

5
samples/DisplayBindings/AlternateEditor/Editor.cs

@ -53,17 +53,18 @@ namespace AlternateEditor @@ -53,17 +53,18 @@ namespace AlternateEditor
}
public Editor(OpenedFile file)
{
{
Files.Add(file);
OnFileNameChanged(file);
file.ForceInitializeView(this);
rtb.Dock = DockStyle.Fill;
rtb.TextChanged += TextChanged;
rtb.TextChanged += TextChanged;
}
public override void Dispose()
{
base.Dispose();
rtb.Dispose();
}

1
samples/DisplayBindings/ImageViewer/ImageViewer.csproj

@ -71,7 +71,6 @@ @@ -71,7 +71,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Src" />
<Folder Include="Resources" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

2
samples/DisplayBindings/ImageViewer/ImageViewer.sln

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.0.0.5571
# SharpDevelop 4.3
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageViewer", "ImageViewer.csproj", "{BECEEB35-A81D-4545-AC8E-BC622451DB99}"
EndProject
Global

10
samples/DisplayBindings/ImageViewer/Src/ImageViewerDisplayBinding.cs

@ -42,5 +42,15 @@ namespace ImageViewer @@ -42,5 +42,15 @@ namespace ImageViewer
ImageViewContent vc = new ImageViewContent(file);
return vc;
}
public bool IsPreferredBindingForFile(string fileName)
{
return true;
}
public double AutoDetectFileContent(string fileName, System.IO.Stream fileContent, string detectedMimeType)
{
return 0;
}
}
}

8
samples/Gallio/Gallio.Extension/Gallio.Extension.csproj

@ -12,14 +12,17 @@ @@ -12,14 +12,17 @@
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<NoWin32Manifest>False</NoWin32Manifest>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<FileAlignment>4096</FileAlignment>
<Prefer32Bit>False</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
@ -28,6 +31,7 @@ @@ -28,6 +31,7 @@
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>

7
samples/Gallio/Gallio.SharpDevelop.Tests/Gallio.SharpDevelop.Tests.csproj

@ -51,16 +51,13 @@ @@ -51,16 +51,13 @@
<Reference Include="ICSharpCode.SharpDevelop.Dom">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Dom">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\..\bin\Tools\NUnit\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="UnitTesting">
<HintPath>..\..\..\AddIns\AddIns\Misc\UnitTesting\UnitTesting.dll</HintPath>
<HintPath>..\..\..\AddIns\Analysis\UnitTesting\UnitTesting.dll</HintPath>
</Reference>
<Reference Include="UnitTesting.Tests">
<HintPath>..\..\..\bin\UnitTests\UnitTesting.Tests.dll</HintPath>
@ -80,7 +77,7 @@ @@ -80,7 +77,7 @@
<Compile Include="GallioEchoConsoleProcessStartInfoTestFixture.cs" />
<Compile Include="GallioTestFailureTestFixture.cs" />
<Compile Include="GallioTestFrameworkIsTestClassTests.cs" />
<Compile Include="GallioTestFrameworkIsTestMethodTests.cs" />
<Compile Include="GallioTestFrameworkIsTestMemberTests.cs" />
<Compile Include="GallioTestFrameworkIsTestProjectTests.cs" />
<Compile Include="GallioTestToSharpDevelopTestResultConversionTests.cs" />
<Compile Include="TestResultsWriterTestFixture.cs" />

42
samples/Gallio/Gallio.SharpDevelop.Tests/GallioTestFrameworkIsTestMethodTests.cs → samples/Gallio/Gallio.SharpDevelop.Tests/GallioTestFrameworkIsTestMemberTests.cs

@ -17,7 +17,7 @@ using UnitTesting.Tests.Utils; @@ -17,7 +17,7 @@ using UnitTesting.Tests.Utils;
namespace Gallio.SharpDevelop.Tests
{
[TestFixture]
public class GallioTestFrameworkIsTestMethodTests
public class GallioTestFrameworkIsTestMemberTests
{
GallioTestFramework testFramework;
@ -28,44 +28,44 @@ namespace Gallio.SharpDevelop.Tests @@ -28,44 +28,44 @@ namespace Gallio.SharpDevelop.Tests
}
[Test]
public void IsTestMethodReturnsFalseWhenMethodHasNoAttributes()
public void IsTestMemberReturnsFalseWhenMethodHasNoAttributes()
{
MockMethod mockMethod = MockMethod.CreateMockMethodWithoutAnyAttributes();
Assert.IsFalse(testFramework.IsTestMethod(mockMethod));
Assert.IsFalse(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsTrueWhenMethodHasTestAttributeWithoutAttributePart()
public void IsTestMemberReturnsTrueWhenMethodHasTestAttributeWithoutAttributePart()
{
MockAttribute testAttribute = new MockAttribute("Test");
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute);
Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
Assert.IsTrue(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsTrueWhenMethodHasTestAttributeAttribute()
public void IsTestMemberReturnsTrueWhenMethodHasTestAttributeAttribute()
{
MockAttribute testAttribute = new MockAttribute("TestAttribute");
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute);
Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
Assert.IsTrue(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsTrueWhenMethodHasFullyQualifiedNUnitTestAttribute()
public void IsTestMemberReturnsTrueWhenMethodHasFullyQualifiedNUnitTestAttribute()
{
MockAttribute testAttribute = new MockAttribute("MbUnit.Framework.TestAttribute");
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute);
Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
Assert.IsTrue(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsFalseWhenMethodIsNull()
public void IsTestMemberReturnsFalseWhenMethodIsNull()
{
Assert.IsFalse(testFramework.IsTestMethod(null));
Assert.IsFalse(testFramework.IsTestMember(null));
}
[Test]
public void IsTestMethodReturnsFalseWhenProjectContentLanguageHasNullNameComparer()
public void IsTestMemberReturnsFalseWhenProjectContentLanguageHasNullNameComparer()
{
IProject project = new MockCSharpProject();
MockProjectContent mockProjectContent = new MockProjectContent();
@ -75,7 +75,7 @@ namespace Gallio.SharpDevelop.Tests @@ -75,7 +75,7 @@ namespace Gallio.SharpDevelop.Tests
MockMethod mockMethod = new MockMethod(mockClass);
mockMethod.Attributes.Add(new MockAttribute("Test"));
Assert.IsFalse(testFramework.IsTestMethod(mockMethod));
Assert.IsFalse(testFramework.IsTestMember(mockMethod));
}
/// <summary>
@ -83,26 +83,26 @@ namespace Gallio.SharpDevelop.Tests @@ -83,26 +83,26 @@ namespace Gallio.SharpDevelop.Tests
/// flagged as a TestMethod.
/// </summary>
[Test]
public void IsTestMethodReturnsTrueWhenProjectIsNull()
public void IsTestMemberReturnsTrueWhenProjectIsNull()
{
MockAttribute testAttribute = new MockAttribute("Test");
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute);
MockProjectContent mockProjectContent = (MockProjectContent)mockMethod.DeclaringType.ProjectContent;
mockProjectContent.Project = null;
Assert.IsTrue(testFramework.IsTestMethod(mockMethod));
Assert.IsTrue(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsFalseWhenMethodHasNullDeclaringType()
public void IsTestMemberReturnsFalseWhenMethodHasNullDeclaringType()
{
MockMethod mockMethod = new MockMethod(new MockClass());
Assert.IsFalse(testFramework.IsTestMethod(mockMethod));
Assert.IsFalse(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsFalseWhenMethodHasNullLanguage()
public void IsTestMemberReturnsFalseWhenMethodHasNullLanguage()
{
IProject project = new MockCSharpProject();
MockProjectContent mockProjectContent = new MockProjectContent();
@ -110,18 +110,18 @@ namespace Gallio.SharpDevelop.Tests @@ -110,18 +110,18 @@ namespace Gallio.SharpDevelop.Tests
MockClass mockClass = new MockClass(mockProjectContent);
MockMethod mockMethod = new MockMethod(mockClass);
Assert.IsFalse(testFramework.IsTestMethod(mockMethod));
Assert.IsFalse(testFramework.IsTestMember(mockMethod));
}
[Test]
public void IsTestMethodReturnsFalseWhenMethodHasHasParameters()
public void IsTestMemberReturnsFalseWhenMethodHasHasParameters()
{
MockAttribute testAttribute = new MockAttribute("Test");
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute);
MockParameter mockParameter = new MockParameter();
mockMethod.Parameters.Add(mockParameter);
Assert.IsFalse(testFramework.IsTestMethod(mockMethod));
Assert.IsFalse(testFramework.IsTestMember(mockMethod));
}
}
}

3
samples/Gallio/Gallio.SharpDevelop/Gallio.SharpDevelop.csproj

@ -58,8 +58,7 @@ @@ -58,8 +58,7 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="UnitTesting">
<HintPath>..\..\..\AddIns\AddIns\Misc\UnitTesting\UnitTesting.dll</HintPath>
<Private>False</Private>
<HintPath>..\..\..\AddIns\Analysis\UnitTesting\UnitTesting.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

19
samples/Gallio/Gallio.SharpDevelop/GallioTestFramework.cs

@ -6,6 +6,9 @@ @@ -6,6 +6,9 @@
// </file>
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.UnitTesting;
@ -78,12 +81,26 @@ namespace Gallio.SharpDevelop @@ -78,12 +81,26 @@ namespace Gallio.SharpDevelop
return null;
}
public bool IsTestMember(IMember member)
{
var method = member as IMethod;
if (method != null) {
return IsTestMethod(method);
}
return false;
}
public IEnumerable<TestMember> GetTestMembersFor(IClass c)
{
return c.Methods.Where(IsTestMethod).Select(member => new TestMember(member));
}
/// <summary>
/// Determines whether the method is a test method. A method
/// is considered to be a test method if it contains the NUnit Test attribute.
/// If the method has parameters it cannot be a test method.
/// </summary>
public bool IsTestMethod(IMember member)
bool IsTestMethod(IMember member)
{
if (member == null) {
return false;

2
samples/LineCounter/LineCounter.addin

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<Manifest>
<Identity name="Grunwald.LineCounter"/>
<Dependency addin="SharpDevelop" version="4.0"/>
<Dependency addin="SharpDevelop" version="4.3"/>
</Manifest>
<Runtime>

8
samples/LineCounter/Src/Extensibility.cs

@ -68,11 +68,11 @@ namespace LineCounterAddin @@ -68,11 +68,11 @@ namespace LineCounterAddin
}
}
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems)
public object BuildItem(BuildItemArgs args)
{
return new CountingAlgorithmDescriptor(codon.AddIn,
codon.Properties["extensions"],
codon.Properties["class"]);
return new CountingAlgorithmDescriptor(args.Codon.AddIn,
args.Codon.Properties["extensions"],
args.Codon.Properties["class"]);
}
}

3
samples/SdaUser/SdaAddIns/SdaBase.addin

@ -44,6 +44,9 @@ @@ -44,6 +44,9 @@
<!-- REQUIRED to open views -->
<Path name = "/SharpDevelop/Workbench/DisplayBindings">
<DisplayBinding id = "AutoDetect"
title = "Auto-detect file type"
class = "ICSharpCode.SharpDevelop.AutoDetectDisplayBinding"/>
</Path>
<!-- REQUIRED to open views -->

87
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebBehavior.cs

@ -30,6 +30,16 @@ namespace ICSharpCode.AspNet.Mvc @@ -30,6 +30,16 @@ namespace ICSharpCode.AspNet.Mvc
set { SetProjectProperty("StartURL", value); }
}
public string StartArguments {
get { return GetProjectProperty("StartArguments"); }
set { SetProjectProperty("StartArguments", value); }
}
public string StartWorkingDirectory {
get { return GetProjectProperty("StartWorkingDirectory"); }
set { SetProjectProperty("StartWorkingDirectory", value); }
}
string GetProjectProperty(string name)
{
return MSBuildProject.GetEvaluatedProperty(name) ?? String.Empty;
@ -37,7 +47,7 @@ namespace ICSharpCode.AspNet.Mvc @@ -37,7 +47,7 @@ namespace ICSharpCode.AspNet.Mvc
void SetProjectProperty(string name, string value)
{
MSBuildProject.SetProperty("StartProgram", String.IsNullOrEmpty(value) ? null : value);
MSBuildProject.SetProperty(name, String.IsNullOrEmpty(value) ? null : value);
}
MSBuildBasedProject MSBuildProject {
@ -68,38 +78,10 @@ namespace ICSharpCode.AspNet.Mvc @@ -68,38 +78,10 @@ namespace ICSharpCode.AspNet.Mvc
public override void Start(bool withDebugging)
{
if (!CheckWebProjectStartInfo())
return;
try {
WebProjectProperties properties = WebProject.GetWebProjectProperties();
string processName = WebProjectService.GetWorkerProcessName(properties);
// try find the worker process directly or using the process monitor callback
List<Process> processes = System.Diagnostics.Process.GetProcesses().ToList();
int index = processes.FindIndex(p => p.ProcessName.Equals(processName, StringComparison.OrdinalIgnoreCase));
if (index > -1) {
if (withDebugging)
DebuggerService.CurrentDebugger.Attach(processes[index]);
} else {
if (properties.UseIISExpress) {
// start IIS express and attach to it
if (WebProjectService.IsIISExpressInstalled) {
ProcessStartInfo processInfo = IISExpressProcessStartInfo.Create(WebProject);
DebuggerService.CurrentDebugger.Start(processInfo);
} else {
DisposeProcessMonitor();
MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.NoProjectUrlOrProgramAction}");
return;
}
} else {
DisposeProcessMonitor();
this.monitor = new ProcessMonitor(processName);
this.monitor.ProcessCreated += delegate {
SD.MainThread.InvokeIfRequired((Action)(() => OnProcessCreated(properties, withDebugging)));
};
this.monitor.Start();
}
if (CheckWebProjectStartInfo()) {
AttachToWebWorkerProcessOrStartIISExpress(properties, withDebugging);
}
// start default application(e.g. browser) or the one specified
@ -113,7 +95,12 @@ namespace ICSharpCode.AspNet.Mvc @@ -113,7 +95,12 @@ namespace ICSharpCode.AspNet.Mvc
}
break;
case StartAction.Program:
Process.Start(StartProgram);
ProcessStartInfo processInfo = DotNetStartBehavior.CreateStartInfo(StartProgram, Project.Directory, StartWorkingDirectory, StartArguments);
if (withDebugging) {
DebuggerService.CurrentDebugger.Start(processInfo);
} else {
Process.Start(processInfo);
}
break;
case StartAction.StartURL:
if (FileUtility.IsUrl(StartUrl)) {
@ -139,20 +126,50 @@ namespace ICSharpCode.AspNet.Mvc @@ -139,20 +126,50 @@ namespace ICSharpCode.AspNet.Mvc
}
}
void AttachToWebWorkerProcessOrStartIISExpress(WebProjectProperties properties, bool withDebugging)
{
string processName = WebProjectService.GetWorkerProcessName(properties);
// try find the worker process directly or using the process monitor callback
Process[] processes = System.Diagnostics.Process.GetProcesses();
int index = Array.FindIndex(processes, p => p.ProcessName.Equals(processName, StringComparison.OrdinalIgnoreCase));
if (index > -1) {
if (withDebugging)
DebuggerService.CurrentDebugger.Attach(processes[index]);
} else {
if (properties.UseIISExpress) {
// start IIS express and attach to it
if (WebProjectService.IsIISExpressInstalled) {
ProcessStartInfo processInfo = IISExpressProcessStartInfo.Create(WebProject);
if (withDebugging)
DebuggerService.CurrentDebugger.Start(processInfo);
else
Process.Start(processInfo);
}
} else {
DisposeProcessMonitor();
this.monitor = new ProcessMonitor(processName);
this.monitor.ProcessCreated += delegate {
WorkbenchSingleton.SafeThreadCall((Action)(() => OnProcessCreated(properties, withDebugging)));
};
this.monitor.Start();
}
}
}
bool CheckWebProjectStartInfo()
{
if (WebProject.HasWebProjectProperties() && WebProject.GetWebProjectProperties().IsConfigured()) {
return true;
}
MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.NoProjectUrlOrProgramAction}");
return false;
}
void OnProcessCreated(WebProjectProperties properties, bool withDebugging)
{
string processName = WebProjectService.GetWorkerProcessName(properties);
List<Process> processes = Process.GetProcesses().ToList();
int index = processes.FindIndex(p => p.ProcessName.Equals(processName, StringComparison.OrdinalIgnoreCase));
Process[] processes = Process.GetProcesses();
int index = Array.FindIndex(processes, p => p.ProcessName.Equals(processName, StringComparison.OrdinalIgnoreCase));
if (index == -1)
return;
if (withDebugging) {

27
src/AddIns/BackendBindings/AspNet.Mvc/Project/Src/WebProjectOptions/WebProjectOptionsPanel.xaml.cs

@ -30,16 +30,13 @@ namespace ICSharpCode.AspNet.Mvc @@ -30,16 +30,13 @@ namespace ICSharpCode.AspNet.Mvc
CreateWebProject(project);
if (!WebProjectService.IsIISOrIISExpressInstalled) {
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WebProjectOptionsPanel.IISNotFound");
return;
}
if (properties.UseIISExpress) {
if (WebProjectService.IsIISExpressInstalled) {
UseIISExpress.IsChecked = true;
PortTextBox.Text = properties.DevelopmentServerPort.ToString();
ProjectUrl.Text = String.Empty;
SelectIISExpress();
}
if (properties.UseIISExpress) {
UseIISExpress.IsChecked = true;
PortTextBox.Text = properties.DevelopmentServerPort.ToString();
ProjectUrl.Text = String.Empty;
SelectIISExpress();
} else if (properties.UseIIS) {
if (WebProjectService.IISVersion != IISVersion.None) {
UseLocalIIS.IsChecked = true;
@ -101,13 +98,12 @@ namespace ICSharpCode.AspNet.Mvc @@ -101,13 +98,12 @@ namespace ICSharpCode.AspNet.Mvc
bool isIISExpressInstalled = WebProjectService.IsIISExpressInstalled;
if (!isIISExpressInstalled) {
UseIISExpress.IsChecked = false;
properties.UseIISExpress = false;
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WebProjectOptionsPanel.IISNotFound");
} else {
StatusLabel.Text = String.Empty;
}
IISExpressGroup.IsEnabled = CreateVirtualDirectoryButton.IsEnabled = isIISExpressInstalled;
IISExpressGroup.IsEnabled = true;
CreateVirtualDirectoryButton.IsEnabled = isIISExpressInstalled;
LocalIISGroup.IsEnabled = false;
}
@ -126,13 +122,12 @@ namespace ICSharpCode.AspNet.Mvc @@ -126,13 +122,12 @@ namespace ICSharpCode.AspNet.Mvc
if (!isIISInstalled) {
StatusLabel.Text = ResourceService.GetString("ICSharpCode.WebProjectOptionsPanel.IISNotFound");
ProjectUrl.Text = String.Empty;
UseLocalIIS.IsChecked = false;
} else {
StatusLabel.Text = String.Empty;
ProjectUrl.Text = properties.IISUrl;
}
LocalIISGroup.IsEnabled = CreateVirtualDirectoryButton.IsEnabled = isIISInstalled;
LocalIISGroup.IsEnabled = true;
CreateVirtualDirectoryButton.IsEnabled = isIISInstalled;
IISExpressGroup.IsEnabled = false;
}
@ -181,7 +176,9 @@ namespace ICSharpCode.AspNet.Mvc @@ -181,7 +176,9 @@ namespace ICSharpCode.AspNet.Mvc
void PortTextBox_KeyUp(object sender, KeyEventArgs e)
{
properties.DevelopmentServerPort = Int32.Parse(PortTextBox.Text);
int port;
if (int.TryParse(PortTextBox.Text, out port))
properties.DevelopmentServerPort = port;
properties.IISUrl = String.Format(@"{0}:{1}/", WebBehavior.LocalHost, PortTextBox.Text);
}
}

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

@ -422,6 +422,8 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -422,6 +422,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
void TextAreaCaretPositionChanged(object sender, EventArgs e)
{
if (document == null)
return; // can happen if the editor is closed with Ctrl+F4 while selecting text
Debug.Assert(sender is Caret);
Debug.Assert(!document.IsInUpdate);
if (sender == this.ActiveTextEditor.TextArea.Caret) {

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.2.0.8783</version>
<version>4.3.0.9390</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.2.0.8783" />
<dependency id="AvalonEdit" version="4.3.0.9390" />
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Windows.Forms" />

6
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.2.0.8783</version>
<version>4.3.0.9390</version>
<authors>Daniel Grunwald</authors>
<owners>SharpDevelop</owners>
<licenseUrl>http://www.opensource.org/licenses/lgpl-2.1.php</licenseUrl>
@ -11,9 +11,7 @@ @@ -11,9 +11,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>AvalonEdit is the WPF-based text editor used in SharpDevelop. There are two builds of AvalonEdit included in this package. One that targets .NET 4.0 and one that targets .NET 3.5.</description>
<summary>AvalonEdit is the WPF-based text editor used in SharpDevelop</summary>
<releaseNotes>Improved WPF text rendering performance.
Region tooltips added.
C# syntax highlighting: Do not colorize punctuation.</releaseNotes>
<releaseNotes>AvalonEdit 4.3 adds support for input method editors (IME); and fixes a major bug that sometimes caused "InvalidOperationException: Trying to build visual line from collapsed line" when updating existing foldings.</releaseNotes>
<language>en-US</language>
<tags>WPF Text Editor SharpDevelop AvalonEdit</tags>
</metadata>

3
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardFormatter.cs

@ -128,8 +128,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -128,8 +128,7 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
DateTime date;
if (DateTime.TryParse(toFormat, out date))
{
string str = date.ToString(format,
DateTimeFormatInfo.CurrentInfo);
string str = date.ToString(format,DateTimeFormatInfo.CurrentInfo);
return str.Trim();
}

23
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/Printing/FormattingFixture.cs

@ -19,6 +19,8 @@ namespace ICSharpCode.Reports.Core.Test.Printing @@ -19,6 +19,8 @@ namespace ICSharpCode.Reports.Core.Test.Printing
private const string stringType = "System.String";
private const string dateTimetype = "System.DateTime";
private const string nullValue ="NullValue";
[Test]
public void String_Is_Not_Formatted()
{
@ -87,6 +89,27 @@ namespace ICSharpCode.Reports.Core.Test.Printing @@ -87,6 +89,27 @@ namespace ICSharpCode.Reports.Core.Test.Printing
Assert.That(result,Is.EqualTo("05:50:10"));
}
[Test]
public void NegativeTimeSpan_HH_mm_ss ()
{
string toFormat = "-5:50:10";
string format = "H:mm:ss";
var result = StandardFormatter.FormatOutput(toFormat,format,dateTimetype,nullValue);
Assert.That(result,Is.EqualTo("-5:50:10"));
}
[Test]
public void TimeSpan_HH_mm ()
{
string toFormat = "5:50:10";
string format = "HH:mm";
var result = StandardFormatter.FormatOutput(toFormat,format,dateTimetype,nullValue);
Assert.That(result,Is.EqualTo("05:50"));
}
[Test]
public void TimeSpan_H_mm_ss ()
{

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ReportingLanguage/DateTimeFunctionsFixture.cs

@ -51,7 +51,7 @@ namespace ICSharpCode.Reports.Core.Test.ReportingLanguage.LanguageTests @@ -51,7 +51,7 @@ namespace ICSharpCode.Reports.Core.Test.ReportingLanguage.LanguageTests
{
const string expression = "dateSubtract('09.02.2013','10.02.2013')";
IExpression expr = CreateExpression(expression);
Assert.That(expr.Evaluate(null), Is.EqualTo(new TimeSpan(1,0,0,0)));
Assert.That(expr.Evaluate(null), Is.EqualTo(new TimeSpan(-1,0,0,0)));
}
[Test]

2
src/AddIns/Misc/SharpRefactoring/Project/Src/MethodExtractorBase.cs

@ -137,6 +137,8 @@ namespace SharpRefactoring @@ -137,6 +137,8 @@ namespace SharpRefactoring
protected bool IsInCurrentSelection(Location location)
{
if (location.IsEmpty)
return false;
return IsInCurrentSelection(textEditor.Document.PositionToOffset(location.Line, location.Column));
}

188
src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{850b6602-0a7f-413a-864a-e816b98d7407}</ProjectGuid>
<SHFBSchemaVersion>1.9.3.0</SHFBSchemaVersion>
<SHFBSchemaVersion>1.9.5.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
Studio adds them anyway -->
<AssemblyName>Documentation</AssemblyName>
@ -31,114 +31,92 @@ @@ -31,114 +31,92 @@
</WorkingPath>
<BuildLogFile>
</BuildLogFile>
<FrameworkVersion>.NET 4.0.30319</FrameworkVersion>
<FrameworkVersion>.NET Framework 4.0</FrameworkVersion>
<HelpTitle>AvalonEdit</HelpTitle>
<CopyrightText>Copyright 2008-2012, Daniel Grunwald</CopyrightText>
<CopyrightText>Copyright 2008-2013, Daniel Grunwald</CopyrightText>
<PresentationStyle>Prototype</PresentationStyle>
<HelpFileVersion>4.2.0.0</HelpFileVersion>
<ComponentConfigurations>
<ComponentConfig id="Code Block Component" enabled="True">
<component id="Code Block Component" type="SandcastleBuilder.Components.CodeBlockComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Base path for relative filenames in source attributes
(optional) -->
<basePath value="{@HtmlEncProjectFolder}" />
<!-- Connect to language filter (optional). If omitted,
language filtering is enabled by default. -->
<languageFilter value="true" />
<!-- Allow missing source files (Optional). If omitted,
it will generate errors if referenced source files
are missing. -->
<allowMissingSource value="false" />
<!-- Remove region markers from imported code blocks. If omitted,
region markers in imported code blocks are left alone. -->
<removeRegionMarkers value="false" />
<!-- Code colorizer options (required).
Attributes:
Language syntax configuration file (required)
XSLT style file (required)
"Copy" image file URL (required)
Default language (optional)
Enable line numbering (optional)
Enable outlining (optional)
Keep XML comment "see" tags within the code (optional)
Tab size override (optional, 0 = Use syntax file setting)
Use language name as default title (optional) -->
<colorizer syntaxFile="{@SHFBFolder}Colorizer\highlight.xml" styleFile="{@SHFBFolder}Colorizer\highlight.xsl" copyImageUrl="../icons/CopyCode.gif" language="cs" numberLines="false" outlining="false" keepSeeTags="false" tabSize="0" defaultTitle="true" />
</component>
<!-- Base path for relative filenames in source attributes (optional) -->
<basePath value="{@HtmlEncProjectFolder}" />
<!-- Base output paths for the files (required). These should match the parent folder of the output path
of the HTML files (see each of the SaveComponent instances in the configuration files). -->
<outputPaths>
{@HelpFormatOutputPaths}
</outputPaths>
<!-- Allow missing source files (Optional). If omitted, it will generate errors if referenced source files
are missing. -->
<allowMissingSource value="false" />
<!-- Remove region markers from imported code blocks. If omitted, region markers in imported code blocks
are left alone. -->
<removeRegionMarkers value="false" />
<!-- Code colorizer options (required).
Attributes:
Language syntax configuration file (required)
XSLT stylesheet file (required)
CSS stylesheet file (required)
Script file (required)
Disabled (optional, leading whitespace normalization only)
Default language (optional)
Enable line numbering (optional)
Enable outlining (optional)
Keep XML comment "see" tags within the code (optional)
Tab size override (optional, 0 = Use syntax file setting)
Use language name as default title (optional) -->
<colorizer syntaxFile="{@SHFBFolder}Colorizer\highlight.xml" styleFile="{@SHFBFolder}Colorizer\highlight.xsl" stylesheet="{@SHFBFolder}Colorizer\highlight.css" scriptFile="{@SHFBFolder}Colorizer\highlight.js" disabled="{@DisableCodeBlockComponent}" language="cs" numberLines="false" outlining="false" keepSeeTags="false" tabSize="0" defaultTitle="true" />
</component>
</ComponentConfig>
<ComponentConfig id="IntelliSense Component" enabled="True">
<component id="IntelliSense Component" type="SandcastleBuilder.Components.IntelliSenseComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Output options (optional)
Attributes:
Include Namespaces (false by default)
Namespaces filename ("Namespaces" if not specified or empty)
Directory (current folder if not specified or empty) -->
<output includeNamespaces="false" namespacesFile="Namespaces" folder="{@OutputFolder}" />
</component>
</ComponentConfig>
<ComponentConfig id="Cached MSDN URL References" enabled="True">
<component id="Cached MSDN URL References" type="SandcastleBuilder.Components.CachedResolveReferenceLinksComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll" locale="{@Locale}" linkTarget="{@SdkLinkTarget}">
<helpOutput format="HtmlHelp1">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@HtmlSdkLinkType}" />
<targets files="reflection.xml" type="Local" />
</helpOutput>
<helpOutput format="MSHelp2">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@MSHelp2SdkLinkType}" />
<targets files="reflection.xml" type="Index" />
</helpOutput>
<helpOutput format="MSHelpViewer">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@MSHelpViewerSdkLinkType}" />
<targets files="reflection.xml" type="Id" />
</helpOutput>
<helpOutput format="Website">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@WebsiteSdkLinkType}" />
<targets files="reflection.xml" type="Local" />
</helpOutput>
</component>
</ComponentConfig>
<ComponentConfig id="Post-transform Component" enabled="True">
<component id="Post-transform Component" type="SandcastleBuilder.Components.PostTransformComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Code colorizer files (required).
Attributes:
Stylesheet file (required)
Script file (required)
"Copy" image file (required) -->
<colorizer stylesheet="{@SHFBFolder}Colorizer\highlight.css" scriptFile="{@SHFBFolder}Colorizer\highlight.js" copyImage="{@SHFBFolder}Colorizer\CopyCode.gif" />
<!-- Base output paths for the files (required). These should match
the parent folder of the output path of the HTML files (see
each of the SaveComponent instances below). -->
<outputPaths>
{@HelpFormatOutputPaths}
</outputPaths>
<!-- Logo image file (optional). Filename is required. The height,
width, altText, placement, and alignment attributes are
optional. -->
<logoFile filename="" height="0" width="0" altText="" placement="left" alignment="left" />
</component>
</ComponentConfig>
<ComponentConfig id="Cached Reflection Index Data" enabled="True">
<component id="Cached Reflection Index Data" type="SandcastleBuilder.Components.CachedCopyFromIndexComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<index name="reflection" value="/reflection/apis/api" key="@id" cache="10">
<cache base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" cacheFile="{@LocalDataFolder}Cache\Reflection.cache" />
<data files="reflection.xml" />
</index>
<copy name="reflection" source="*" target="/document/reference" />
</component>
</ComponentConfig>
<ComponentConfig id="Cached Framework Comments Index Data" enabled="True">
<component id="Cached Framework Comments Index Data" type="SandcastleBuilder.Components.CachedCopyFromIndexComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<index name="comments" value="/doc/members/member" key="@name" cache="100">
{@CachedFrameworkCommentList}
{@CommentFileList}
</index>
<copy name="comments" source="*" target="/document/comments" />
</component>
</ComponentConfig>
</ComponentConfigurations>
<ComponentConfig id="IntelliSense Component" enabled="True"><component id="IntelliSense Component" type="SandcastleBuilder.Components.IntelliSenseComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Output options (optional)
Attributes:
Include Namespaces (false by default)
Namespaces filename ("Namespaces" if not specified or empty)
Directory (current folder if not specified or empty) -->
<output includeNamespaces="false" namespacesFile="Namespaces" folder="{@OutputFolder}" />
</component></ComponentConfig>
<ComponentConfig id="Cached Framework Comments Index Data" enabled="True"><component id="Cached Framework Comments Index Data" type="SandcastleBuilder.Components.CachedCopyFromIndexComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<index name="comments" value="/doc/members/member" key="@name" cache="100">
{@CachedFrameworkCommentList}
{@CommentFileList}
</index>
<copy name="comments" source="*" target="/document/comments" />
</component></ComponentConfig>
<ComponentConfig id="Cached Reflection Index Data" enabled="True"><component id="Cached Reflection Index Data" type="SandcastleBuilder.Components.CachedCopyFromIndexComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<index name="reflection" value="/reflection/apis/api" key="@id" cache="10">
<cache base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" cacheFile="{@LocalDataFolder}Cache\Reflection.cache" />
<data files="reflection.xml" />
</index>
<copy name="reflection" source="*" target="/document/reference" />
</component></ComponentConfig>
<ComponentConfig id="API Token Resolution" enabled="True"><component id="API Token Resolution" type="Microsoft.Ddue.Tools.SharedContentComponent" assembly="{@SandcastlePath}ProductionTools\BuildComponents.dll">
{@TokenFiles}
<replace elements="/*//token" item="string(.)" />
</component></ComponentConfig>
<ComponentConfig id="Cached MSDN URL References" enabled="True"><component id="Cached MSDN URL References" type="SandcastleBuilder.Components.CachedResolveReferenceLinksComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll" locale="{@Locale}" linkTarget="{@SdkLinkTarget}">
<helpOutput format="HtmlHelp1">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@HtmlSdkLinkType}" />
<targets files="reflection.xml" type="Local" />
</helpOutput>
<helpOutput format="MSHelp2">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@MSHelp2SdkLinkType}" />
<targets files="reflection.xml" type="Index" />
</helpOutput>
<helpOutput format="MSHelpViewer">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@MSHelpViewerSdkLinkType}" />
<targets files="reflection.xml" type="Id" />
</helpOutput>
<helpOutput format="Website">
<cache filename="{@LocalDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@WebsiteSdkLinkType}" />
<targets files="reflection.xml" type="Local" />
</helpOutput>
</component></ComponentConfig></ComponentConfigurations>
<DocumentationSources>
<DocumentationSource sourceFile="..\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj" />
</DocumentationSources>
@ -162,6 +140,12 @@ Additionally, the class HighlightingColorizer provides integration of the highli @@ -162,6 +140,12 @@ Additionally, the class HighlightingColorizer provides integration of the highli
</NamespaceSummaries>
<CleanIntermediates>True</CleanIntermediates>
<SyntaxFilters>Standard</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
<RootNamespaceContainer>False</RootNamespaceContainer>
<Preliminary>False</Preliminary>
<NamingMethod>Guid</NamingMethod>
<Language>en-US</Language>
<ContentPlacement>AboveNamespaces</ContentPlacement>
</PropertyGroup>
<!-- There are no properties for these two groups but they need to appear in
order for Visual Studio to perform the build. -->

18
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegment.cs

@ -121,6 +121,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -121,6 +121,7 @@ namespace ICSharpCode.AvalonEdit.Document
} else {
nodeLength = value;
}
OnSegmentChanged();
}
}
}
@ -156,12 +157,23 @@ namespace ICSharpCode.AvalonEdit.Document @@ -156,12 +157,23 @@ namespace ICSharpCode.AvalonEdit.Document
set {
if (value < 0)
throw new ArgumentOutOfRangeException("value", "Length must not be negative");
segmentLength = value;
if (ownerTree != null)
ownerTree.UpdateAugmentedData(this);
if (segmentLength != value) {
segmentLength = value;
if (ownerTree != null)
ownerTree.UpdateAugmentedData(this);
OnSegmentChanged();
}
}
}
/// <summary>
/// This method gets called when the StartOffset/Length/EndOffset properties are set.
/// It is not called when StartOffset/Length/EndOffset change due to document changes
/// </summary>
protected virtual void OnSegmentChanged()
{
}
internal TextSegment LeftMost {
get {
TextSegment node = this;

3
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs

@ -140,7 +140,8 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -140,7 +140,8 @@ namespace ICSharpCode.AvalonEdit.Editing
TextViewPosition oldPosition = textArea.Caret.Position;
MoveCaret(textArea, direction);
textArea.Selection = textArea.Selection.StartSelectionOrSetEndpoint(oldPosition, textArea.Caret.Position);
textArea.Caret.BringCaretToView();
if (!textArea.Document.IsInUpdate) // if we're inside a larger update (e.g. called by EditingCommandHandler.OnDelete()), avoid calculating the caret rectangle now
textArea.Caret.BringCaretToView();
}
};
}

30
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs

@ -76,21 +76,15 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -76,21 +76,15 @@ namespace ICSharpCode.AvalonEdit.Editing
public const int WM_IME_SETCONTEXT = 0x281;
public const int WM_INPUTLANGCHANGE = 0x51;
// [DllImport("imm32.dll")]
// public static extern IntPtr ImmCreateContext();
//
// [DllImport("imm32.dll")]
// [return: MarshalAs(UnmanagedType.Bool)]
// public static extern bool ImmDestroyContext(IntPtr hIMC);
// [DllImport("imm32.dll")]
// public static extern IntPtr ImmAssociateContext(IntPtr hWnd, IntPtr hIMC);
[DllImport("imm32.dll")]
static extern IntPtr ImmGetContext(IntPtr hWnd);
public static extern IntPtr ImmAssociateContext(IntPtr hWnd, IntPtr hIMC);
[DllImport("imm32.dll")]
internal static extern IntPtr ImmGetContext(IntPtr hWnd);
[DllImport("imm32.dll")]
internal static extern IntPtr ImmGetDefaultIMEWnd(IntPtr hWnd);
[DllImport("imm32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool ImmReleaseContext(IntPtr hWnd, IntPtr hIMC);
internal static extern bool ImmReleaseContext(IntPtr hWnd, IntPtr hIMC);
[DllImport("imm32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool ImmNotifyIME(IntPtr hIMC, int dwAction, int dwIndex, int dwValue = 0);
@ -124,18 +118,6 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -124,18 +118,6 @@ namespace ICSharpCode.AvalonEdit.Editing
return ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL);
}
public static IntPtr GetContext(HwndSource source)
{
if (source == null)
return IntPtr.Zero;
return ImmGetContext(source.Handle);
}
public static bool ReleaseContext(HwndSource source, IntPtr hIMC)
{
return source != null && hIMC != IntPtr.Zero && ImmReleaseContext(source.Handle, hIMC);
}
public static bool SetCompositionWindow(HwndSource source, IntPtr hIMC, TextArea textArea)
{
if (textArea == null)

91
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/ImeSupport.cs

@ -24,53 +24,89 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -24,53 +24,89 @@ namespace ICSharpCode.AvalonEdit.Editing
{
readonly TextArea textArea;
IntPtr currentContext;
//IntPtr previousContext;
IntPtr previousContext;
IntPtr defaultImeWnd;
HwndSource hwndSource;
EventHandler requerySuggestedHandler; // we need to keep the event handler instance alive because CommandManager.RequerySuggested uses weak references
bool isReadOnly;
public ImeSupport(TextArea textArea)
{
if (textArea == null)
throw new ArgumentNullException("textArea");
this.textArea = textArea;
InputMethod.SetIsInputMethodSuspended(this.textArea, true);
InputMethod.SetIsInputMethodSuspended(this.textArea, textArea.Options.EnableImeSupport);
// We listen to CommandManager.RequerySuggested for both caret offset changes and changes to the set of read-only sections.
// This is because there's no dedicated event for read-only section changes; but RequerySuggested needs to be raised anyways
// to invalidate the Paste command.
requerySuggestedHandler = OnRequerySuggested;
CommandManager.RequerySuggested += requerySuggestedHandler;
textArea.OptionChanged += TextAreaOptionChanged;
currentContext = IntPtr.Zero;
}
void OnRequerySuggested(object sender, EventArgs e)
{
UpdateImeEnabled();
}
void TextAreaOptionChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "EnableImeSupport" && textArea.IsKeyboardFocused) {
CreateContext();
if (e.PropertyName == "EnableImeSupport") {
InputMethod.SetIsInputMethodSuspended(this.textArea, textArea.Options.EnableImeSupport);
UpdateImeEnabled();
}
}
public void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
UpdateImeEnabled();
}
public void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
if (e.OldFocus == textArea && currentContext != IntPtr.Zero)
ImeNativeWrapper.NotifyIme(currentContext);
ClearContext();
}
void UpdateImeEnabled()
{
if (textArea.Options.EnableImeSupport && textArea.IsKeyboardFocused) {
bool newReadOnly = !textArea.ReadOnlySectionProvider.CanInsert(textArea.Caret.Offset);
if (hwndSource == null || isReadOnly != newReadOnly) {
ClearContext(); // clear existing context (on read-only change)
isReadOnly = newReadOnly;
CreateContext();
}
} else {
ClearContext();
}
}
void ClearContext()
{
if (hwndSource != null) {
//ImeNativeWrapper.AssociateContext(hwndSource, previousContext);
//ImeNativeWrapper.ImmDestroyContext(currentContext);
ImeNativeWrapper.ReleaseContext(hwndSource, currentContext);
ImeNativeWrapper.ImmAssociateContext(hwndSource.Handle, previousContext);
ImeNativeWrapper.ImmReleaseContext(defaultImeWnd, currentContext);
currentContext = IntPtr.Zero;
defaultImeWnd = IntPtr.Zero;
hwndSource.RemoveHook(WndProc);
hwndSource = null;
}
}
public void OnGotFocus(KeyboardFocusChangedEventArgs e)
{
CreateContext();
}
void CreateContext()
{
ClearContext(); // clear old context if necessary
if (!textArea.Options.EnableImeSupport)
return;
hwndSource = (HwndSource)PresentationSource.FromVisual(this.textArea);
if (hwndSource != null) {
//currentContext = ImeNativeWrapper.ImmCreateContext();
//previousContext = ImeNativeWrapper.AssociateContext(hwndSource, currentContext);
currentContext = ImeNativeWrapper.GetContext(hwndSource);
if (isReadOnly) {
defaultImeWnd = IntPtr.Zero;
currentContext = IntPtr.Zero;
} else {
defaultImeWnd = ImeNativeWrapper.ImmGetDefaultIMEWnd(IntPtr.Zero);
currentContext = ImeNativeWrapper.ImmGetContext(defaultImeWnd);
}
previousContext = ImeNativeWrapper.ImmAssociateContext(hwndSource.Handle, currentContext);
hwndSource.AddHook(WndProc);
// UpdateCompositionWindow() will be called by the caret becoming visible
@ -83,21 +119,18 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -83,21 +119,18 @@ namespace ICSharpCode.AvalonEdit.Editing
}
}
public void OnLostFocus(KeyboardFocusChangedEventArgs e)
{
if (e.OldFocus == textArea && currentContext != IntPtr.Zero)
ImeNativeWrapper.NotifyIme(currentContext);
ClearContext();
}
IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
switch (msg) {
case ImeNativeWrapper.WM_INPUTLANGCHANGE:
// Don't mark the message as handled; other windows
// might want to handle it as well.
ClearContext();
CreateContext();
// If we have a context, recreate it
if (hwndSource != null) {
ClearContext();
CreateContext();
}
break;
case ImeNativeWrapper.WM_IME_COMPOSITION:
UpdateCompositionWindow();

5
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs

@ -595,6 +595,7 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -595,6 +595,7 @@ namespace ICSharpCode.AvalonEdit.Editing
if (value == null)
throw new ArgumentNullException("value");
readOnlySectionProvider = value;
CommandManager.InvalidateRequerySuggested(); // the read-only status effects Paste.CanExecute and the IME
}
}
#endregion
@ -757,7 +758,7 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -757,7 +758,7 @@ namespace ICSharpCode.AvalonEdit.Editing
{
base.OnGotKeyboardFocus(e);
// First activate IME, then show caret
ime.OnGotFocus(e);
ime.OnGotKeyboardFocus(e);
caret.Show();
}
@ -766,7 +767,7 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -766,7 +767,7 @@ namespace ICSharpCode.AvalonEdit.Editing
{
base.OnLostKeyboardFocus(e);
caret.Hide();
ime.OnLostFocus(e);
ime.OnLostKeyboardFocus(e);
}
#endregion

15
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingElementGenerator.cs

@ -74,10 +74,19 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -74,10 +74,19 @@ namespace ICSharpCode.AvalonEdit.Folding
/// <inheritdoc/>
public override int GetFirstInterestedOffset(int startOffset)
{
if (foldingManager != null)
if (foldingManager != null) {
foreach (FoldingSection fs in foldingManager.GetFoldingsContaining(startOffset)) {
// Test whether we're currently within a folded folding (that didn't just end).
// If so, create the fold marker immediately.
// This is necessary if the actual beginning of the fold marker got skipped due to another VisualElementGenerator.
if (fs.IsFolded && fs.EndOffset > startOffset) {
//return startOffset;
}
}
return foldingManager.GetNextFoldedFoldingStart(startOffset);
else
} else {
return -1;
}
}
/// <inheritdoc/>
@ -87,7 +96,7 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -87,7 +96,7 @@ namespace ICSharpCode.AvalonEdit.Folding
return null;
int foldedUntil = -1;
FoldingSection foldingSection = null;
foreach (FoldingSection fs in foldingManager.GetFoldingsAt(offset)) {
foreach (FoldingSection fs in foldingManager.GetFoldingsContaining(offset)) {
if (fs.IsFolded) {
if (fs.EndOffset > foldedUntil) {
foldedUntil = fs.EndOffset;

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingManager.cs

@ -81,7 +81,7 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -81,7 +81,7 @@ namespace ICSharpCode.AvalonEdit.Folding
foreach (FoldingSection fs in foldings) {
if (fs.collapsedSections != null) {
Array.Resize(ref fs.collapsedSections, textViews.Count);
fs.collapsedSections[fs.collapsedSections.Length - 1] = fs.CollapseSection(textView);
fs.ValidateCollapsedLineSections();
}
}
}

60
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingSection.cs

@ -4,9 +4,10 @@ @@ -4,9 +4,10 @@
using System;
using System.Diagnostics;
using System.Text;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.AvalonEdit.Utils;
namespace ICSharpCode.AvalonEdit.Folding
{
@ -28,51 +29,22 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -28,51 +29,22 @@ namespace ICSharpCode.AvalonEdit.Folding
set {
if (isFolded != value) {
isFolded = value;
if (value) {
// Create collapsed sections
if (manager != null) {
DocumentLine startLine = manager.document.GetLineByOffset(StartOffset);
DocumentLine endLine = manager.document.GetLineByOffset(EndOffset);
if (startLine != endLine) {
DocumentLine startLinePlusOne = startLine.NextLine;
collapsedSections = new CollapsedLineSection[manager.textViews.Count];
for (int i = 0; i < collapsedSections.Length; i++) {
collapsedSections[i] = manager.textViews[i].CollapseLines(startLinePlusOne, endLine);
}
}
}
} else {
// Destroy collapsed sections
RemoveCollapsedLineSection();
}
if (manager != null)
ValidateCollapsedLineSections(); // create/destroy CollapsedLineSection
manager.Redraw(this);
}
}
}
/// <summary>
/// Creates new collapsed section when a text view is added to the folding manager.
/// </summary>
internal CollapsedLineSection CollapseSection(TextView textView)
{
DocumentLine startLine = manager.document.GetLineByOffset(StartOffset);
DocumentLine endLine = manager.document.GetLineByOffset(EndOffset);
if (startLine != endLine) {
DocumentLine startLinePlusOne = startLine.NextLine;
return textView.CollapseLines(startLinePlusOne, endLine);
}
return null;
}
internal void ValidateCollapsedLineSections()
{
if (!isFolded) {
RemoveCollapsedLineSection();
return;
}
DocumentLine startLine = manager.document.GetLineByOffset(StartOffset);
DocumentLine endLine = manager.document.GetLineByOffset(EndOffset);
// It is possible that StartOffset/EndOffset get set to invalid values via the property setters in TextSegment,
// so we coerce those values into the valid range.
DocumentLine startLine = manager.document.GetLineByOffset(StartOffset.CoerceValue(0, manager.document.TextLength));
DocumentLine endLine = manager.document.GetLineByOffset(EndOffset.CoerceValue(0, manager.document.TextLength));
if (startLine == endLine) {
RemoveCollapsedLineSection();
} else {
@ -84,15 +56,26 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -84,15 +56,26 @@ namespace ICSharpCode.AvalonEdit.Folding
var collapsedSection = collapsedSections[i];
if (collapsedSection == null || collapsedSection.Start != startLinePlusOne || collapsedSection.End != endLine) {
// recreate this collapsed section
Debug.WriteLine("CollapsedLineSection validation - recreate collapsed section from " + startLinePlusOne + " to " + endLine);
if (collapsedSection != null)
if (collapsedSection != null) {
Debug.WriteLine("CollapsedLineSection validation - recreate collapsed section from " + startLinePlusOne + " to " + endLine);
collapsedSection.Uncollapse();
}
collapsedSections[i] = manager.textViews[i].CollapseLines(startLinePlusOne, endLine);
}
}
}
}
/// <inheritdoc/>
protected override void OnSegmentChanged()
{
ValidateCollapsedLineSections();
base.OnSegmentChanged();
// don't redraw if the FoldingSection wasn't added to the FoldingManager's collection yet
if (IsConnectedToCollection)
manager.Redraw(this);
}
/// <summary>
/// Gets/Sets the text used to display the collapsed version of the folding section.
/// </summary>
@ -103,7 +86,7 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -103,7 +86,7 @@ namespace ICSharpCode.AvalonEdit.Folding
set {
if (title != value) {
title = value;
if (this.IsFolded && manager != null)
if (this.IsFolded)
manager.Redraw(this);
}
}
@ -183,6 +166,7 @@ namespace ICSharpCode.AvalonEdit.Folding @@ -183,6 +166,7 @@ namespace ICSharpCode.AvalonEdit.Folding
internal FoldingSection(FoldingManager manager, int startOffset, int endOffset)
{
Debug.Assert(manager != null);
this.manager = manager;
this.StartOffset = startOffset;
this.Length = endOffset - startOffset;

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs

@ -1041,7 +1041,7 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -1041,7 +1041,7 @@ namespace ICSharpCode.AvalonEdit.Rendering
if (visualLine.FirstDocumentLine != visualLine.LastDocumentLine) {
// Check whether the lines are collapsed correctly:
double firstLinePos = heightTree.GetVisualPosition(visualLine.FirstDocumentLine.NextLine);
double lastLinePos = heightTree.GetVisualPosition(visualLine.LastDocumentLine);
double lastLinePos = heightTree.GetVisualPosition(visualLine.LastDocumentLine.NextLine ?? visualLine.LastDocumentLine);
if (!firstLinePos.IsClose(lastLinePos)) {
for (int i = visualLine.FirstDocumentLine.LineNumber + 1; i <= visualLine.LastDocumentLine.LineNumber; i++) {
if (!heightTree.GetIsCollapsed(i))

71
src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs

@ -242,13 +242,68 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -242,13 +242,68 @@ namespace ICSharpCode.SharpDevelop.Gui
SetDesignableObjects(null);
}
/// <summary>
/// Wrap objects in the combobox in order to replace their ToString() implementation.
/// </summary>
class ComboBoxItemWrapper
{
// This class is important because the default ToString() for some WinForms controls throws exceptions in some circumstances.
// e.g. System.NullReferenceException
// in System.Windows.Forms.ToolStripControlHost.get_Text()
// in System.Windows.Forms.ToolStripItem.ToString()
// in System.Convert.ToString(Object value, IFormatProvider provider)
// in System.Windows.Forms.ListControl.GetItemText(Object item)
// in System.Windows.Forms.ComboBox.NativeAdd(Object item)
// in System.Windows.Forms.ComboBox.ObjectCollection.AddInternal(Object item)
// in System.Windows.Forms.ComboBox.ObjectCollection.Add(Object item)
// We need this even though we're using owner drawing.
public readonly object Item;
public ComboBoxItemWrapper(object item)
{
if (item == null)
throw new ArgumentNullException("item");
this.Item = item;
}
public override int GetHashCode()
{
return Item.GetHashCode();
}
public override bool Equals(object obj)
{
ComboBoxItemWrapper o = obj as ComboBoxItemWrapper;
return o != null && this.Item.Equals(o.Item);
}
public override string ToString()
{
IComponent component = Item as IComponent;
if (component != null) {
ISite site = component.Site;
if (site != null) {
return site.Name + " - " + Item.GetType().ToString();
}
}
return Item.GetType().ToString();
}
}
object GetComboBoxItem(int index)
{
return ((ComboBoxItemWrapper)comboBox.Items[index]).Item;
}
void ComboBoxMeasureItem(object sender, MeasureItemEventArgs mea)
{
if (mea.Index < 0 || mea.Index >= comboBox.Items.Count) {
mea.ItemHeight = comboBox.Font.Height;
return;
}
object item = comboBox.Items[mea.Index];
object item = GetComboBoxItem(mea.Index);
SizeF size = mea.Graphics.MeasureString(item.GetType().ToString(), comboBox.Font);
mea.ItemHeight = (int)size.Height;
@ -284,7 +339,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -284,7 +339,7 @@ namespace ICSharpCode.SharpDevelop.Gui
g.FillRectangle(SystemBrushes.Window, dea.Bounds);
}
object item = comboBox.Items[dea.Index];
object item = GetComboBoxItem(dea.Index);
int xPos = dea.Bounds.X;
if (item is IComponent) {
@ -305,11 +360,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -305,11 +360,11 @@ namespace ICSharpCode.SharpDevelop.Gui
void ComboBoxSelectedIndexChanged(object sender, EventArgs e)
{
if (!inUpdate) {
if (host!=null) {
ISelectionService selectionService = (ISelectionService)host.GetService(typeof(ISelectionService));
if (!inUpdate && host!=null) {
ISelectionService selectionService = (ISelectionService)host.GetService(typeof(ISelectionService));
if (selectionService != null) {
if (comboBox.SelectedIndex >= 0) {
selectionService.SetSelectedComponents(new object[] {comboBox.Items[comboBox.SelectedIndex] });
selectionService.SetSelectedComponents(new object[] { GetComboBoxItem(comboBox.SelectedIndex) });
} else {
SetDesignableObject(null);
selectionService.SetSelectedComponents(new object[] { });
@ -322,7 +377,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -322,7 +377,7 @@ namespace ICSharpCode.SharpDevelop.Gui
{
if (grid.SelectedObjects != null && grid.SelectedObjects.Length == 1) {
for (int i = 0; i < comboBox.Items.Count; ++i) {
if (grid.SelectedObject == comboBox.Items[i]) {
if (grid.SelectedObject == GetComboBoxItem(i)) {
comboBox.SelectedIndex = i;
}
}
@ -399,7 +454,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -399,7 +454,7 @@ namespace ICSharpCode.SharpDevelop.Gui
comboBox.Items.Clear();
if (coll != null) {
foreach (object obj in SortObjectsBySiteName(coll)) {
comboBox.Items.Add(obj);
comboBox.Items.Add(new ComboBoxItemWrapper(obj));
}
}
SelectedObjectsChanged();

Loading…
Cancel
Save