Browse Source

Added SharpQuery.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@993 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
dac4be9a65
  1. 1
      data/resources/image/BitmapResources/BitmapResources.res
  2. BIN
      data/resources/image/BitmapResources/PadIcons/Database.png
  3. 8
      data/resources/layouts/Debug.xml
  4. 14
      data/resources/layouts/Default.xml
  5. 16
      data/resources/layouts/Plain.xml
  6. 13
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/ConvertProject.cs
  7. 12
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/VBToCSharpConverter.cs
  8. 12
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/CSharpToVBConverter.cs
  9. 39
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
  10. 33
      src/AddIns/Misc/SharpQuery/Configuration/AssemblyInfo.cs
  11. 13
      src/AddIns/Misc/SharpQuery/Resources/BitmapResources.res
  12. BIN
      src/AddIns/Misc/SharpQuery/Resources/BitmapResources.resources
  13. 2
      src/AddIns/Misc/SharpQuery/Resources/BuildBitmapResources.bat
  14. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.AddConnection.png
  15. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Column.png
  16. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.DatabaseConnection.png
  17. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.DatabaseConnectionClose.png
  18. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.NodeError.png
  19. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Procedure.png
  20. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.ProceduresRoot.png
  21. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Refresh.png
  22. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Remove.png
  23. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Table.png
  24. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.TablesRoot.png
  25. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.View.png
  26. BIN
      src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.ViewsRoot.png
  27. BIN
      src/AddIns/Misc/SharpQuery/Resources/ResAsm.exe
  28. 21
      src/AddIns/Misc/SharpQuery/Resources/ResAsm.exe.config
  29. 202
      src/AddIns/Misc/SharpQuery/SharpQuery.addin
  30. 101
      src/AddIns/Misc/SharpQuery/SharpQuery.csproj
  31. 1
      src/AddIns/Misc/SharpQuery/SharpQuery.csproj.user
  32. 58
      src/AddIns/Misc/SharpQuery/Src/AbstractSharpQueryCommand.cs
  33. 287
      src/AddIns/Misc/SharpQuery/Src/AbstractSharpQuerySchemaClass.cs
  34. 33
      src/AddIns/Misc/SharpQuery/Src/Collections.cs
  35. 553
      src/AddIns/Misc/SharpQuery/Src/Connection/ADOConnectionWrapper.cs
  36. 1008
      src/AddIns/Misc/SharpQuery/Src/Connection/AbstractSharpQueryConnectionWrapper.cs
  37. 228
      src/AddIns/Misc/SharpQuery/Src/Connection/IConnection.cs
  38. 445
      src/AddIns/Misc/SharpQuery/Src/Connection/OLEDBConnectionWrapper.cs
  39. 43
      src/AddIns/Misc/SharpQuery/Src/Exceptions/ConnectionStringException.cs
  40. 43
      src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteProcedureException.cs
  41. 44
      src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteSQLException.cs
  42. 45
      src/AddIns/Misc/SharpQuery/Src/Exceptions/OpenConnectionException.cs
  43. 16
      src/AddIns/Misc/SharpQuery/Src/Exceptions/SharpQueryAbstractException.cs
  44. 300
      src/AddIns/Misc/SharpQuery/Src/GUI/AbstractSharpQueryNode.cs
  45. 66
      src/AddIns/Misc/SharpQuery/Src/GUI/ISharpQueryNode.cs
  46. 77
      src/AddIns/Misc/SharpQuery/Src/GUI/SQLParameterInput.cs
  47. 230
      src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryDataView.cs
  48. 81
      src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryPad.cs
  49. 256
      src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryTree/SharpQueryDataNodes.cs
  50. 386
      src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryTree/SharpQueryNodesRoot.cs
  51. 174
      src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryTree/SharpQueryTree.cs
  52. 147
      src/AddIns/Misc/SharpQuery/Src/ISchemaClass.cs
  53. 187
      src/AddIns/Misc/SharpQuery/Src/SharpQueryCommands.cs
  54. 797
      src/AddIns/Misc/SharpQuery/Src/SharpQuerySchemaClass.cs
  55. 3
      src/Main/Base/Project/Src/Dom/IReturnType.cs
  56. 2
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
  57. 12
      src/Main/Base/Project/Src/Project/Converter/LanguageConverter.cs
  58. BIN
      src/Main/StartUp/Project/Resources/BitmapResources.resources
  59. 9
      src/SharpDevelop.sln

1
data/resources/image/BitmapResources/BitmapResources.res

@ -245,6 +245,7 @@ PadIcons.LoadedModules = PadIcons\LoadedModules.png @@ -245,6 +245,7 @@ PadIcons.LoadedModules = PadIcons\LoadedModules.png
PadIcons.LocalVariables = PadIcons\LocalVariables.png
PadIcons.Threads = PadIcons\Threads.png
PadIcons.Exceptions = PadIcons\Exceptions.png
Icons.16x16.SharpQuery.DataBaseRoot = PadIcons\Database.png
#classbrowser icons
Icons.16x16.NameSpace = ClassBrowserIcons\Icons.16x16.NameSpace.png

BIN
data/resources/image/BitmapResources/PadIcons/Database.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

8
data/resources/layouts/Debug.xml

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.162210282258557" DockRightPortion="0.159760856281619" DockTopPortion="0.25" DockBottomPortion="0.271028728576449" ActiveDocumentPane="-1" ActivePane="-1">
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.162210282258557" DockRightPortion="0.159760856281619" DockTopPortion="0.25" DockBottomPortion="0.271028728576449" ActiveDocumentPane="-1" ActivePane="1">
<Contents Count="25">
<Content ID="0" PersistString="ICSharpCode.MbUnitPad.MbUnitPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
@ -25,9 +25,9 @@ @@ -25,9 +25,9 @@
<Content ID="19" PersistString="HtmlHelp2.HtmlHelp2IndexPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="20" PersistString="HtmlHelp2.HtmlHelp2SearchPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="21" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="12">
<Pane ID="0" DockState="Float" ActiveContent="-1">

14
data/resources/layouts/Default.xml

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="6">
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="1">
<Contents Count="25">
<Content ID="0" PersistString="ICSharpCode.MbUnitPad.MbUnitPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
<Content ID="21" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="24" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="13">
<Pane ID="0" DockState="Float" ActiveContent="-1">
@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
</Contents>
</Pane>
<Pane ID="1" DockState="DockRight" ActiveContent="-1">
<Contents Count="12">
<Contents Count="13">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="22" />
<Content ID="2" RefID="23" />
@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
<Content ID="9" RefID="17" />
<Content ID="10" RefID="19" />
<Content ID="11" RefID="20" />
<Content ID="12" RefID="24" />
</Contents>
</Pane>
<Pane ID="2" DockState="Float" ActiveContent="-1">
@ -63,7 +64,7 @@ @@ -63,7 +64,7 @@
</Contents>
</Pane>
<Pane ID="4" DockState="DockBottom" ActiveContent="7">
<Contents Count="8">
<Contents Count="7">
<Content ID="0" RefID="7" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="3" />
@ -71,7 +72,6 @@ @@ -71,7 +72,6 @@
<Content ID="4" RefID="8" />
<Content ID="5" RefID="21" />
<Content ID="6" RefID="15" />
<Content ID="7" RefID="24" />
</Contents>
</Pane>
<Pane ID="5" DockState="Float" ActiveContent="-1">
@ -124,13 +124,13 @@ @@ -124,13 +124,13 @@
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="5">
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="7">
<DockList Count="2">
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="3" PrevPane="1" Alignment="Bottom" Proportion="0.654712002972872" />
</DockList>
</DockWindow>
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="4">
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="5">
<DockList Count="1">
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Left" Proportion="0.5" />
</DockList>

16
data/resources/layouts/Plain.xml

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="1">
<DockPanel FormatVersion="0.9.3" DockLeftPortion="0.176451264222485" DockRightPortion="0.178922617303663" DockTopPortion="0.25" DockBottomPortion="0.259014607431894" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="25">
<Content ID="0" PersistString="ICSharpCode.MbUnitPad.MbUnitPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
<Content ID="21" PersistString="HtmlHelp2.HtmlHelp2IndexResultsPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="22" PersistString="ICSharpCode.NAntAddIn.Gui.NAntPadContent" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="23" PersistString="HtmlHelp2.HtmlHelp2DynamicHelpPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="Boo.InterpreterAddIn.InterpreterPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="24" PersistString="SharpQuery.Pads.SharpQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="13">
<Pane ID="0" DockState="Float" ActiveContent="-1">
@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
</Contents>
</Pane>
<Pane ID="1" DockState="DockRight" ActiveContent="-1">
<Contents Count="12">
<Contents Count="13">
<Content ID="0" RefID="0" />
<Content ID="1" RefID="22" />
<Content ID="2" RefID="23" />
@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
<Content ID="9" RefID="17" />
<Content ID="10" RefID="19" />
<Content ID="11" RefID="20" />
<Content ID="12" RefID="24" />
</Contents>
</Pane>
<Pane ID="2" DockState="Float" ActiveContent="-1">
@ -63,7 +64,7 @@ @@ -63,7 +64,7 @@
</Contents>
</Pane>
<Pane ID="4" DockState="DockBottom" ActiveContent="-1">
<Contents Count="8">
<Contents Count="7">
<Content ID="0" RefID="7" />
<Content ID="1" RefID="4" />
<Content ID="2" RefID="3" />
@ -71,7 +72,6 @@ @@ -71,7 +72,6 @@
<Content ID="4" RefID="8" />
<Content ID="5" RefID="21" />
<Content ID="6" RefID="15" />
<Content ID="7" RefID="24" />
</Contents>
</Pane>
<Pane ID="5" DockState="Float" ActiveContent="-1">
@ -119,18 +119,18 @@ @@ -119,18 +119,18 @@
</Pane>
</Panes>
<DockWindows Count="3">
<DockWindow ID="0" DockState="DockLeft" ZOrderIndex="6">
<DockWindow ID="0" DockState="DockLeft" ZOrderIndex="7">
<DockList Count="1">
<Pane ID="0" RefID="6" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
</DockList>
</DockWindow>
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="5">
<DockWindow ID="1" DockState="DockRight" ZOrderIndex="6">
<DockList Count="2">
<Pane ID="0" RefID="1" PrevPane="-1" Alignment="Bottom" Proportion="0.5" />
<Pane ID="1" RefID="3" PrevPane="1" Alignment="Bottom" Proportion="0.654712002972872" />
</DockList>
</DockWindow>
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="4">
<DockWindow ID="2" DockState="DockBottom" ZOrderIndex="5">
<DockList Count="1">
<Pane ID="0" RefID="4" PrevPane="-1" Alignment="Left" Proportion="0.5" />
</DockList>

13
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/ConvertProject.cs

@ -1,10 +1,9 @@ @@ -1,10 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 14.01.2006
* Time: 17:05
*/
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;

12
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/VBToCSharpConverter.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 14.01.2006
* Time: 14:50
*/
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;

12
src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/CSharpToVBConverter.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 14.01.2006
* Time: 14:50
*/
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;

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

@ -39,19 +39,19 @@ @@ -39,19 +39,19 @@
<!-- Xml file filter -->
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "Xml"
insertbefore="AllFiles"
name = "${res:SharpDevelop.FileFilter.XmlFiles}"
extensions = "*.xml"/>
insertbefore="AllFiles"
name = "${res:SharpDevelop.FileFilter.XmlFiles}"
extensions = "*.xml"/>
<FileFilter id = "Xsl"
insertbefore="AllFiles"
name = "XSL files (*.xsl;*.xslt)"
extensions = "*.xsl;*.xslt"/>
</Path>
<!-- XML menu -->
<Path name = "/SharpDevelop/Workbench/MainMenu">
<Condition name = "WindowActive" activewindow="ICSharpCode.XmlEditor.XmlView">
<MenuItem id = "Xml" insertafter="View" insertbefore="Tools" label="&amp;XML" type = "Menu">
<MenuItem id = "Xml" insertafter="View" insertbefore="Tools" label="&amp;XML" type = "Menu">
<MenuItem id = "CreateSchema"
label = "${res:ICSharpCode.XmlEditor.CreateSchemaMenuLabel}"
class = "ICSharpCode.XmlEditor.CreateSchemaCommand" />
@ -60,27 +60,32 @@ @@ -60,27 +60,32 @@
class = "ICSharpCode.XmlEditor.ValidateXmlCommand"
shortcut = "Control|Shift|V" />
<MenuItem id = "Separator1" type = "Separator"/>
<ComplexCondition action="Disable">
<ComplexCondition action="Disable">
<Not>
<Condition name = "WindowActive" activewindow = "ICSharpCode.XmlEditor.XslOutputView"/>
</Not>
<MenuItem id="AssignStylesheet"
label="&amp;Assign XSLT..."
class="ICSharpCode.XmlEditor.AssignStylesheetCommand"/>
<Condition name = "StylesheetAssigned" action="Disable">
<MenuItem id="OpenStylesheet"
label="&amp;Open XSLT"
class="ICSharpCode.XmlEditor.OpenStylesheetCommand"/>
</Condition>
label="&amp;Assign XSLT..."
class="ICSharpCode.XmlEditor.AssignStylesheetCommand"/>
<ComplexCondition action="Disable">
<!-- evaluate StylesheetAssigned only when XmlView is active - important for lazy loading! -->
<And>
<Condition name = "WindowActive" activewindow = "ICSharpCode.XmlEditor.XmlView"/>
<Condition name = "StylesheetAssigned" action="Disable"/>
</And>
<MenuItem id="OpenStylesheet"
label="&amp;Open XSLT"
class="ICSharpCode.XmlEditor.OpenStylesheetCommand"/>
</ComplexCondition>
<MenuItem id="RunTransform"
label="Run XSL&amp;T"
class="ICSharpCode.XmlEditor.RunXslTransformCommand"
shortcut="Control|Shift|T"/>
label="Run XSL&amp;T"
class="ICSharpCode.XmlEditor.RunXslTransformCommand"
shortcut="Control|Shift|T"/>
</ComplexCondition>
</MenuItem>
</Condition>
</Path>
<!-- Right click menu -->
<Path name = "/SharpDevelop/ViewContent/XmlEditor/ContextMenu">
<MenuItem id = "Cut"

33
src/AddIns/Misc/SharpQuery/Configuration/AssemblyInfo.cs

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System.Reflection;
using System.Runtime.CompilerServices;
// 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("SharpQuery")]
[assembly: AssemblyDescription("AddIn for #Develop for Database Design")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ICSharpCode")]
[assembly: AssemblyProduct("SharpDevelop")]
[assembly: AssemblyCopyright("(C) 2003-2006 AlphaSierraPapa")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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("2.0.0.1")]

13
src/AddIns/Misc/SharpQuery/Resources/BitmapResources.res

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
Icons.16x16.SharpQuery.DatabaseConnectionClose = Icons\Icons.16x16.SharpQuery.DatabaseConnectionClose.png
Icons.16x16.SharpQuery.DatabaseConnection = Icons\Icons.16x16.SharpQuery.DatabaseConnection.png
Icons.16x16.SharpQuery.TablesRoot = Icons\Icons.16x16.SharpQuery.TablesRoot.png
Icons.16x16.SharpQuery.ViewsRoot = Icons\Icons.16x16.SharpQuery.ViewsRoot.png
Icons.16x16.SharpQuery.ProceduresRoot = Icons\Icons.16x16.SharpQuery.ProceduresRoot.png
Icons.16x16.SharpQuery.Table = Icons\Icons.16x16.SharpQuery.Table.png
Icons.16x16.SharpQuery.View = Icons\Icons.16x16.SharpQuery.View.png
Icons.16x16.SharpQuery.Procedure = Icons\Icons.16x16.SharpQuery.Procedure.png
Icons.16x16.SharpQuery.Column = Icons\Icons.16x16.SharpQuery.Column.png
Icons.16x16.SharpQuery.NodeError = Icons\Icons.16x16.SharpQuery.NodeError.png
Icons.16x16.SharpQuery.Refresh = Icons\Icons.16x16.SharpQuery.Refresh.png
Icons.16x16.SharpQuery.AddConnection = Icons\Icons.16x16.SharpQuery.AddConnection.png
Icons.16x16.SharpQuery.Remove = Icons\Icons.16x16.SharpQuery.Remove.png

BIN
src/AddIns/Misc/SharpQuery/Resources/BitmapResources.resources

Binary file not shown.

2
src/AddIns/Misc/SharpQuery/Resources/BuildBitmapResources.bat

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
resasm BitmapResources.res
pause

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.AddConnection.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Column.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.DatabaseConnection.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.DatabaseConnectionClose.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.NodeError.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Procedure.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.ProceduresRoot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Remove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.Table.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.TablesRoot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.View.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

BIN
src/AddIns/Misc/SharpQuery/Resources/Icons/Icons.16x16.SharpQuery.ViewsRoot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

BIN
src/AddIns/Misc/SharpQuery/Resources/ResAsm.exe

Binary file not shown.

21
src/AddIns/Misc/SharpQuery/Resources/ResAsm.exe.config

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
<appSettings/>
<startup>
<supportedRuntime version="v2.0.50727" />
</startup>
<!--
The following <runtime> section allows running nunit under
.NET 1.0 by redirecting assemblies. The appliesTo attribute
causes the section to be ignored except under .NET 1.0
on a machine with only the .NET version 1.0 runtime installed.
If application and its tests were built for .NET 1.1 you will
also need to redirect system assemblies in the test config file
just as we do for nunit.tests.dll.
-->
<runtime/>
</configuration>

202
src/AddIns/Misc/SharpQuery/SharpQuery.addin

@ -0,0 +1,202 @@ @@ -0,0 +1,202 @@
<AddIn name = "SharpQuery"
author = "Luc Morin (based on work by Denis ERCHOFF)"
url = "http://www.icsharpcode.net"
description = "Provides the database explorer pad">
<Manifest>
<Identity name="ICSharpCode.SharpQuery" version="@SharpQuery.dll"/>
</Manifest>
<Runtime>
<Import assembly="SharpQuery.dll">
</Import>
</Runtime>
<Path name = "/SharpQuery/Connection">
<Class id = "ConnectionWrapper"
class = "SharpQuery.Connection.OLEDBConnectionWrapper"/>
<SharpQueryConnection id ="Column"
schema="SharpQuery.SchemaClass.SharpQueryColumn"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeColumn"/>
<SharpQueryConnection id ="Parameter"
schema="SharpQuery.SchemaClass.SharpQueryParameter"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeParameter"/>
<SharpQueryConnection id ="Procedure"
schema="SharpQuery.SchemaClass.SharpQueryProcedure"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeProcedure"/>
<SharpQueryConnection id ="Table"
schema="SharpQuery.SchemaClass.SharpQueryTable"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeTable"/>
<SharpQueryConnection id ="View"
schema="SharpQuery.SchemaClass.SharpQueryView"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeView"/>
<SharpQueryConnection id ="NotSupported"
schema="SharpQuery.SchemaClass.SharpQueryNotSupported"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeNotSupported"/>
<SharpQueryConnection id ="Tables"
schema="SharpQuery.SchemaClass.SharpQueryTables"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeTableRoot"/>
<SharpQueryConnection id ="Views"
schema="SharpQuery.SchemaClass.SharpQueryViews"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeViewRoot"/>
<SharpQueryConnection id ="Procedures"
schema="SharpQuery.SchemaClass.SharpQueryProcedures"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeProcedureRoot"/>
<SharpQueryConnection id ="Schema"
schema="SharpQuery.SchemaClass.SharpQuerySchema"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeSchema"/>
<SharpQueryConnection id ="Catalog"
schema="SharpQuery.SchemaClass.SharpQueryCatalog"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeCatalog"/>
<SharpQueryConnection id ="OLEDB"
schema="SharpQuery.Connection.OLEDBConnectionWrapper"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeConnection"/>
<SharpQueryConnection id ="ADO"
schema="SharpQuery.Connection.ADOConnectionWrapper"
node ="SharpQuery.Gui.TreeView.SharpQueryNodeConnection"/>
</Path>
<Path name = "/SharpDevelop/Workbench/Pads">
<Pad id = "SharpQuery"
category = "Tools"
icon = "Icons.16x16.SharpQuery.DataBaseRoot"
title = "Database Explorer"
shortcut = "Control|Alt|B"
class = "SharpQuery.Pads.SharpQueryPad"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/DatabaseRoot">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
<MenuItem id = "Separator1" type = "Separator"/>
<MenuItem id = "AddConnection"
label = "${res:SharpQuery.Label.AddConnection}"
icon = "Icons.16x16.SharpQuery.AddConnection"
class = "SharpQuery.Commands.SharpQueryAddconnectionCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/DatabaseConnection">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy = "false"/>
<MenuItem id = "Separator1" type = "Separator"/>
<MenuItem id = "Supprimer"
label = "${res:SharpQuery.Label.Remove}"
icon = "Icons.16x16.SharpQuery.Remove"
class = "SharpQuery.Commands.SharpQueryRemoveConnectionCommand"
loadclasslazy = "false"/>
<MenuItem id = "Separator2" type = "Separator"/>
<MenuItem id = "ModifyConnection"
label = "${res:SharpQuery.Label.ModifyConnection}"
class = "SharpQuery.Commands.SharpQueryModifyConnectionCommand"
loadclasslazy="false"/>
<MenuItem id = "Disconnect"
label = "${res:SharpQuery.Label.Disconnect}"
class = "SharpQuery.Commands.SharpQueryDisconnectCommand"
loadclasslazy="false"/>
<MenuItem id = "Connect"
label = "${res:SharpQuery.Label.Connect}"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/TablesRoot">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/ViewsRoot">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/ProceduresRoot">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/Table">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
<MenuItem id = "ExtractData"
label = "${res:SharpQuery.Label.ExtractData}"
class = "SharpQuery.Commands.SharpQueryExecuteCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/View">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
<MenuItem id = "ExtractData"
label = "${res:SharpQuery.Label.ExtractData}"
class = "SharpQuery.Commands.SharpQueryExecuteCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/Procedure">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/Column">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/Parameter">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/Catalog">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
<Path name = "/SharpQuery/ContextMenu/Schema">
<MenuItem id = "Refresh"
label = "${res:SharpQuery.Label.Refresh}"
icon = "Icons.16x16.SharpQuery.Refresh"
class = "SharpQuery.Commands.SharpQueryRefreshCommand"
loadclasslazy="false"/>
</Path>
</AddIn>

101
src/AddIns/Misc/SharpQuery/SharpQuery.csproj

@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BDD03ECD-42AE-4B50-9805-9C19090A264F}</ProjectGuid>
<RootNamespace>SharpQuery</RootNamespace>
<AssemblyName>SharpQuery</AssemblyName>
<OutputType>Library</OutputType>
<WarningLevel>4</WarningLevel>
<NoStdLib>False</NoStdLib>
<NoConfig>False</NoConfig>
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<StartAction>Program</StartAction>
<StartProgram>..\..\..\..\..\Corsavy\SharpDevelop\bin\SharpDevelop.exe</StartProgram>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<OutputPath>..\..\..\..\AddIns\AddIns\Misc\SharpQuery\</OutputPath>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<DefineConstants>DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</ItemGroup>
<ItemGroup>
<None Include="SharpQuery.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<EmbeddedResource Include="Resources\BitmapResources.resources" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\Exceptions\ConnectionStringException.cs" />
<Compile Include="Src\Exceptions\ExecuteProcedureException.cs" />
<Compile Include="Src\Exceptions\ExecuteSQLException.cs" />
<Compile Include="Src\Exceptions\OpenConnectionException.cs" />
<Compile Include="Src\GUI\SharpQueryTree\SharpQueryDataNodes.cs" />
<Compile Include="Src\GUI\SharpQueryTree\SharpQueryNodesRoot.cs" />
<Compile Include="Src\GUI\SharpQueryTree\SharpQueryTree.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Connection\AbstractSharpQueryConnectionWrapper.cs" />
<Compile Include="Src\Connection\ADOConnectionWrapper.cs" />
<Compile Include="Src\Connection\IConnection.cs" />
<Compile Include="Src\Connection\OLEDBConnectionWrapper.cs" />
<Compile Include="Src\Exceptions\SharpQueryAbstractException.cs" />
<Compile Include="Src\GUI\AbstractSharpQueryNode.cs" />
<Compile Include="Src\GUI\SharpQueryDataView.cs" />
<Compile Include="Src\GUI\SQLParameterInput.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\GUI\ISharpQueryNode.cs" />
<Compile Include="Src\GUI\SharpQueryPad.cs" />
<Compile Include="Src\Collections.cs" />
<Compile Include="Src\AbstractSharpQueryCommand.cs" />
<Compile Include="Src\SharpQueryCommands.cs" />
<Compile Include="Src\AbstractSharpQuerySchemaClass.cs" />
<Compile Include="Src\ISchemaClass.cs" />
<Compile Include="Src\SharpQuerySchemaClass.cs" />
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft OLE DB Service Component 1.0 Type Library">
<Guid>{2206CEB0-19C1-11D1-89E0-00C04FD7A829}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
<ProjectReference Include="..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

1
src/AddIns/Misc/SharpQuery/SharpQuery.csproj.user

@ -0,0 +1 @@ @@ -0,0 +1 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

58
src/AddIns/Misc/SharpQuery/Src/AbstractSharpQueryCommand.cs

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using SharpQuery.Gui.TreeView;
using ICSharpCode.SharpDevelop;
using ICSharpCode.Core;
namespace SharpQuery.Commands
{
/// <summary>
/// Base class of all commands of SharpQuery Addin
/// </summary>
public abstract class AbstractSharpQueryCommand : AbstractMenuCommand
{
protected ISharpQueryNode sharpQueryNode = null;
/// <summary>
/// get the selected <see cref="SharpQuery.Gui.TreeView.ISharpQueryNode"> SharpQuery node </see>
/// and Enabled or disabled the command
/// <remarks> If the selected node is <code>null</code> or this is not a <see cref="SharpQuery.Gui.TreeView.ISharpQueryNode"> SharpQuery node </see>, return <code>false</code> (disable the menu)</remarks>
/// </summary>
public override bool IsEnabled
{
get
{
SharpQueryTree sharpQueryTree;
sharpQueryTree = this.Owner as SharpQueryTree;
if ((sharpQueryTree != null) && (sharpQueryTree.SelectedNode != null))
{
this.sharpQueryNode = sharpQueryTree.SelectedNode as ISharpQueryNode;
}
else
{
this.sharpQueryNode = null;
}
return (this.sharpQueryNode != null);
}
set { }
}
/// <summary>
/// Create a new SharpQueryCommand
/// </summary>
public AbstractSharpQueryCommand()
: base()
{
}
}
}

287
src/AddIns/Misc/SharpQuery/Src/AbstractSharpQuerySchemaClass.cs

@ -0,0 +1,287 @@ @@ -0,0 +1,287 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
using System.Data;
using System.Windows.Forms;
using SharpQuery.Collections;
using SharpQuery.Connection;
using System.ComponentModel;
namespace SharpQuery.SchemaClass
{
public abstract class AbstractSharpQuerySchemaClass : ISchemaClass
{
protected string pCatalogName = null;
protected string pSchemaName = null;
protected string pOwnerName = null;
protected string pName = null;
protected IConnection pDataConnection = null;
///<summary>
/// check if there are white spaces into the string.
/// if yes, then add "[" at the begin and "]" at the end.
///</summary>
internal static string CheckWhiteSpace(string str)
{
string returnStr = str;
if (returnStr.IndexOf(" ") > -1)
{
if (returnStr.StartsWith("[") == false)
{
returnStr = "[" + returnStr;
}
if (returnStr.EndsWith("]") == false)
{
returnStr = returnStr + "]";
}
}
return returnStr;
}
///<summary>remove "[" at the begin and at the end of the str</summary>
internal static string RemoveBracket(string str)
{
string returnStr = str;
if (returnStr.StartsWith("[") == true)
{
returnStr = returnStr.Remove(0, 1);
}
if (returnStr.EndsWith("]") == true)
{
returnStr = returnStr.Remove(returnStr.Length - 1, 1);
}
return returnStr;
}
///<summary>
/// those, are list of the childs schema.
/// i am using a dictionnary (<see cref="SharpQuery.Collections.SharpQueryListDictionary"></see>) because is more simplest to write
/// <code>Entities["PROCEDURES"]</code> than <code>Entities[0]</code>.
///</summary>
protected SharpQueryListDictionary pEntities = null;
public string CatalogName
{
get
{
return CheckWhiteSpace(this.pCatalogName);
}
}
public string SchemaName
{
get
{
return CheckWhiteSpace(this.pSchemaName);
}
}
public string OwnerName
{
get
{
return CheckWhiteSpace(this.pOwnerName);
}
}
public string Name
{
get
{
return CheckWhiteSpace(this.pName);
}
}
public string InternalName
{
get
{
return RemoveBracket(this.Name);
}
}
public virtual string NormalizedName
{
get
{
return CheckWhiteSpace(Name);
}
}
///<summary>
/// those, are list of the childs schema.
/// i am using a dictionnary (<see cref="SharpQuery.Collections.SharpQueryListDictionary"></see>) because is more simplest to write
/// <code>Entities["PROCEDURES"]</code> than <code>Entities[0]</code>.
///</summary>
public SharpQueryListDictionary Entities
{
get
{
return pEntities;
}
}
public IConnection Connection
{
get
{
return this.pDataConnection;
}
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public virtual DataObject DragObject
{
get
{
return null;
}
}
//create the entities list
protected virtual void CreateEntitiesList()
{
if (this.pEntities == null)
{
this.pEntities = new SharpQueryListDictionary();
}
}
///<summary>
/// construtor
/// <list type="bullet">
/// <listheader>
/// <term>parameters</term>
/// <description></description>
/// </listheader>
/// <item>
/// <term><code>connection</code></term>
/// <description>connection object from wich this schema is extracted</description>
/// </item>
/// <item>
/// <term><code>catalogName</code></term>
/// <description> this is the catalog of this schema entity </description>
/// </item>
/// <item>
/// <term><code>schemaName</code></term>
/// <description> this is the schema of this schema entity </description>
/// </item>
/// <item>
/// <term><code>ownerName</code></term>
/// <description> this is the owner name of this schema entity </description>
/// </item>
/// <item>
/// <term><code>name</code></term>
/// <description> this is the name of this schema entity </description>
/// </item>
/// </list>
///</summary>
public AbstractSharpQuerySchemaClass(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base()
{
this.pCatalogName = catalogName;
this.pSchemaName = schemaName;
this.pOwnerName = ownerName;
this.pName = name;
this.pDataConnection = connection;
this.CreateEntitiesList();
}
///<summary>
/// called by <see cref=".Refresh()">Refresh</see> just after the <see cref=".Clear()">Clear</see> and before <see cref=".Refresh()">childs'refresh</see>.
/// In this, you could change the <see cref=".Entities">Entities dicntionnary.</see>
///</summary>
protected abstract void OnRefresh();
public void Refresh()
{
this.Clear();
this.CreateEntitiesList();
if (this.Connection.IsOpen == true)
{
this.OnRefresh();
}
}
public void Clear()
{
if (this.pEntities != null)
{
this.pEntities.Clear();
}
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public abstract object Execute(int rows, SharpQuerySchemaClassCollection parameters);
///<summary> if <see cref=".Dataconnection.CatalogName">CatalogName</see> is <code>null</code> or <code>empty</code>
/// enumerate all catalogs from the database.
/// Else enumerate the current catalog's properties.
/// </summary>
public virtual SharpQuerySchemaClassCollection GetSchemaCatalogs()
{
return this.pDataConnection.GetSchemaCatalogs(this);
}
///<summary> if <see cref=".Dataconnection.CatalogName">CatalogName</see> is <code>null</code> or <code>empty</code>
/// enumerate all shcema from the database.
/// Else enumerate schemas from the current catalog.
/// </summary>
public virtual SharpQuerySchemaClassCollection GetSchemaSchemas()
{
return this.pDataConnection.GetSchemaSchemas(this);
}
///<summary> Enumerate the <see cref=".CatalogName">CatalogName<see cref=".SchemaName">.SchemaName</see></see>'s tables
/// </summary>
public virtual SharpQuerySchemaClassCollection GetSchemaTables()
{
return this.pDataConnection.GetSchemaTables(this);
}
///<summary> Enumerate the <see cref=".CatalogName">CatalogName<see cref=".SchemaName">.SchemaName</see></see>'s views
/// </summary>
public virtual SharpQuerySchemaClassCollection GetSchemaViews()
{
return this.pDataConnection.GetSchemaViews(this);
}
///<summary> Enumerate the <see cref=".CatalogName">CatalogName<see cref=".SchemaName">.SchemaName</see></see>'s procedures
/// </summary>
public virtual SharpQuerySchemaClassCollection GetSchemaProcedures()
{
return this.pDataConnection.GetSchemaProcedures(this);
}
public virtual SharpQuerySchemaClassCollection GetSchemaColumns()
{
SharpQuerySchemaClassCollection list = new SharpQuerySchemaClassCollection();
return list;
}
public virtual SharpQuerySchemaClassCollection GetSchemaParameters()
{
SharpQuerySchemaClassCollection list = new SharpQuerySchemaClassCollection();
return list;
}
}
}

33
src/AddIns/Misc/SharpQuery/Src/Collections.cs

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using SharpQuery.SchemaClass;
namespace SharpQuery.Collections
{
[Serializable()]
public class SharpQuerySchemaClassCollection : List<ISchemaClass>
{
}
[Serializable()]
public class SharpQueryListDictionary : Dictionary<string, SharpQuerySchemaClassCollection>
{
}
[Serializable()]
public class SharpQueryParameterCollection : List<SharpQueryParameter>
{
}
[Serializable()]
public class SharpQueryStringDictionary : Dictionary<string, string>
{
}
}

553
src/AddIns/Misc/SharpQuery/Src/Connection/ADOConnectionWrapper.cs

@ -0,0 +1,553 @@ @@ -0,0 +1,553 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Data.OleDb;
using System.Data;
using SharpQuery.Collections;
using SharpQuery.SchemaClass;
using SharpQuery.Exceptions;
namespace SharpQuery.Connection
{
//
// ADO .NET Wrapper (better than OleDB)
//
///<summary>
/// This class is associated with a class <see cref="ICSharpCode.SharpDevelop.Gui.SharpQuery.TreeView.SharpQueryNodeConnection"/>
///</summary>
public class ADOConnectionWrapper : AbstractSharpQueryConnectionWrapper
{
protected ADODB.ConnectionClass pADOConnection;
///<summary>
/// OLEDB connection String.
/// i use this for speed up the code writing ...
///</summary>
public override string ConnectionString
{
get
{
return base.ConnectionString;
}
set
{
if (IsOpen == true)
{
this.Close();
}
try
{
this.pADOConnection.ConnectionString = value;
wrongConnectionString = false;
}
catch (System.Exception)
{
string mes = this.ConnectionString + "\n\r";
wrongConnectionString = true;
foreach (ADODB.Error err in this.pADOConnection.Errors)
{
mes += "-----------------\n\r";
mes += err.Description + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new ConnectionStringException(mes);
}
}
}
public override bool IsOpen
{
get
{
return (pADOConnection.State == (int)ADODB.ObjectStateEnum.adStateOpen);
}
}
public override object GetProperty(AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum property)
{
object returnValue = null;
string Key = null;
switch (property)
{
case SharpQueryPropertyEnum.Catalog:
Key = "Current Catalog";
break;
case SharpQueryPropertyEnum.ConnectionString:
returnValue = this.pADOConnection.ConnectionString.ToString();
break;
case SharpQueryPropertyEnum.DataSource:
Key = "Data Source";
break;
case SharpQueryPropertyEnum.DataSourceName:
Key = "Data Source Name";
break;
case SharpQueryPropertyEnum.DBMSName:
Key = "DBMS Name";
break;
case SharpQueryPropertyEnum.ProviderName:
returnValue = this.pADOConnection.Provider.ToString();
break;
default:
Key = null;
break;
}
try
{
if (Key != null)
{
if (this.pADOConnection.Properties[Key].Value != null)
{
returnValue = this.pADOConnection.Properties[Key].Value;
}
}
}
catch (System.Exception)
{
returnValue = null;
}
return returnValue;
}
/// <summary>
/// Creates a new DataConnection object
/// </summary>
public ADOConnectionWrapper()
: base()
{
this.pADOConnection = new ADODB.ConnectionClass();
}
public ADOConnectionWrapper(string connectionString)
: this()
{
this.ConnectionString = connectionString;
}
protected override void OnRefresh()
{
this.pADOConnection.Properties.Refresh();
base.OnRefresh();
}
public override bool Open()
{
try
{
if (this.IsOpen == false && wrongConnectionString == false)
{
this.pADOConnection.GetType().InvokeMember(
"Open",
System.Reflection.BindingFlags.InvokeMethod,
null,
this.pADOConnection,
null);
}
}
catch (System.Exception)
{
string mes = this.ConnectionString + "\n\r";
wrongConnectionString = true;
foreach (ADODB.Error err in this.pADOConnection.Errors)
{
mes += "-----------------\n\r";
mes += err.Description + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new OpenConnectionException(mes);
}
return this.IsOpen;
}
public override void Close()
{
if (this.IsOpen == true)
{
this.pADOConnection.Close();
}
}
///<summary>
/// Execute a SQL command
/// <param name="SQLText">
/// SQL command to execute
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns>
/// </summary>
public override object ExecuteSQL(string SQLText, int rows)
{
ADODB.Recordset record = new ADODB.Recordset();
DataTable table = null;
this.pADOConnection.BeginTrans();
try
{
record.MaxRecords = rows;
record.Open((object)SQLText,
(object)this.pADOConnection,
ADODB.CursorTypeEnum.adOpenDynamic,
ADODB.LockTypeEnum.adLockPessimistic,
(int)ADODB.CommandTypeEnum.adCmdText
);
table = RecordSetToDataTable(record);
}
catch (System.Exception)
{
this.pADOConnection.RollbackTrans();
string mes = SQLText + "\n\r";
foreach (ADODB.Error err in this.pADOConnection.Errors)
{
mes += "-----------------\n\r";
mes += err.Description + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new ExecuteSQLException(mes);
}
finally
{
this.pADOConnection.CommitTrans();
}
return table;
}
protected ADODB.ParameterDirectionEnum ParamDirectionToADODirection(ParameterDirection dir)
{
ADODB.ParameterDirectionEnum ret = ADODB.ParameterDirectionEnum.adParamInput;
switch (dir)
{
case ParameterDirection.Input: ret = ADODB.ParameterDirectionEnum.adParamInput; break;
case ParameterDirection.InputOutput: ret = ADODB.ParameterDirectionEnum.adParamInputOutput; break;
case ParameterDirection.Output: ret = ADODB.ParameterDirectionEnum.adParamOutput; break;
case ParameterDirection.ReturnValue: ret = ADODB.ParameterDirectionEnum.adParamReturnValue; break;
default: throw new ArgumentOutOfRangeException("dir");
}
return ret;
}
protected ADODB.DataTypeEnum DbTypeToDataType(DbType t)
{
ADODB.DataTypeEnum ret = ADODB.DataTypeEnum.adChar;
switch (t)
{
case DbType.AnsiString: ret = ADODB.DataTypeEnum.adChar; break;
case DbType.Binary: ret = ADODB.DataTypeEnum.adBinary; break;
case DbType.Boolean: ret = ADODB.DataTypeEnum.adBoolean; break;
case DbType.Byte: ret = ADODB.DataTypeEnum.adUnsignedTinyInt; break;
case DbType.Currency: ret = ADODB.DataTypeEnum.adCurrency; break;
case DbType.Date: ret = ADODB.DataTypeEnum.adDate; break;
case DbType.DateTime: ret = ADODB.DataTypeEnum.adDBTimeStamp; break;
case DbType.Decimal: ret = ADODB.DataTypeEnum.adDecimal; break;
case DbType.Double: ret = ADODB.DataTypeEnum.adDouble; break;
case DbType.Guid: ret = ADODB.DataTypeEnum.adGUID; break;
case DbType.Int16: ret = ADODB.DataTypeEnum.adSmallInt; break;
case DbType.Int32: ret = ADODB.DataTypeEnum.adInteger; break;
case DbType.Int64: ret = ADODB.DataTypeEnum.adBigInt; break;
case DbType.Object: ret = ADODB.DataTypeEnum.adUserDefined; break;
case DbType.SByte: ret = ADODB.DataTypeEnum.adTinyInt; break;
case DbType.Single: ret = ADODB.DataTypeEnum.adSingle; break;
case DbType.String: ret = ADODB.DataTypeEnum.adVarWChar; break;
case DbType.StringFixedLength: ret = ADODB.DataTypeEnum.adWChar; break;
case DbType.Time: ret = ADODB.DataTypeEnum.adDBTime; break;
case DbType.UInt16: ret = ADODB.DataTypeEnum.adUnsignedSmallInt; break;
case DbType.UInt32: ret = ADODB.DataTypeEnum.adUnsignedInt; break;
case DbType.UInt64: ret = ADODB.DataTypeEnum.adUnsignedBigInt; break;
case DbType.VarNumeric: ret = ADODB.DataTypeEnum.adVarNumeric; break;
default: throw new ArgumentOutOfRangeException("t");
}
return ret;
}
///<summary>
/// Execute a stocked procedure.
/// <param name="schema">
/// <see cref="SharpQuery.SchemaClass">SchemaClass</see> object.
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns>
/// </summary>
public override object ExecuteProcedure(ISchemaClass schema, int rows, SharpQuerySchemaClassCollection parameters)
{
DataTable table = null;
if (schema == null)
{
throw new System.ArgumentNullException("schema");
}
ADODB.Recordset record = null;
ADODB.Command command = new ADODB.Command();
command.ActiveConnection = this.pADOConnection;
ADODB.Parameter para = null;
command.CommandText = schema.Name;
command.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc;
if (parameters != null)
{
foreach (SharpQueryParameter classParam in parameters)
{
para = new ADODB.Parameter();
para.Type = DbTypeToDataType(classParam.DataType);
para.Direction = ParamDirectionToADODirection(classParam.Type);
para.Name = classParam.Name;
if (para.Name.StartsWith("["))
{
para.Name = para.Name.Remove(0, 1);
}
if (para.Name.EndsWith("]"))
{
para.Name = para.Name.Remove(para.Name.Length - 1, 1);
}
para.Value = classParam.Value;
command.Parameters.Append(para);
}
}
this.pADOConnection.BeginTrans();
try
{
record = (ADODB.Recordset)command.GetType().InvokeMember(
"Execute",
System.Reflection.BindingFlags.InvokeMethod,
null,
command,
null);
//record.MaxRecords = rows;
table = RecordSetToDataTable(record);
//Procedure is ReadOnly
table.DefaultView.AllowDelete = false;
table.DefaultView.AllowEdit = false;
table.DefaultView.AllowNew = false;
}
catch (System.Exception e)
{
if (schema != null)
{
this.pADOConnection.RollbackTrans();
string mes = schema.Name + "\n\r";
foreach (ADODB.Error err in this.pADOConnection.Errors)
{
mes += "-----------------\n\r";
mes += err.Description + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new ExecuteProcedureException(mes);
}
else
{
throw new ExecuteProcedureException(e.Message);
}
}
this.pADOConnection.CommitTrans();
return table;
}
///<summary>
/// check the internal connection object is valid
/// Throw an exception if pADOConnection == null
///</summary>
protected override void CheckConnectionObject()
{
if (this.pADOConnection == null)
throw new ArgumentNullException("pADONETConnection");
}
protected DataTable RecordSetToDataTable(ADODB.Recordset record)
{
OleDbDataAdapter custDA = new OleDbDataAdapter();
DataTable custTable = new DataTable();
custDA.Fill(custTable, record);
return custTable;
}
protected override DataTable GetSchema(SharpQuerySchemaEnum schema, object[] restrictions)
{
ADODB.SchemaEnum internalSchema = 0;
ADODB.Recordset ADOrecord = null;
switch (schema)
{
case SharpQuerySchemaEnum.Asserts:
internalSchema = ADODB.SchemaEnum.adSchemaAsserts;
break;
case SharpQuerySchemaEnum.Catalogs:
internalSchema = ADODB.SchemaEnum.adSchemaCatalogs;
break;
case SharpQuerySchemaEnum.CharacterSets:
internalSchema = ADODB.SchemaEnum.adSchemaCharacterSets;
break;
case SharpQuerySchemaEnum.CheckConstraints:
internalSchema = ADODB.SchemaEnum.adSchemaCheckConstraints;
break;
case SharpQuerySchemaEnum.Collations:
internalSchema = ADODB.SchemaEnum.adSchemaCollations;
break;
case SharpQuerySchemaEnum.ColumnPrivileges:
internalSchema = ADODB.SchemaEnum.adSchemaColumnPrivileges;
break;
case SharpQuerySchemaEnum.Columns:
internalSchema = ADODB.SchemaEnum.adSchemaColumns;
break;
case SharpQuerySchemaEnum.ColumnsDomainUsage:
internalSchema = ADODB.SchemaEnum.adSchemaColumnsDomainUsage;
break;
case SharpQuerySchemaEnum.ConstraintColumnUsage:
internalSchema = ADODB.SchemaEnum.adSchemaConstraintColumnUsage;
break;
case SharpQuerySchemaEnum.ConstaintTableUsage:
internalSchema = ADODB.SchemaEnum.adSchemaConstraintTableUsage;
break;
case SharpQuerySchemaEnum.Cubes:
internalSchema = ADODB.SchemaEnum.adSchemaCubes;
break;
case SharpQuerySchemaEnum.DBInfoKeyWords:
internalSchema = ADODB.SchemaEnum.adSchemaDBInfoKeywords;
break;
case SharpQuerySchemaEnum.DBInfoLiterals:
internalSchema = ADODB.SchemaEnum.adSchemaDBInfoLiterals;
break;
case SharpQuerySchemaEnum.Dimensions:
internalSchema = ADODB.SchemaEnum.adSchemaDimensions;
break;
case SharpQuerySchemaEnum.ForeignKeys:
internalSchema = ADODB.SchemaEnum.adSchemaForeignKeys;
break;
case SharpQuerySchemaEnum.Hierarchies:
internalSchema = ADODB.SchemaEnum.adSchemaHierarchies;
break;
case SharpQuerySchemaEnum.Indexes:
internalSchema = ADODB.SchemaEnum.adSchemaIndexes;
break;
case SharpQuerySchemaEnum.KeyColumnUsage:
internalSchema = ADODB.SchemaEnum.adSchemaKeyColumnUsage;
break;
case SharpQuerySchemaEnum.Levels:
internalSchema = ADODB.SchemaEnum.adSchemaLevels;
break;
case SharpQuerySchemaEnum.Measures:
internalSchema = ADODB.SchemaEnum.adSchemaMeasures;
break;
case SharpQuerySchemaEnum.Members:
internalSchema = ADODB.SchemaEnum.adSchemaMembers;
break;
case SharpQuerySchemaEnum.Null:
break;
case SharpQuerySchemaEnum.PrimaryKeys:
internalSchema = ADODB.SchemaEnum.adSchemaPrimaryKeys;
break;
case SharpQuerySchemaEnum.ProcedureColumns:
internalSchema = ADODB.SchemaEnum.adSchemaProcedureColumns;
break;
case SharpQuerySchemaEnum.ProcedureParameters:
internalSchema = ADODB.SchemaEnum.adSchemaProcedureParameters;
break;
case SharpQuerySchemaEnum.Procedures:
internalSchema = ADODB.SchemaEnum.adSchemaProcedures;
break;
case SharpQuerySchemaEnum.Properties:
internalSchema = ADODB.SchemaEnum.adSchemaProperties;
break;
case SharpQuerySchemaEnum.ProviderTypes:
internalSchema = ADODB.SchemaEnum.adSchemaProviderTypes;
break;
case SharpQuerySchemaEnum.ReferentialConstraints:
internalSchema = ADODB.SchemaEnum.adSchemaReferentialConstraints;
break;
case SharpQuerySchemaEnum.Schemata:
internalSchema = ADODB.SchemaEnum.adSchemaSchemata;
break;
case SharpQuerySchemaEnum.SQLLanguages:
internalSchema = ADODB.SchemaEnum.adSchemaSQLLanguages;
break;
case SharpQuerySchemaEnum.Statistics:
internalSchema = ADODB.SchemaEnum.adSchemaStatistics;
break;
case SharpQuerySchemaEnum.TableConstraints:
internalSchema = ADODB.SchemaEnum.adSchemaTableConstraints;
break;
case SharpQuerySchemaEnum.TablePrivileges:
internalSchema = ADODB.SchemaEnum.adSchemaTablePrivileges;
break;
case SharpQuerySchemaEnum.Tables:
case SharpQuerySchemaEnum.Views:
internalSchema = ADODB.SchemaEnum.adSchemaTables;
break;
case SharpQuerySchemaEnum.Tanslations:
internalSchema = ADODB.SchemaEnum.adSchemaTranslations;
break;
case SharpQuerySchemaEnum.Trustees:
internalSchema = ADODB.SchemaEnum.adSchemaTrustees;
break;
case SharpQuerySchemaEnum.UsagePrivileges:
internalSchema = ADODB.SchemaEnum.adSchemaUsagePrivileges;
break;
case SharpQuerySchemaEnum.ViewColumnUsage:
internalSchema = ADODB.SchemaEnum.adSchemaViewColumnUsage;
break;
case SharpQuerySchemaEnum.ViewColumns:
internalSchema = ADODB.SchemaEnum.adSchemaColumns;
break;
case SharpQuerySchemaEnum.ViewTableUsage:
internalSchema = ADODB.SchemaEnum.adSchemaViewTableUsage;
break;
default:
throw new System.ArgumentException("", "schema");
}
if (schema != SharpQuerySchemaEnum.Null)
{
ADOrecord = (ADODB.Recordset)this.pADOConnection.GetType().InvokeMember(
"OpenSchema",
System.Reflection.BindingFlags.InvokeMethod,
null,
this.pADOConnection,
new Object[] { internalSchema, this.NormalizeRestrictions(restrictions) });
}
return RecordSetToDataTable(ADOrecord);
}
}
}

1008
src/AddIns/Misc/SharpQuery/Src/Connection/AbstractSharpQueryConnectionWrapper.cs

File diff suppressed because it is too large Load Diff

228
src/AddIns/Misc/SharpQuery/Src/Connection/IConnection.cs

@ -0,0 +1,228 @@ @@ -0,0 +1,228 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using SharpQuery.Collections;
using SharpQuery.SchemaClass;
using System.Data;
namespace SharpQuery.Connection
{
///<summary>
/// This interface is used by any connection wrapper class.
///</summary>
public interface IConnection
{
///<summary>
/// return <c>true</c> if the connection string is invalid.
///</summary>
bool IsConnectionStringWrong
{
get;
}
///<summary>Return the connection string.</summary>
string ConnectionString { get; set;}
///<summary>Provider'sname.
/// </summary>
string Provider { get; }
///<summary>
/// get the <code>connection</code>'s <code>catalog</code> name.
///</summary>
string CatalogName { get; }
///<summary>
/// get the <code>connection</code>'s <code>schema</code> name.
///</summary>
string SchemaName { get; }
///<summary>
/// get the <code>entity</code>'s name
///</summary>
string Name { get; }
///<summary>
/// <code>entity</code>'s normalized name.
/// <example>
/// there are a database <code>test</code>. In this database there are a <code>schema</code>
/// named <code>fool</code>. In this <code>schema</code> there are a <code>table</code> named <code>fooltable</code>
/// and a in this <code>table</code> there are a <code>column</code> named <code>foolcolumn</code>.
/// So, the normalized name of the <code>schema</code> is <code>test.[fool]</code>.
/// The normalized name of the <code>table</code> is <code>test.[fool].fooltable</code>.
/// The normalized name of the <code>column</code> is <code>test.[fool].fooltable.foolcolumn</code>.
///</example>
///</summary>
string NormalizedName { get; }
///<summary>
/// <returns>
/// <code>true</code> if the connection is opened.
/// <code>false</code> if the connection is not opened.
/// </returns>
/// </summary>
bool IsOpen { get; }
///<summary>
/// Those, are list of the childs schema.( columns, etc etc )
/// i am using a dictionnary because is more simplest to write
/// <code>Entities["PROCEDURES"]</code> than <code>Entities[0]</code>.
///</summary>
SharpQueryListDictionary Entities { get; }
///<summary>
/// <returns>
/// an array of string with the string properties's provider
/// </returns>
/// <remarks> properties are indexed ans sorted with <see cref=" SharpQuery.SchemaClass.AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum">SharpQueryPropertyEnum</see></remarks>
/// </summary>
object GetProperty(AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum property);
///<summary>
/// Open a connection with the <seealso cref='.IConnection.ConnectionString'/>
/// <returns>
/// <code>true</code> if the connection is opened.
/// <code>false</code> if the connection is not opened.
/// </returns>
/// </summary>
bool Open();
///<summary>
/// Close the connection with the server.
/// </summary>
void Close();
///<summary>
/// Refresh child schemas from the database.
///</summary>
void Refresh();
///<summary>
/// Erase all child schemas
///</summary>
void Clear();
///<summary>
/// Execute a SQL command
/// <param name="SQLText">
/// SQL command to execute
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns>
/// </summary>
object ExecuteSQL(string SQLText, int rows);
///<summary>
/// Execute a stocked procedure.
/// <param name="schema">
/// <see cref="SharpQuery.SchemaClass">SchemaClass</see> object.
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns>
/// </summary>
object ExecuteProcedure(ISchemaClass schema, int rows, SharpQuerySchemaClassCollection parameters);
///<summary>
/// Extract Data from a Table or a View
/// <param name="schema">
/// <see cref="SharpQuery.SchemaClass">SchemaClass</see> object.
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns>
/// </summary>
object ExtractData(ISchemaClass schema, int rows);
///<summary>
/// Update <see cref="System.Data.DataRow">row</see>'s fields into the current opened database.
/// <param name="row">a <see cref="System.Data.DataRow">row</see> </param>
/// <param name="schema"> a <see cref="SharpQuery.SchemaClass.ISchema">schema</see> </param>
///</summary>
void UpDateRow(ISchemaClass schema, DataRow row);
///<summary>
/// Delete <see cref="System.Data.DataRow">row</see> into the current opened database.
/// <param name="row">a <see cref="System.Data.DataRow">row</see> </param>
/// <param name="schema"> a <see cref="SharpQuery.SchemaClass.ISchema">schema</see> </param>
///</summary>
void DeleteRow(ISchemaClass schema, DataRow row);
///<summary>
/// Insert <see cref="System.Data.DataRow">row</see> into the current opened database.
/// <param name="row">a <see cref="System.Data.DataRow">row</see> </param>
/// <param name="schema"> a <see cref="SharpQuery.SchemaClass.ISchema">schema</see> </param>
///</summary>
void InsertRow(ISchemaClass schema, DataRow row);
///<summary>
/// Get <seealso cref='.ISchemaClass.Connection'/>'s catalogs.
///</summary>
SharpQuerySchemaClassCollection GetSchemaCatalogs(ISchemaClass schema);
///<summary>
/// Get <seealso cref='.ISchemaClass.Connection'/>'s Schemas.
///</summary>
SharpQuerySchemaClassCollection GetSchemaSchemas(ISchemaClass schema);
///<summary>
/// From a catalog object, get tables from all schemas.
/// From a schema object get tables from all this schema.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaTables(ISchemaClass schema);
///<summary>
/// From a catalog object, get views from all schemas.
/// From a schema object get views from all this schema.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaViews(ISchemaClass schema);
///<summary>
/// From a catalog object, get procedures from all schemas.
/// From a schema object get procedures from all this schema.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaProcedures(ISchemaClass schema);
///<summary>
/// From a table object, get columns from the table.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaTableColumns(ISchemaClass schema);
///<summary>
/// From a view object, get columns from the view.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaViewColumns(ISchemaClass schema);
///<summary>
/// From a procedure object , get columns from the procedure.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaProcedureColumns(ISchemaClass schema);
///<summary>
/// From a procedure object , get parameters from the procedure.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaProcedureParameters(ISchemaClass schema);
}
}

445
src/AddIns/Misc/SharpQuery/Src/Connection/OLEDBConnectionWrapper.cs

@ -0,0 +1,445 @@ @@ -0,0 +1,445 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Data.OleDb;
using System.Data;
using SharpQuery.Collections;
using SharpQuery.SchemaClass;
using SharpQuery.Exceptions;
namespace SharpQuery.Connection
{
//
// ADO .NET Wrapper (better than OleDB)
//
///<summary>
/// This class is associated with a class <see cref="ICSharpCode.SharpDevelop.Gui.SharpQuery.TreeView.SharpQueryNodeConnection"/>
///</summary>
public class OLEDBConnectionWrapper : AbstractSharpQueryConnectionWrapper
{
private System.Data.OleDb.OleDbConnection pOLEConnection = null;
private System.Data.OleDb.OleDbDataAdapter pOLEAdapter = new OleDbDataAdapter();
///<summary>
/// OLEDB connection String.
/// i use this for speed up the code writing ...
///</summary>
public override string ConnectionString
{
get
{
return base.ConnectionString;
}
set
{
if (IsOpen == true)
{
this.Close();
}
try
{
this.pOLEConnection.ConnectionString = value;
wrongConnectionString = false;
}
catch (OleDbException e)
{
string mes = this.ConnectionString + "\n\r";
wrongConnectionString = true;
foreach (OleDbError err in e.Errors)
{
mes += "-----------------\n\r";
mes += err.Message + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new ConnectionStringException(mes);
}
catch (System.Exception e)
{
wrongConnectionString = true;
throw new ConnectionStringException(value
+ "\n\r"
+ "-------------------\n\r"
+ e.Message
);
}
}
}
public override bool IsOpen
{
get
{
return (this.pOLEConnection.State == ConnectionState.Open);
}
}
public override object GetProperty(AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum property)
{
object returnValue = null;
switch (property)
{
case SharpQueryPropertyEnum.Catalog:
case SharpQueryPropertyEnum.DataSourceName:
returnValue = this.pOLEConnection.Database;
break;
case SharpQueryPropertyEnum.ConnectionString:
returnValue = this.pOLEConnection.ConnectionString.ToString();
break;
case SharpQueryPropertyEnum.DataSource:
returnValue = this.pOLEConnection.DataSource;
break;
case SharpQueryPropertyEnum.DBMSName:
returnValue = "";
break;
case SharpQueryPropertyEnum.ProviderName:
//Key = "Provider Name";
returnValue = this.pOLEConnection.Provider.ToString();
break;
default:
returnValue = null;
break;
}
return returnValue;
}
/// <summary>
/// Creates a new DataConnection object
/// </summary>
public OLEDBConnectionWrapper()
: base()
{
this.pOLEConnection = new System.Data.OleDb.OleDbConnection();
this.pOLEAdapter = new System.Data.OleDb.OleDbDataAdapter();
this.pOLEAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
}
public OLEDBConnectionWrapper(string connectionString)
: this()
{
this.ConnectionString = connectionString;
}
public override bool Open()
{
try
{
if (this.IsOpen == false && wrongConnectionString == false)
{
this.pOLEConnection.Open();
}
}
catch (OleDbException e)
{
string mes = this.ConnectionString + "\n\r";
wrongConnectionString = true;
foreach (OleDbError err in e.Errors)
{
mes += "-----------------\n\r";
mes += err.Message + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new OpenConnectionException(mes);
}
catch (System.Exception)
{
wrongConnectionString = true;
throw new OpenConnectionException(this.ConnectionString);
}
return this.IsOpen;
}
public override void Close()
{
if (this.IsOpen == true)
{
this.pOLEConnection.Close();
}
}
///<summary>
/// Execute a SQL command
/// <param name="SQLText">
/// SQL command to execute
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns> /// </summary>
public override object ExecuteSQL(string SQLText, int rows)
{
OleDbCommand command = new OleDbCommand();
DataSet returnValues = new DataSet();
command.Connection = this.pOLEConnection;
command.CommandText = SQLText;
command.CommandType = System.Data.CommandType.Text;
// some stranges things occurs with the OleDbDataAdapter and transaction
command.Transaction = this.pOLEConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
try
{
this.pOLEAdapter.SelectCommand = command;
this.pOLEAdapter.Fill(returnValues);
}
catch (OleDbException e)
{
command.Transaction.Rollback();
string mes = SQLText + "\n\r";
foreach (OleDbError err in e.Errors)
{
mes += "-----------------\n\r";
mes += err.Message + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new ExecuteSQLException(mes);
}
catch (System.Exception)
{
command.Transaction.Rollback();
throw new ExecuteSQLException(SQLText);
}
finally
{
command.Transaction.Commit();
}
return returnValues;
}
///<summary>
/// Execute a stocked procedure.
/// <param name="schema">
/// <see cref="SharpQuery.SchemaClass">SchemaClass</see> object.
/// </param>
/// <param name="rows">
/// Maximum number of row to extract. If is "0" then all rows are extracted.
/// </param>
/// <returns> return a <see cref="System.Data.DataTable">DataTable</see>
///or a <see cref="System.Data.DataSet">DataSet</see> object.
/// </returns> /// </summary>
public override object ExecuteProcedure(ISchemaClass schema, int rows, SharpQuerySchemaClassCollection parameters)
{
DataSet returnValues = null;
if (schema == null)
{
throw new System.ArgumentNullException("schema");
}
OleDbCommand command = new OleDbCommand();
OleDbParameter para = null;
returnValues = new DataSet();
command.Connection = this.pOLEConnection;
command.CommandText = schema.Name;
command.CommandType = System.Data.CommandType.StoredProcedure;
if (parameters != null)
{
foreach (SharpQueryParameter classParam in parameters)
{
para = new OleDbParameter();
para.DbType = classParam.DataType;
para.Direction = (ParameterDirection)classParam.Type;
para.ParameterName = classParam.Name;
if (para.ParameterName.StartsWith("["))
{
para.ParameterName = para.ParameterName.Remove(0, 1);
}
if (para.ParameterName.EndsWith("]"))
{
para.ParameterName = para.ParameterName.Remove(para.ParameterName.Length - 1, 1);
}
para.Value = classParam.Value;
command.Parameters.Add(para);
}
}
// command.Prepare();
command.Transaction = this.pOLEConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
try
{
this.pOLEAdapter.SelectCommand = command;
this.pOLEAdapter.Fill(returnValues);
}
catch (OleDbException e)
{
command.Transaction.Rollback();
string mes = schema.Name + "\n\r";
foreach (OleDbError err in e.Errors)
{
mes += "-----------------\n\r";
mes += err.Message + "\n\r";
mes += err.NativeError + "\n\r";
}
throw new ExecuteProcedureException(mes);
}
catch (System.Exception e)
{
command.Transaction.Rollback();
throw new ExecuteProcedureException(e.Message);
}
command.Transaction.Commit();
foreach (DataTable table in returnValues.Tables)
{
//readonly
table.DefaultView.AllowDelete = false;
table.DefaultView.AllowEdit = false;
table.DefaultView.AllowNew = false;
}
return returnValues;
}
///<summary>
/// check the internal connection object is valid
/// Throw an exception if pADOConnection == null
///</summary>
protected override void CheckConnectionObject()
{
if (this.pOLEConnection == null)
throw new ArgumentNullException("pOLEConnection");
}
protected override DataTable GetSchema(SharpQuerySchemaEnum schema, object[] restrictions)
{
System.Guid internalSchema = OleDbSchemaGuid.Assertions;
DataTable OLErecord = null;
switch (schema)
{
case SharpQuerySchemaEnum.Asserts:
internalSchema = OleDbSchemaGuid.Assertions;
break;
case SharpQuerySchemaEnum.Catalogs:
internalSchema = OleDbSchemaGuid.Catalogs;
break;
case SharpQuerySchemaEnum.CharacterSets:
internalSchema = OleDbSchemaGuid.Character_Sets;
break;
case SharpQuerySchemaEnum.CheckConstraints:
internalSchema = OleDbSchemaGuid.Check_Constraints;
break;
case SharpQuerySchemaEnum.Collations:
internalSchema = OleDbSchemaGuid.Collations;
break;
case SharpQuerySchemaEnum.ColumnPrivileges:
internalSchema = OleDbSchemaGuid.Column_Privileges;
break;
case SharpQuerySchemaEnum.Columns:
internalSchema = OleDbSchemaGuid.Columns;
break;
case SharpQuerySchemaEnum.ConstraintColumnUsage:
internalSchema = OleDbSchemaGuid.Constraint_Column_Usage;
break;
case SharpQuerySchemaEnum.ConstaintTableUsage:
internalSchema = OleDbSchemaGuid.Constraint_Table_Usage;
break;
case SharpQuerySchemaEnum.DBInfoLiterals:
internalSchema = OleDbSchemaGuid.DbInfoLiterals;
break;
case SharpQuerySchemaEnum.ForeignKeys:
internalSchema = OleDbSchemaGuid.Foreign_Keys;
break;
case SharpQuerySchemaEnum.Indexes:
internalSchema = OleDbSchemaGuid.Indexes;
break;
case SharpQuerySchemaEnum.KeyColumnUsage:
internalSchema = OleDbSchemaGuid.Key_Column_Usage;
break;
case SharpQuerySchemaEnum.Null:
break;
case SharpQuerySchemaEnum.PrimaryKeys:
internalSchema = OleDbSchemaGuid.Primary_Keys;
break;
case SharpQuerySchemaEnum.ProcedureColumns:
internalSchema = OleDbSchemaGuid.Procedure_Columns;
break;
case SharpQuerySchemaEnum.ProcedureParameters:
internalSchema = OleDbSchemaGuid.Procedure_Parameters;
break;
case SharpQuerySchemaEnum.Procedures:
internalSchema = OleDbSchemaGuid.Procedures;
break;
case SharpQuerySchemaEnum.ProviderTypes:
internalSchema = OleDbSchemaGuid.Provider_Types;
break;
case SharpQuerySchemaEnum.ReferentialConstraints:
internalSchema = OleDbSchemaGuid.Referential_Constraints;
break;
case SharpQuerySchemaEnum.Schemata:
internalSchema = OleDbSchemaGuid.Schemata;
break;
case SharpQuerySchemaEnum.SQLLanguages:
internalSchema = OleDbSchemaGuid.Sql_Languages;
break;
case SharpQuerySchemaEnum.Statistics:
internalSchema = OleDbSchemaGuid.Statistics;
break;
case SharpQuerySchemaEnum.TableConstraints:
internalSchema = OleDbSchemaGuid.Table_Constraints;
break;
case SharpQuerySchemaEnum.TablePrivileges:
internalSchema = OleDbSchemaGuid.Table_Privileges;
break;
case SharpQuerySchemaEnum.Tables:
case SharpQuerySchemaEnum.Views:
internalSchema = OleDbSchemaGuid.Tables;
break;
case SharpQuerySchemaEnum.Tanslations:
internalSchema = OleDbSchemaGuid.Translations;
break;
case SharpQuerySchemaEnum.Trustees:
internalSchema = OleDbSchemaGuid.Trustee;
break;
case SharpQuerySchemaEnum.UsagePrivileges:
internalSchema = OleDbSchemaGuid.Usage_Privileges;
break;
case SharpQuerySchemaEnum.ViewColumnUsage:
internalSchema = OleDbSchemaGuid.View_Column_Usage;
break;
case SharpQuerySchemaEnum.ViewColumns:
internalSchema = OleDbSchemaGuid.Columns;
break;
case SharpQuerySchemaEnum.ViewTableUsage:
internalSchema = OleDbSchemaGuid.View_Table_Usage;
break;
default:
throw new System.ArgumentException("", "schema");
}
if (schema != SharpQuerySchemaEnum.Null)
{
OLErecord = this.pOLEConnection.GetOleDbSchemaTable(internalSchema, this.NormalizeRestrictions(restrictions));
}
return OLErecord;
}
}
}

43
src/AddIns/Misc/SharpQuery/Src/Exceptions/ConnectionStringException.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
namespace SharpQuery.Exceptions
{
public class ConnectionStringException : Exception
{
public ConnectionStringException()
: base(StringParser.Parse("${res:SharpQuery.Error.WrongConnectionString}"))
{
}
public ConnectionStringException(ISchemaClass schema)
: base(StringParser.Parse("${res:SharpQuery.Error.WrongConnectionString}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ "(" + schema.Connection.ConnectionString + ")"
+ "\n\r"
+ "(" + schema.Connection.Name + ")"
)
{
}
public ConnectionStringException(string message)
: base(StringParser.Parse("${res:SharpQuery.Error.WrongConnectionString}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ message)
{
}
}
}

43
src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteProcedureException.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
namespace SharpQuery.Exceptions
{
public class ExecuteProcedureException : Exception
{
public ExecuteProcedureException()
: base(StringParser.Parse("${res:SharpQuery.Error.ProcedureExecution}"))
{
}
public ExecuteProcedureException(ISchemaClass schema)
: base(StringParser.Parse("${res:SharpQuery.Error.ProcedureExecution}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ "(" + schema.Connection.ConnectionString + ")"
+ "\n\r"
+ "(" + schema.Connection.Name + ")"
)
{
}
public ExecuteProcedureException(string message)
: base(StringParser.Parse("${res:SharpQuery.Error.ProcedureExecution}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ message)
{
}
}
}

44
src/AddIns/Misc/SharpQuery/Src/Exceptions/ExecuteSQLException.cs

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
namespace SharpQuery.Exceptions
{
public class ExecuteSQLException : Exception
{
public ExecuteSQLException()
: base(StringParser.Parse("${res:SharpQuery.Error.SQLExecution}"))
{
}
public ExecuteSQLException(ISchemaClass schema)
: base(StringParser.Parse("${res:SharpQuery.Error.SQLExecution}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ "(" + schema.Connection.ConnectionString + ")"
+ "\n\r"
+ "(" + schema.Connection.Name + ")"
)
{
}
public ExecuteSQLException(string message)
: base(StringParser.Parse("${res:SharpQuery.Error.SQLExecution}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ message)
{
}
}
}

45
src/AddIns/Misc/SharpQuery/Src/Exceptions/OpenConnectionException.cs

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
namespace SharpQuery.Exceptions
{
public class OpenConnectionException : Exception
{
public OpenConnectionException()
: base(StringParser.Parse("${res:SharpQuery.Error.OpenError}"))
{
}
public OpenConnectionException(ISchemaClass schema)
: base(StringParser.Parse("${res:SharpQuery.Error.OpenError}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ "(" + schema.Connection.ConnectionString + ")"
+ "\n\r"
+ "(" + schema.Connection.Name + ")"
)
{
}
public OpenConnectionException(string message)
: base(StringParser.Parse("${res:SharpQuery.Error.OpenError}")
+ "\n\r"
+ "-----------------"
+ "\n\r"
+ message)
{
}
}
}

16
src/AddIns/Misc/SharpQuery/Src/Exceptions/SharpQueryAbstractException.cs

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
namespace SharpQuery.Exceptions
{
public abstract class SharpQueryAbstractException : Exception
{
}
}

300
src/AddIns/Misc/SharpQuery/Src/GUI/AbstractSharpQueryNode.cs

@ -0,0 +1,300 @@ @@ -0,0 +1,300 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Windows.Forms;
using System.Reflection;
using System.Collections.Generic;
using System.Data;
using System.ComponentModel;
using SharpQuery.Collections;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using SharpQuery.SchemaClass;
using SharpQuery.Connection;
using SharpQuery.Gui.DataView;
namespace SharpQuery.Gui.TreeView
{
public abstract class AbstractSharpQueryNode : System.Windows.Forms.TreeNode, ISharpQueryNode
{
internal static SQLParameterInput inputform = null;
///<summary>
/// this variable force to have a "plus" near the node.
/// </summary>
protected Assembly ass = null;
protected ISchemaClass pSchemaClass = null;
///<summary> force to displayed a "+" for the node</summary>
protected virtual bool NullChildAllowed
{
get
{
return true;
}
}
public virtual string AddinContextMenu
{
get
{
return "";
}
}
public virtual string entityNormalizedName
{
get
{
if (this.SchemaClass != null)
{
return AbstractSharpQuerySchemaClass.RemoveBracket(this.SchemaClass.NormalizedName);
}
else
{
return "";
}
}
}
public virtual string entityName
{
get
{
if (this.SchemaClass != null)
{
return this.SchemaClass.InternalName;
}
else
{
return "";
}
}
}
public ISchemaClass SchemaClass
{
get
{
if (this.pSchemaClass != null)
{
return this.pSchemaClass;
}
else
{
return null;
}
}
}
public virtual IConnection Connection
{
get
{
if (this.SchemaClass != null)
{
return this.SchemaClass.Connection;
}
else
{
return null;
}
}
}
public virtual SharpQueryListDictionary Entities
{
get
{
if (this.SchemaClass != null)
{
return this.SchemaClass.Entities;
}
else
{
return null;
}
}
}
public AbstractSharpQueryNode()
: base()
{
ass = System.Reflection.Assembly.GetExecutingAssembly();
}
public AbstractSharpQueryNode(ISchemaClass schemaclass)
: this()
{
this.pSchemaClass = schemaclass;
}
///<summary>
/// called by <see cref=".Refresh()">Refresh</see> just after the <see cref=".Clear()">Clear</see> and before <see cref=".Refresh()">childs'refresh</see>.
/// In this, you could change the <see cref=".Entities">Entities dicntionnary.</see>
///</summary>
protected virtual void OnRefresh()
{
// Nothing !
}
public virtual void Refresh()
{
try
{
if (this.TreeView != null)
{
this.TreeView.BeginUpdate();
}
this.Clear();
this.OnRefresh();
if (this.Connection.IsOpen)
{
this.Text = this.entityName;
if (this.IsExpanded == true)
{
if (this.SchemaClass != null)
{
this.SchemaClass.Refresh();
}
this.BuildsChilds();
}
}
}
finally
{
if (this.TreeView != null)
{
this.TreeView.EndUpdate();
}
}
}
public virtual void Clear()
{
if (this.SchemaClass != null)
{
this.SchemaClass.Clear();
}
this.Nodes.Clear();
if ((this.IsExpanded == false) && (this.NullChildAllowed == true))
{
this.Nodes.Add(new TreeNode());
}
}
///<summary>
/// allow the user to add some parameters while executing an SQL command
/// </summary>
protected virtual SharpQuerySchemaClassCollection OnExecute(CancelEventArgs e)
{
return null;
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// </summary>
public void Execute(int rows)
{
try
{
if (this.SchemaClass != null)
{
CancelEventArgs e = new CancelEventArgs();
SharpQuerySchemaClassCollection ret = this.OnExecute(e);
if (e.Cancel == false)
{
WorkbenchSingleton.Workbench.ShowView(new SharpQueryDataView(this.SchemaClass, rows, ret));
}
}
}
catch (Exception e)
{
MessageService.ShowError(e.Message);
}
}
public virtual void BuildsChilds()
{
string childclass = "";
ISharpQueryNode ChildNode = null;
if (this.Entities != null)
{
foreach ( KeyValuePair<string, SharpQuerySchemaClassCollection> DicEntry in this.Entities)
{
if (DicEntry.Value != null)
{
SharpQuerySchemaClassCollection entitieslist = DicEntry.Value as SharpQuerySchemaClassCollection;
foreach (ISchemaClass entity in entitieslist)
{
childclass = SharpQueryTree.SchemaClassDict[entity.GetType().FullName];
if ((childclass != null) && (childclass != ""))
{
ChildNode = (ISharpQueryNode)ass.CreateInstance(childclass, false, BindingFlags.CreateInstance, null, new object[] { entity }, null, null);
if (ChildNode != null)
{
bool addNode = true;
if (ChildNode is SharpQueryNodeNotSupported)
{
addNode = this.ShowUnsupported();
}
if (addNode == true)
{
this.Nodes.Add(ChildNode as TreeNode);
ChildNode.Refresh();
}
}
}
}
}
}
}
}
protected bool ShowUnsupported()
{
// AddInTreeNode AddinNode;
bool ret = true;
// AddinNode = AddInTree.GetTreeNode("/SharpQuery/Connection");
// foreach ( DictionaryEntry entryChild in AddinNode.ChildNodes)
// {
// AddInTreeNode ChildNode = entryChild.Value as AddInTreeNode;
// if ( ChildNode != null )
// {
// SharpQueryConnectionCodon codon = ChildNode.Codon as SharpQueryConnectionCodon;
// if ( codon != null )
// {
// if ( codon.Node == this.GetType().FullName )
// {
// ret = bool.Parse( codon.ShowUnsuported );
// }
// }
// }
// }
return ret;
}
}
}

66
src/AddIns/Misc/SharpQuery/Src/GUI/ISharpQueryNode.cs

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using SharpQuery.SchemaClass;
using SharpQuery.Connection;
using SharpQuery.Collections;
namespace SharpQuery.Gui.TreeView
{
public interface ISharpQueryNode
{
///<summary>
/// <returns> Path to a string #develop menu command object.</returns>
/// <remarks>You should add this extension path in the addin file.</remarks>
/// </summary>
string AddinContextMenu { get; }
///<summary>
/// His schema class from wich to displayed data informations.
///</summary>
ISchemaClass SchemaClass { get; }
///<summary>
/// the <see cref=".ISharpQueryNode.SchemaClass">SchemaClass</see>'s connection.
///</summary>
IConnection Connection { get; }
///<summary>
/// Those, are list of the childs schema.( columns, etc etc )
/// i am using a dictionnary because is more simplest to write
/// <code>Entities["PROCEDURES"]</code> than <code>Entities[0]</code>.
///</summary>
SharpQueryListDictionary Entities { get; }
///<summary>
/// Calls the <see cref=".ISharpQueryNode.Clear()">Clear()</see> method.
/// Calls the <see cref=".ISchemaClass.Refresh()">Refresh()</see> method of his <see cref=".ISharpQueryNode.SchemaClass">SchemaClass</see> member.
/// Calls the <see cref=".ISchemaClass.BuildsChilds()">BuildsChild()</see> method.
/// </summary>
void Refresh();
///<summary>
/// Calls the <code>Clear()</code> method of each child nodes.
/// Calls the <see cref=".ISchemaClass.Clear()">Clear()</see> methode of his <see cref=".ISharpQueryNode.SchemaClass">SchemaClass</see> member.
/// Remove each child nodes.
/// </summary>
void Clear();
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// </summary>
void Execute(int rows);
///<summary>
/// Builds childs <see cref=".ISharpQueryNode">ISharpQueryNode</see>
/// </summary>
void BuildsChilds();
}
}

77
src/AddIns/Misc/SharpQuery/Src/GUI/SQLParameterInput.cs

@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Data;
using System.Data.OleDb;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using SharpQuery.SchemaClass;
using SharpQuery.Collections;
using System.ComponentModel;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
namespace SharpQuery.Gui.DataView
{
public class SQLParameterInput : XmlForm
{
private DataGrid _dataGrid = null;
public DataGrid dataGrid
{
get
{
if (this._dataGrid == null)
{
this._dataGrid = this.ControlDictionary["dataGrid"] as DataGrid;
}
return this._dataGrid;
}
}
private void ResetClick(object sender, EventArgs e)
{
}
protected void FillParameters(SharpQueryParameterCollection parameters)
{
SharpQueryParameter par = null;
for (int i = 0; i < parameters.Count; i++)
{
par = parameters[i];
if (par.Type == ParameterDirection.ReturnValue)
{
i--;
parameters.Remove(par);
}
}
this.dataGrid.CaptionVisible = true;
this.dataGrid.DataSource = parameters;
this.dataGrid.DataMember = null;
this.dataGrid.AllowNavigation = false;
}
public SQLParameterInput()
{
SetupFromXmlResource(PropertyService.DataDirectory + @"\resources\dialogs\SharpQuery\SqlParametersInput.xfrm");
}
public SQLParameterInput(SharpQueryParameterCollection parameters)
: this()
{
this.FillParameters(parameters);
}
protected override void SetupXmlLoader()
{
xmlLoader.StringValueFilter = new SharpDevelopStringValueFilter();
xmlLoader.PropertyValueCreator = new SharpDevelopPropertyValueCreator();
}
}
}

230
src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryDataView.cs

@ -0,0 +1,230 @@ @@ -0,0 +1,230 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Data;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using SharpQuery.SchemaClass;
using SharpQuery.Collections;
namespace SharpQuery.Gui.DataView
{
/// <summary>
/// Description of the view content
/// </summary>
public class SharpQueryDataView : AbstractViewContent
{
DataGrid pDataGrid;
ISchemaClass pSchema;
#region AbstractViewContent requirements
/// <summary>
/// The <see cref="System.Windows.Forms.Control"/> representing the view
/// </summary>
///
public override Control Control
{
get
{
return pDataGrid;
}
}
/// <summary>
/// Creates a new MyView object
/// </summary>
public SharpQueryDataView(ISchemaClass entity, int lines, SharpQuerySchemaClassCollection parameters)
{
if (entity == null)
{
throw new ArgumentNullException("entity");
}
TitleName = SharpQuery.SchemaClass.AbstractSharpQuerySchemaClass.RemoveBracket(entity.NormalizedName);
this.pDataGrid = new DataGrid();
this.pDataGrid.CaptionVisible = true;
this.pDataGrid.DataMember = "";
this.pDataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.pDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.pDataGrid.Location = new System.Drawing.Point(0, 0);
this.pDataGrid.Name = "dataGrid";
this.pDataGrid.Size = new System.Drawing.Size(292, 266);
this.pDataGrid.TabIndex = 0;
this.Schema = entity;
this.Datatable = this.Schema.Execute(lines, parameters);
// if ( this.Datatable == null )
// {
// WorkbenchSingleton.Workbench.ViewContentCollection.Remove( this );
// }
}
/// <summary>
/// Loads a new file into MyView
/// </summary>
public override void Load(string fileName)
{
// TODO
throw new System.NotImplementedException();
}
/// <summary>
/// Refreshes the view
/// </summary>
public override void RedrawContent()
{
// TODO: Refresh the whole view control here, renew all resource strings whatever
// Note that you do not need to recreate the control.
}
/// <summary>
/// Cleans up all used resources
/// </summary>
public override void Dispose()
{
// TODO: Clean up resources in this method
Control.Dispose();
}
#endregion
public ISchemaClass Schema
{
get
{
return this.pSchema;
}
set
{
this.pSchema = value;
}
}
///<summary>
/// <see cref="System.Data.DataTable">DataTable</see> to display in the
/// <see cref="System.Windows.Forms.DataGrid">DataGrid</see>
/// </summary>
public object Datatable
{
get
{
return this.pDataGrid.DataSource;
}
set
{
removeChangedHandler();
this.pDataGrid.DataSource = value;
this.pDataGrid.DataMember = null;
this.pDataGrid.AllowNavigation = true;
DataSet dataset = this.pDataGrid.DataSource as DataSet;
if (dataset != null)
{
if (dataset.Tables.Count == 1)
{
this.pDataGrid.DataMember = dataset.Tables[0].TableName;
this.pDataGrid.AllowNavigation = false;
}
}
addChangedHandler();
}
}
private void removeChangedHandler()
{
if (this.pDataGrid.DataSource != null)
{
DataSet dataset = this.pDataGrid.DataSource as DataSet;
if (dataset != null)
{
foreach (DataTable table in dataset.Tables)
{
table.RowChanged -= new DataRowChangeEventHandler(this.UpdateTable);
table.RowDeleted -= new DataRowChangeEventHandler(this.DeleteRow);
}
}
else
{
(this.pDataGrid.DataSource as DataTable).RowChanged -= new DataRowChangeEventHandler(this.UpdateTable);
(this.pDataGrid.DataSource as DataTable).RowDeleted -= new DataRowChangeEventHandler(this.DeleteRow);
}
}
}
private void addChangedHandler()
{
if (this.pDataGrid.DataSource != null)
{
DataSet dataset = this.pDataGrid.DataSource as DataSet;
if (dataset != null)
{
foreach (DataTable table in dataset.Tables)
{
table.RowChanged += new DataRowChangeEventHandler(this.UpdateTable);
table.RowDeleted += new DataRowChangeEventHandler(this.DeleteRow);
}
}
else
{
(this.pDataGrid.DataSource as DataTable).RowChanged += new DataRowChangeEventHandler(this.UpdateTable);
(this.pDataGrid.DataSource as DataTable).RowDeleted += new DataRowChangeEventHandler(this.DeleteRow);
}
}
}
public void UpdateTable(object sender, DataRowChangeEventArgs e)
{
if (Datatable != null)
{
switch (e.Action)
{
case DataRowAction.Add:
this.Schema.Connection.InsertRow(this.Schema, e.Row);
break;
case DataRowAction.Change:
this.Schema.Connection.UpDateRow(this.Schema, e.Row);
break;
}
}
}
public void DeleteRow(object sender, DataRowChangeEventArgs e)
{
switch (e.Action)
{
case DataRowAction.Delete:
this.Schema.Connection.DeleteRow(this.Schema, e.Row);
break;
}
}
public override void Save(string fileName)
{
DataSet dataset = this.pDataGrid.DataSource as DataSet;
if (dataset == null)
{
DataTable dataTable = this.pDataGrid.DataSource as DataTable;
if (dataTable != null)
{
dataset = new DataSet();
dataset.Tables.Add(dataTable);
}
}
dataset.WriteXml(fileName);
}
}
}

81
src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryPad.cs

@ -0,0 +1,81 @@ @@ -0,0 +1,81 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using ICSharpCode.SharpDevelop.Gui;
using SharpQuery.Gui;
using SharpQuery.Gui.TreeView;
//TODO : dans les SharpQueryList faire correspondre les restrictions vec les objets ajoutés
//TODO : dans les SharpQueryList faire correspondre les dataconnection avec les objets ajoutés
//TODO : ajout statistiques.
namespace SharpQuery.Pads
{
/// <summary>
/// This Pad Show a tree where you can add/remove databases connections.
/// You can administrate databases from this tree.
/// </summary>
public class SharpQueryPad : AbstractPadContent
{
private static SharpQueryTree sharpQueryTree = null;
#region AbstractPadContent requirements
/// <summary>
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
/// </summary>
public override Control Control
{
get
{
return sharpQueryTree;
}
}
/// <summary>
/// Creates a new SharpQueryPad object
/// </summary>
public SharpQueryPad()
{
ICSharpCode.Core.ResourceService.RegisterImages("SharpQuery.Resources.BitmapResources", GetType().Assembly);
CreateDefaultSharpQuery();
sharpQueryTree.Dock = DockStyle.Fill;
}
void CreateDefaultSharpQuery()
{
sharpQueryTree = new SharpQueryTree();
}
public void SaveSharpQueryView()
{
}
/// <summary>
/// Refreshes the pad
/// </summary>
public override void RedrawContent()
{
// OnTitleChanged(null);
// OnIconChanged(null);
sharpQueryTree.Refresh();
}
/// <summary>
/// Cleans up all used resources
/// </summary>
public override void Dispose()
{
this.SaveSharpQueryView();
sharpQueryTree.Dispose();
}
#endregion
}
}

256
src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryTree/SharpQueryDataNodes.cs

@ -0,0 +1,256 @@ @@ -0,0 +1,256 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Windows.Forms;
using System.Xml;
using System.ComponentModel;
using SharpQuery.SchemaClass;
using SharpQuery.Collections;
using System.Collections;
using SharpQuery.Gui.DataView;
using ICSharpCode.SharpDevelop.Gui;
namespace SharpQuery.Gui.TreeView
{
///<summary>
/// Column Node
///</summary>
public class SharpQueryNodeColumn : AbstractSharpQueryNode
{
///<summary> force to displayed a "+" for the node</summary>
protected override bool NullChildAllowed
{
get
{
return false;
}
}
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/Column";
}
}
public SharpQueryNodeColumn(SharpQueryColumn sharpQueryColumn)
: base(sharpQueryColumn)
{
this.ImageIndex = 9;
this.SelectedImageIndex = 9;
}
}
///<summary>
/// Parameter Node
///</summary>
public class SharpQueryNodeParameter : AbstractSharpQueryNode
{
///<summary> force to displayed a "+" for the node</summary>
protected override bool NullChildAllowed
{
get
{
return false;
}
}
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/Parameter";
}
}
public SharpQueryNodeParameter(SharpQueryParameter sharpQueryParameter)
: base(sharpQueryParameter)
{
this.ImageIndex = 9;
this.SelectedImageIndex = 9;
}
}
///<summary>
/// Table Node
///</summary>
public class SharpQueryNodeTable : AbstractSharpQueryNode
{
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/Table";
}
}
public SharpQueryNodeTable(SharpQueryTable sharpQueryTable)
: base(sharpQueryTable)
{
this.ImageIndex = 6;
this.SelectedImageIndex = 6;
}
}
///<summary>
/// View Node
///</summary>
public class SharpQueryNodeView : AbstractSharpQueryNode
{
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/View";
}
}
public SharpQueryNodeView(SharpQueryView sharpQueryView)
: base(sharpQueryView)
{
this.ImageIndex = 7;
this.SelectedImageIndex = 7;
}
}
///<summary>
/// Procedure Node
///</summary>
public class SharpQueryNodeProcedure : AbstractSharpQueryNode
{
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/Procedure";
}
}
public SharpQueryNodeProcedure(SharpQueryProcedure sharpQueryProcedure)
: base(sharpQueryProcedure)
{
this.ImageIndex = 8;
this.SelectedImageIndex = 8;
}
///<summary>
/// allow the user to add some parameters while executing an SQL command
/// </summary>
protected override SharpQuerySchemaClassCollection OnExecute(CancelEventArgs e)
{
SharpQuerySchemaClassCollection tmp = this.SchemaClass.GetSchemaParameters();
SharpQueryParameterCollection parameters = null;
SharpQuerySchemaClassCollection returnValue = null;
if (tmp.Count == 1 && tmp[0] is SharpQueryNotSupported)
{
parameters = new SharpQueryParameterCollection();
}
else
{
parameters = new SharpQueryParameterCollection();
foreach (SharpQueryParameter par in tmp)
parameters.Add(par);
}
if (parameters != null && parameters.Count > 0)
{
inputform = new SQLParameterInput(parameters);
inputform.Owner = (Form)WorkbenchSingleton.Workbench;
if (inputform.ShowDialog() != DialogResult.OK)
{
returnValue = null;
e.Cancel = true;
}
else
{
returnValue = new SharpQuerySchemaClassCollection();
foreach (SharpQueryParameter par in parameters)
{
returnValue.Add(par);
}
}
}
return returnValue;
}
}
///<summary>
/// Node displayed when a function is not supported by the provider!
///</summary>
public class SharpQueryNodeNotSupported : AbstractSharpQueryNode
{
///<summary> force to displayed a "+" for the node</summary>
protected override bool NullChildAllowed
{
get
{
return false;
}
}
public SharpQueryNodeNotSupported(SharpQueryNotSupported sharpQueryNotSupported)
: base(sharpQueryNotSupported)
{
this.ImageIndex = 10;
this.SelectedImageIndex = 10;
}
}
///<summary>
/// Schema Node
///</summary>
public class SharpQueryNodeSchema : AbstractSharpQueryNode
{
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/Schema";
}
}
public SharpQueryNodeSchema(SharpQuerySchema schema)
: base(schema)
{
this.ImageIndex = 1;
this.SelectedImageIndex = 1;
}
}
///<summary>
/// Catalog Node
///</summary>
public class SharpQueryNodeCatalog : AbstractSharpQueryNode
{
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/Catalog";
}
}
public SharpQueryNodeCatalog(SharpQueryCatalog catalog)
: base(catalog)
{
this.ImageIndex = 1;
this.SelectedImageIndex = 1;
}
}
}

386
src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryTree/SharpQueryNodesRoot.cs

@ -0,0 +1,386 @@ @@ -0,0 +1,386 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
// created on 04/11/2003 at 17:29
using System;
using System.Windows.Forms;
using System.Xml;
using System.Reflection;
using ICSharpCode.Core;
using SharpQuery.SchemaClass;
using SharpQuery.Collections;
using System.Collections;
using SharpQuery.Connection;
using SharpQuery.Exceptions;
namespace SharpQuery.Gui.TreeView
{
///<summary>
/// this is the root of all others nodes!
///</summary>
public class SharpQueryNodeDatabaseRoot : AbstractSharpQueryNode
{
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/DatabaseRoot";
}
}
public override string entityName
{
get
{
return StringParser.Parse("${res:SharpQuery.Label.DataBasesRoot}");
}
}
public SharpQueryNodeDatabaseRoot()
: base(null)
{
this.Text = this.entityName;
this.ImageIndex = 0;
this.SelectedImageIndex = 0;
}
public override void Refresh()
{
this.Text = this.entityName;
foreach (ISharpQueryNode node in this.Nodes)
{
node.Refresh();
}
}
public override void Clear()
{
foreach (ISharpQueryNode node in this.Nodes)
{
node.Clear();
}
}
public override void BuildsChilds()
{
IConnection connection = null;
ISharpQueryNode node = null;
try
{
connection = AbstractSharpQueryConnectionWrapper.CreateFromDataConnectionLink();
if (connection != null)
{
string ChildClass = "";
if (SharpQueryTree.SchemaClassDict.ContainsKey(connection.GetType().FullName) == true)
{
ChildClass = SharpQueryTree.SchemaClassDict[connection.GetType().FullName];
}
if ((ChildClass != null) && (ChildClass != ""))
{
node = (ISharpQueryNode)ass.CreateInstance(ChildClass, false, BindingFlags.CreateInstance, null, new object[] { connection }, null, null);
}
else
{
node = new SharpQueryNodeNotSupported(new SharpQueryNotSupported(connection, "", "", "", connection.GetType().FullName));
}
//TODO : do an interface for the node connection!
(node as SharpQueryNodeConnection).Connect();
this.Nodes.Add(node as TreeNode);
node.Refresh();
if (node.Connection.IsConnectionStringWrong == true)
{
this.Nodes.Remove(node as TreeNode);
}
else
{
this.Expand();
}
}
}
catch (ConnectionStringException e)
{
if (this.Nodes.Contains(node as TreeNode) == true)
{
this.Nodes.Remove(node as TreeNode);
}
MessageService.ShowError(e.Message);
}
}
}
///<summary>
/// Root nodes for a connection to a database
///</summary>
public class SharpQueryNodeConnection : AbstractSharpQueryNode
{
IConnection pConnection = null;
public override string entityNormalizedName
{
get
{
if (this.pConnection != null)
{
return this.pConnection.NormalizedName;
}
else
{
return "";
}
}
}
public override string entityName
{
get
{
if (this.pConnection != null)
{
return this.pConnection.Name;
}
else
{
return "";
}
}
}
public override IConnection Connection
{
get
{
if (this.pConnection != null)
{
return this.pConnection;
}
else
{
return null;
}
}
}
public override SharpQueryListDictionary Entities
{
get
{
if (this.Connection != null)
{
return this.Connection.Entities;
}
else
{
return null;
}
}
}
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/DatabaseConnection";
}
}
public SharpQueryNodeConnection(IConnection dataConnection)
: base(null)
{
this.pConnection = dataConnection;
this.ImageIndex = 1;
this.SelectedImageIndex = 1;
}
public bool IsConnected
{
get
{
return this.Connection.IsOpen;
}
}
public void Disconnect()
{
if (this.IsConnected == true)
{
this.Collapse();
this.Clear();
this.Connection.Close();
this.ImageIndex = 1;
this.SelectedImageIndex = 1;
}
}
public void Connect()
{
try
{
if (this.IsConnected == false)
{
if (this.Connection.Open())
{
this.Refresh();
this.ImageIndex = 2;
this.SelectedImageIndex = 2;
}
}
}
catch (OpenConnectionException e)
{
MessageService.ShowError(e.Message);
}
}
protected override void OnRefresh()
{
if (this.IsConnected == true)
{
this.Clear();
this.Connection.Refresh();
}
}
public override void Clear()
{
if (this.Connection != null)
{
this.Connection.Clear();
}
base.Clear();
}
public void RemoveConnection()
{
this.Disconnect();
this.pConnection = null;
this.Parent.Nodes.Remove(this);
}
public void ModifyConnection()
{
IConnection Oldconnection = this.pConnection;
bool error = false;
try
{
IConnection connection = null;
connection = AbstractSharpQueryConnectionWrapper.UpDateFromDataConnectionLink(this.Connection);
if (connection != null)
{
this.Disconnect();
this.pConnection = connection;
this.Refresh();
error = this.pConnection.IsConnectionStringWrong;
}
}
catch (ConnectionStringException e)
{
error = true;
MessageService.ShowError(e.Message);
}
finally
{
if (error == true)
{
this.pConnection = Oldconnection;
this.Connect();
this.Refresh();
}
}
}
}
///<summary>
/// Tables Root Node
///</summary>
public class SharpQueryNodeTableRoot : AbstractSharpQueryNode
{
///<summary>
/// Addin Path of the node's context menu
///</summary>
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/TablesRoot";
}
}
public SharpQueryNodeTableRoot(AbstractSharpQuerySchemaClass databaseclass)
: base(databaseclass)
{
this.ImageIndex = 3;
this.SelectedImageIndex = 3;
}
}
///<summary>
/// Views Root Node
///</summary>
public class SharpQueryNodeViewRoot : AbstractSharpQueryNode
{
///<summary>
/// Addin Path of the node's context menu
///</summary>
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/ViewsRoot";
}
}
public SharpQueryNodeViewRoot(AbstractSharpQuerySchemaClass databaseclass)
: base(databaseclass)
{
this.ImageIndex = 4;
this.SelectedImageIndex = 4;
}
}
///<summary>
/// Procedure Root Node
///</summary>
public class SharpQueryNodeProcedureRoot : AbstractSharpQueryNode
{
///<summary>
/// Addin Path of the node's context menu
///</summary>
public override string AddinContextMenu
{
get
{
return "/SharpQuery/ContextMenu/ProceduresRoot";
}
}
public SharpQueryNodeProcedureRoot(AbstractSharpQuerySchemaClass databaseclass)
: base(databaseclass)
{
this.ImageIndex = 5;
this.SelectedImageIndex = 5;
}
}
}

174
src/AddIns/Misc/SharpQuery/Src/GUI/SharpQueryTree/SharpQueryTree.cs

@ -0,0 +1,174 @@ @@ -0,0 +1,174 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
// created on 04/11/2003 at 16:05
using System;
using System.Windows.Forms;
using System.Xml;
using System.Collections.Generic;
using System.Collections;
using SharpQuery.Gui;
using SharpQuery.Collections;
using ICSharpCode.Core;
namespace SharpQuery.Gui.TreeView
{
///<summary>
/// This class shows all databases connections in a treeview.
///</summary>
public class SharpQueryTree : System.Windows.Forms.TreeView
{
private System.Windows.Forms.ImageList pNodeImages;
public static SharpQueryStringDictionary SchemaClassDict;
///<summary>
/// Create a SharpQueryTree objec
///</summary>
public SharpQueryTree()
: base()
{
this.pNodeImages = new ImageList();
this.pNodeImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.pNodeImages.ImageSize = new System.Drawing.Size(16, 16);
this.pNodeImages.TransparentColor = System.Drawing.Color.DarkCyan;
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.DataBaseRoot"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.DatabaseConnectionClose"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.DatabaseConnection"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.TablesRoot"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.ViewsRoot"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.ProceduresRoot"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Table"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.View"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Procedure"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Column"));
this.pNodeImages.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.NodeError"));
this.ImageList = this.pNodeImages;
SchemaClassDict = new SharpQueryStringDictionary();
LoadSharpQueryConnectionCodon();
//Add the Root Node.
this.Nodes.Add(new SharpQueryNodeDatabaseRoot());
}
protected void LoadSharpQueryConnectionCodon()
{
AddInTreeNode AddinNode = AddInTree.GetTreeNode("/SharpQuery/Connection");
LoggingService.Info("Building SharpQuery Codons...");
foreach (Codon c in AddinNode.Codons)
{
if (c.Properties["schema"] != null && c.Properties["schema"] != string.Empty)
{
if (SchemaClassDict.ContainsKey(c.Properties["schema"]))
{
SchemaClassDict[c.Properties["schema"]] = c.Properties["node"];
}
else
{
SchemaClassDict.Add(c.Properties["schema"], c.Properties["node"]);
}
}
}
}
///<summary>
/// Select the node under the mouse cursor
///</summary>
protected override void OnMouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Right || e.Button == MouseButtons.Left)
{
this.SelectedNode = this.GetNodeAt(e.X, e.Y);
}
base.OnMouseDown(e);
}
///<summary>
/// Display the context menu associated with a node type
///</summary>
protected override void OnMouseUp(MouseEventArgs e)
{
if (e.Button == MouseButtons.Right && this.SelectedNode != null && SelectedNode is ISharpQueryNode)
{
ISharpQueryNode selectedBrowserNode = SelectedNode as ISharpQueryNode;
if (selectedBrowserNode.AddinContextMenu != "")
{
MenuService.ShowContextMenu(this, selectedBrowserNode.AddinContextMenu, this, e.X, e.Y);
}
}
base.OnMouseUp(e);
}
protected override void OnItemDrag(ItemDragEventArgs e)
{
base.OnItemDrag(e);
AbstractSharpQueryNode node = e.Item as AbstractSharpQueryNode;
if (node != null)
{
DataObject dataObject = null;
if (node.SchemaClass != null)
{
dataObject = node.SchemaClass.DragObject;
if (dataObject != null)
{
dataObject.SetData(node.GetType(), node);
DoDragDrop(dataObject, DragDropEffects.All);
}
}
}
}
protected override void OnBeforeExpand(TreeViewCancelEventArgs e)
{
SharpQueryNodeConnection node = e.Node as SharpQueryNodeConnection;
if (node != null)
{
if (node.IsConnected == false)
{
node.Connect();
}
}
base.OnBeforeExpand(e);
}
protected override void OnAfterExpand(TreeViewEventArgs e)
{
ISharpQueryNode node = e.Node as ISharpQueryNode;
if (node != null)
{
node.Refresh();
}
base.OnAfterExpand(e);
}
protected override void OnAfterCollapse(TreeViewEventArgs e)
{
ISharpQueryNode node = e.Node as ISharpQueryNode;
if (node != null)
{
node.Clear();
}
base.OnAfterCollapse(e);
}
}
}

147
src/AddIns/Misc/SharpQuery/Src/ISchemaClass.cs

@ -0,0 +1,147 @@ @@ -0,0 +1,147 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System.Collections;
using System.Data;
using System.Windows.Forms;
using SharpQuery.Collections;
using SharpQuery.Connection;
namespace SharpQuery.SchemaClass
{
///<summary>
/// This interface is used by any schema class in sharp query.
/// A schema class is a class that is the database definition of a <code>table</code>,
/// a <code>view</code>, a <code>column</code>, etc etc ...
/// <remarks>
/// <code>entity</code> is <code>table</code>, a <code>view</code> or other database struct.
/// <code>schema</code>'s names are displayed between <code>[</code> and <code>]</code>
/// </remarks>
///</summary>
public interface ISchemaClass
{
///<summary>
/// get the connection object
///</summary>
IConnection Connection { get; }
///<summary>
/// get the <code>entity</code>'s <code>catalog</code> name.
///</summary>
string CatalogName { get; }
///<summary>
/// get the <code>entity</code>'s <code>schema</code> name.
///</summary>
string SchemaName { get; }
///<summary>
/// Get the <code>entity</code>'s owner name
/// <example>
/// for exemple, the owner of a <code>column</code> is a <code>table</code>,
/// and this property return the name of the <code>table</code>
///</example>
///</summary>
string OwnerName { get; }
///<summary>
/// get the <code>entity</code>'s name
///</summary>
string Name { get; }
/// <summary>
/// Internal name, used internally
/// </summary>
string InternalName { get; }
///<summary>
/// <code>entity</code>'s normalized name.
/// <example>
/// there are a database <code>test</code>. In this database there are a <code>schema</code>
/// named <code>fool</code>. In this <code>schema</code> there are a <code>table</code> named <code>fooltable</code>
/// and a in this <code>table</code> there are a <code>column</code> named <code>foolcolumn</code>.
/// So, the normalized name of the <code>schema</code> is <code>test.[fool]</code>.
/// The normalized name of the <code>table</code> is <code>test.[fool].fooltable</code>.
/// The normalized name of the <code>column</code> is <code>test.[fool].fooltable.foolcolumn</code>.
///</example>
///</summary>
string NormalizedName { get; }
///<summary>
/// Those, are list of the childs schema.( columns, etc etc )
/// i am using a dictionnary because is more simplest to write
/// <code>Entities["PROCEDURES"]</code> than <code>Entities[0]</code>.
///</summary>
SharpQueryListDictionary Entities { get; }
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see> </summary>
DataObject DragObject { get; }
///<summary>
/// Refresh child schemas from the database.
///</summary>
void Refresh();
///<summary>
/// Erase all child schemas
///</summary>
void Clear();
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
object Execute(int rows, SharpQuerySchemaClassCollection parameters);
///<summary>
/// Get <seealso cref='.ISchemaClass.Connection'/>'s catalogs.
///</summary>
SharpQuerySchemaClassCollection GetSchemaCatalogs();
///<summary>
/// Get <seealso cref='.ISchemaClass.Connection'/>'s Schemas.
///</summary>
SharpQuerySchemaClassCollection GetSchemaSchemas();
///<summary>
/// From a catalog object, get tables from all schemas.
/// From a schema object get tables from all this schema.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaTables();
///<summary>
/// From a catalog object, get views from all schemas.
/// From a schema object get views from all this schema.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaViews();
///<summary>
/// From a catalog object, get procedures from all schemas.
/// From a schema object get procedures from all this schema.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaProcedures();
///<summary>
/// From a table or a view or procedure object, get columns from the table.
/// From other object, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaColumns();
///<summary>
/// Get parameters from the procedure.
/// If parameters are not supported by the schema, return an empty list.
///</summary>
SharpQuerySchemaClassCollection GetSchemaParameters();
}
}

187
src/AddIns/Misc/SharpQuery/Src/SharpQueryCommands.cs

@ -0,0 +1,187 @@ @@ -0,0 +1,187 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using SharpQuery.Gui.TreeView;
namespace SharpQuery.Commands
{
public class SharpQueryRefreshCommand : AbstractSharpQueryCommand
{
public override bool IsEnabled
{
get
{
return base.IsEnabled && (this.sharpQueryNode is AbstractSharpQueryNode)
&& (this.sharpQueryNode as AbstractSharpQueryNode).Connection != null
&& (this.sharpQueryNode as AbstractSharpQueryNode).Connection.IsOpen == true;
}
set { }
}
/// <summary>
/// Refresh the selected <see cref="SharpQuery.Gui.TreeView.ISharpQueryNode">node</see> of the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"> SharpQuery Tree.</see>
/// </summary>
public override void Run()
{
(this.sharpQueryNode as ISharpQueryNode).Refresh();
}
}
/// <summary>
/// Add a connection to a database server into the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"></see>
/// </summary>
public class SharpQueryAddconnectionCommand : AbstractSharpQueryCommand
{
public override bool IsEnabled
{
get
{
return base.IsEnabled && (this.sharpQueryNode is SharpQueryNodeDatabaseRoot);
}
set { }
}
/// <summary>
/// Add a connection to a database server into the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"></see>
/// </summary>
public override void Run()
{
(this.sharpQueryNode as SharpQueryNodeDatabaseRoot).BuildsChilds();
}
}
/// <summary>
/// Remove a connection from a database server into the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"></see>
/// </summary>
public class SharpQueryRemoveConnectionCommand : AbstractSharpQueryCommand
{
public override bool IsEnabled
{
get
{
return base.IsEnabled && (this.sharpQueryNode is SharpQueryNodeConnection);
}
set { }
}
/// <summary>
/// Remove a connection from a database server into the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"></see>
/// </summary>
public override void Run()
{
(this.sharpQueryNode as SharpQueryNodeConnection).RemoveConnection();
}
}
/// <summary>
/// Remove a connection from a database server into the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"></see>
/// </summary>
public class SharpQueryModifyConnectionCommand : AbstractSharpQueryCommand
{
public override bool IsEnabled
{
get
{
return base.IsEnabled && (this.sharpQueryNode is SharpQueryNodeConnection);
}
set { }
}
/// <summary>
/// Remove a connection from a database server into the <see cref="SharpQuery.Gui.TreeView.SharpQueryTree"></see>
/// </summary>
public override void Run()
{
(this.sharpQueryNode as SharpQueryNodeConnection).ModifyConnection();
}
}
/// <summary>
/// Disconnect From a database server
/// </summary>
public class SharpQueryDisconnectCommand : AbstractSharpQueryCommand
{
public override bool IsEnabled
{
get
{
return base.IsEnabled && (this.sharpQueryNode is SharpQueryNodeConnection)
&& (this.sharpQueryNode as SharpQueryNodeConnection).IsConnected == true;
}
set { }
}
public SharpQueryDisconnectCommand()
: base()
{
}
/// <summary>
/// Disconnect From a database server
/// </summary>
public override void Run()
{
(this.sharpQueryNode as SharpQueryNodeConnection).Disconnect();
}
}
/// <summary>
/// Disconnect From a database server
/// </summary>
public class SharpQueryConnectCommand : AbstractSharpQueryCommand
{
public override bool IsEnabled
{
get
{
return base.IsEnabled && (this.sharpQueryNode is SharpQueryNodeConnection)
&& (this.sharpQueryNode as SharpQueryNodeConnection).IsConnected == false;
}
set { }
}
public SharpQueryConnectCommand()
: base()
{
}
/// <summary>
/// Disconnect From a database server
/// </summary>
public override void Run()
{
(this.sharpQueryNode as SharpQueryNodeConnection).Connect();
}
}
/// <summary>
/// Disconnect From a database server
/// </summary>
public class SharpQueryExecuteCommand : AbstractSharpQueryCommand
{
public SharpQueryExecuteCommand()
: base()
{
}
/// <summary>
/// Disconnect From a database server
/// </summary>
public override void Run()
{
this.sharpQueryNode.Execute(0);
}
}
}

797
src/AddIns/Misc/SharpQuery/Src/SharpQuerySchemaClass.cs

@ -0,0 +1,797 @@ @@ -0,0 +1,797 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Luc Morin" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using SharpQuery.Collections;
using System.Reflection;
using ICSharpCode.Core;
using SharpQuery.Connection;
namespace SharpQuery.SchemaClass
{
//
// Children
//
///<summary>
/// Column class
///</summary>
public class SharpQueryColumn : AbstractSharpQuerySchemaClass
{
public override string NormalizedName
{
get
{
string normalizedName = "";
if ((this.OwnerName != "") && (this.OwnerName != null))
{
normalizedName += this.OwnerName + ".";
}
normalizedName += this.Name;
return normalizedName;
}
}
protected override void CreateEntitiesList()
{
}
public SharpQueryColumn(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
}
protected override void OnRefresh()
{
//nothing !
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
DataObject returnValue = new DataObject();
string extract = this.NormalizedName;
returnValue.SetData(typeof(string), extract);
return returnValue;
}
}
}
///<summary>
/// Procedurre's parameters class
///</summary>
public class SharpQueryParameter : AbstractSharpQuerySchemaClass
{
private DbType _dataType;
private object _value = null;
private ParameterDirection _type;
///<summary>
/// Data Type of the parameter
/// ( used only while extracting data or executing procedure )
///</summary>
public DbType DataType
{
get
{
return this._dataType;
}
set
{
this._dataType = value;
switch (value)
{
//string type
case DbType.AnsiString:
case DbType.AnsiStringFixedLength:
case DbType.String:
case DbType.StringFixedLength: this._value = new string((char[])null); break;
//array type
case DbType.Binary: this._value = new byte[8000]; break;
//bool type
case DbType.Boolean: this._value = new bool(); break;
//interger type
case DbType.SByte: this._value = new sbyte(); break;
case DbType.Byte: this._value = new byte(); break;
case DbType.Int16: this._value = new short(); break;
case DbType.Int32: this._value = new int(); break;
case DbType.Int64: this._value = new long(); break;
case DbType.UInt16: this._value = new ushort(); break;
case DbType.UInt32: this._value = new uint(); break;
case DbType.UInt64: this._value = new long(); break;
//Date type
case DbType.Date:
case DbType.DateTime:
case DbType.Time: this._value = new DateTime(); break;
//float type
case DbType.Decimal: this._value = new decimal(); break;
case DbType.Currency:
case DbType.VarNumeric:
case DbType.Double: this._value = new double(); break;
case DbType.Single: this._value = new float(); break;
//user defined
case DbType.Object: this._value = new object(); break;
//Guid
case DbType.Guid: this._value = new Guid(); break;
default: throw new ArgumentOutOfRangeException("value");
}
}
}
protected void SetValue(string value)
{
switch (this.DataType)
{
//string type
case DbType.Object:
case DbType.Binary:
case DbType.AnsiString:
case DbType.AnsiStringFixedLength:
case DbType.String:
case DbType.StringFixedLength: this._value = value; break;
case DbType.Boolean: this._value = bool.Parse(value); break;
case DbType.SByte: this._value = sbyte.Parse(value); break;
case DbType.Byte: this._value = byte.Parse(value); break;
case DbType.Int16: this._value = short.Parse(value); break;
case DbType.Int32: this._value = int.Parse(value); break;
case DbType.Int64: this._value = long.Parse(value); break;
case DbType.UInt16: this._value = ushort.Parse(value); break;
case DbType.UInt32: this._value = uint.Parse(value); break;
case DbType.UInt64: this._value = long.Parse(value); break;
case DbType.Date:
case DbType.DateTime:
case DbType.Time: this._value = DateTime.Parse(value); break;
case DbType.Decimal: this._value = decimal.Parse(value); break;
case DbType.Currency:
case DbType.VarNumeric:
case DbType.Double: this._value = double.Parse(value); break;
case DbType.Single: this._value = float.Parse(value); break;
case DbType.Guid: this._value = new Guid(value); break;
default: throw new ArgumentOutOfRangeException("value");
}
}
///<summary>
/// Value of the parameter
/// ( used only while extracting data or executing procedure )
///</summary>
public object Value
{
get
{
return this._value;
}
set
{
this.SetValue(value.ToString());
}
}
///<summary>
/// Value of the parameter
/// ( used only while extracting data or executing procedure )
///</summary>
public ParameterDirection Type
{
get
{
return this._type;
}
set
{
this._type = value;
}
}
public override string NormalizedName
{
get
{
string normalizedName = "";
if ((this.OwnerName != "") && (this.OwnerName != null))
{
normalizedName += this.OwnerName + ".";
}
normalizedName += this.Name;
return normalizedName;
}
}
protected override void CreateEntitiesList()
{
}
public SharpQueryParameter(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
this.pEntities = null;
}
protected override void OnRefresh()
{
//nothing !
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see></returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
DataObject returnValue = new DataObject();
string extract = NormalizedName;
returnValue.SetData(typeof(string), extract);
return returnValue;
}
}
}
///<summary>
/// Table class
///</summary>
public class SharpQueryProcedure : AbstractSharpQuerySchemaClass
{
public override string NormalizedName
{
get
{
if ((this.CatalogName != "") && (this.CatalogName != null))
{
return this.CatalogName + "." + this.Name;
}
else
{
return CheckWhiteSpace(this.Connection.GetProperty(AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum.DataSource).ToString()) + "." + this.Name;
}
}
}
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("PROCEDURE_COLUMNS", new SharpQuerySchemaClassCollection());
this.pEntities.Add("PROCEDURE_PARAMETERS", new SharpQuerySchemaClassCollection());
}
public SharpQueryProcedure(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
}
public override SharpQuerySchemaClassCollection GetSchemaParameters()
{
return this.pDataConnection.GetSchemaProcedureParameters(this);
}
public override SharpQuerySchemaClassCollection GetSchemaColumns()
{
return this.pDataConnection.GetSchemaProcedureColumns(this);
}
protected override void OnRefresh()
{
this.Entities["PROCEDURE_COLUMNS"].AddRange(this.GetSchemaColumns());
this.Entities["PROCEDURE_PARAMETERS"].AddRange(this.GetSchemaParameters());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
return this.Connection.ExecuteProcedure(this, rows, parameters);
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
DataObject returnValue = new DataObject();
string extract = "EXECUTE " + NormalizedName;
returnValue.SetData(typeof(string), extract);
return returnValue;
}
}
}
///<summary>
/// Table class
///</summary>
public class SharpQueryTable : AbstractSharpQuerySchemaClass
{
public override string NormalizedName
{
get
{
if ((this.CatalogName != "") && (this.CatalogName != null))
{
return this.CatalogName + "." + this.Name;
}
else
{
return CheckWhiteSpace(this.Connection.GetProperty(AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum.DataSource).ToString()) + "." + this.Name;
}
}
}
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("TABLE_COLUMNS", new SharpQuerySchemaClassCollection());
}
public SharpQueryTable(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
}
public override SharpQuerySchemaClassCollection GetSchemaColumns()
{
return this.pDataConnection.GetSchemaTableColumns(this);
}
protected override void OnRefresh()
{
this.Entities["TABLE_COLUMNS"].AddRange(this.GetSchemaColumns());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
return this.Connection.ExtractData(this, rows);
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
string SQLSelect = "SELECT ";
string SQLFrom = "FROM ";
SharpQuerySchemaClassCollection entitieslist = null;
SQLFrom += this.Name;
this.Refresh();
//we have only a table or view :o)
foreach (KeyValuePair<string, SharpQuerySchemaClassCollection> DicEntry in Entities)
{
entitieslist = DicEntry.Value as SharpQuerySchemaClassCollection;
break;
}
if (entitieslist == null)
{
throw new System.ArgumentNullException("entitieslist");
}
foreach (ISchemaClass column in entitieslist)
{
SQLSelect += column.NormalizedName;
SQLSelect += ",";
}
SQLSelect = SQLSelect.TrimEnd(new Char[] { ',' });
SQLSelect += " ";
DataObject returnValue = new DataObject();
returnValue.SetData(typeof(string), SQLSelect + SQLFrom);
return returnValue;
}
}
}
///<summary>
/// View class
///</summary>
public class SharpQueryView : AbstractSharpQuerySchemaClass
{
public override string NormalizedName
{
get
{
if ((this.CatalogName != "") && (this.CatalogName != null))
{
return this.CatalogName + "." + this.Name;
}
else
{
return CheckWhiteSpace(this.Connection.GetProperty(AbstractSharpQueryConnectionWrapper.SharpQueryPropertyEnum.DataSource).ToString()) + "." + this.Name;
}
}
}
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("VIEWS_COLUMNS", new SharpQuerySchemaClassCollection());
}
public SharpQueryView(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
}
public override SharpQuerySchemaClassCollection GetSchemaColumns()
{
return this.pDataConnection.GetSchemaViewColumns(this);
}
protected override void OnRefresh()
{
this.Entities["VIEWS_COLUMNS"].AddRange(this.GetSchemaColumns());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
return this.Connection.ExtractData(this, rows);
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
string SQLSelect = "SELECT ";
string SQLFrom = "FROM ";
SharpQuerySchemaClassCollection entitieslist = null;
SQLFrom += this.Name;
this.Refresh();
//we have only a table or view :o)
foreach (KeyValuePair<string, SharpQuerySchemaClassCollection> DicEntry in Entities)
{
entitieslist = DicEntry.Value as SharpQuerySchemaClassCollection;
break;
}
if (entitieslist == null)
{
throw new System.ArgumentNullException("entitieslist");
}
foreach (ISchemaClass column in entitieslist)
{
SQLSelect += column.NormalizedName;
SQLSelect += ",";
}
SQLSelect = SQLSelect.TrimEnd(new Char[] { ',' });
SQLSelect += " ";
DataObject returnValue = new DataObject();
returnValue.SetData(typeof(string), SQLSelect + SQLFrom);
return returnValue;
}
}
}
///<summary>
/// Class for unsupported functions
///</summary>
public class SharpQueryNotSupported : AbstractSharpQuerySchemaClass
{
protected override void CreateEntitiesList()
{
}
public SharpQueryNotSupported(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
this.pName += " " + StringParser.Parse("${res:SharpQuery.Error.NotSuported}") + " " + connection.Provider;
}
protected override void OnRefresh()
{
//nothing !
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
}
///<summary>
/// Class lis of Tables
///</summary>
public class SharpQueryTables : AbstractSharpQuerySchemaClass
{
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("TABLES", new SharpQuerySchemaClassCollection());
}
public SharpQueryTables(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
this.pName = StringParser.Parse("${res:SharpQuery.Label.TablesRoot}");
}
protected override void OnRefresh()
{
this.Entities["TABLES"].AddRange(this.GetSchemaTables());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
}
///<summary>
/// Class lis of Views
///</summary>
public class SharpQueryViews : AbstractSharpQuerySchemaClass
{
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("VIEWS", new SharpQuerySchemaClassCollection());
}
public SharpQueryViews(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
this.pName = StringParser.Parse("${res:SharpQuery.Label.ViewsRoot}");
}
protected override void OnRefresh()
{
this.Entities["VIEWS"].AddRange(this.GetSchemaViews());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
}
///<summary>
/// Class lis of Procedures
///</summary>
public class SharpQueryProcedures : AbstractSharpQuerySchemaClass
{
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("PROCEDURES", new SharpQuerySchemaClassCollection());
}
public SharpQueryProcedures(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
this.pName = StringParser.Parse("${res:SharpQuery.Label.ProceduresRoot}");
}
protected override void OnRefresh()
{
this.Entities["PROCEDURES"].AddRange(this.GetSchemaProcedures());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
}
///<summary>
/// Class lis of Schemas
///</summary>
public class SharpQuerySchema : AbstractSharpQuerySchemaClass
{
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
SharpQuerySchemaClassCollection cl;
cl = new SharpQuerySchemaClassCollection();
cl.Add(new SharpQueryTables(this.pDataConnection, this.CatalogName, this.Name, "", ""));
this.pEntities.Add("TABLES", cl);
cl = new SharpQuerySchemaClassCollection();
cl.Add(new SharpQueryViews(this.pDataConnection, this.CatalogName, this.Name, "", ""));
this.pEntities.Add("VIEWS", cl);
cl = new SharpQuerySchemaClassCollection();
cl.Add(new SharpQueryProcedures(this.pDataConnection, this.CatalogName, this.Name, "", ""));
this.pEntities.Add("PROCEDURES", cl);
}
public SharpQuerySchema(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
}
protected override void OnRefresh()
{
// Nothing !
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
DataObject returnValue = new DataObject();
string extract = NormalizedName;
returnValue.SetData(typeof(string), extract);
return returnValue;
}
}
}
///<summary>
/// Class for a catalog
///</summary>
public class SharpQueryCatalog : AbstractSharpQuerySchemaClass
{
protected override void CreateEntitiesList()
{
base.CreateEntitiesList();
this.pEntities.Add("SCHEMAS", new SharpQuerySchemaClassCollection());
}
public SharpQueryCatalog(IConnection connection, string catalogName, string schemaName, string ownerName, string name)
: base(connection, catalogName, schemaName, ownerName, name)
{
}
protected override void OnRefresh()
{
this.Entities["SCHEMAS"].AddRange(this.GetSchemaSchemas());
}
///<summary>
/// For a Table or a View extract data.
/// For a stocked procedure, execute it :o).
/// <param name="rows">Number of row to extract. if "0", extract all rows.</param>
/// <returns><see cref="System.Data.DataTable">DataTable</see>
/// or a <see cref="System.Data.DataSet">DataSet</see> </returns>
/// </summary>
public override object Execute(int rows, SharpQuerySchemaClassCollection parameters)
{
//nothing
return null;
}
///<summary> return a <see cref="System.Windows.Forms.DataObject">DataObject</see>
///</summary>
public override DataObject DragObject
{
get
{
DataObject returnValue = new DataObject();
string extract = NormalizedName;
returnValue.SetData(typeof(string), extract);
return returnValue;
}
}
}
}

3
src/Main/Base/Project/Src/Dom/IReturnType.cs

@ -113,7 +113,8 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -113,7 +113,8 @@ namespace ICSharpCode.SharpDevelop.Dom
}
/// <summary>
/// Gets the underlying class of this return type.
/// Gets the underlying class of this return type. This method will return <c>null</c> for
/// generic return types and types that cannot be resolved.
/// </summary>
IClass GetUnderlyingClass();

2
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs

@ -259,7 +259,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -259,7 +259,7 @@ namespace ICSharpCode.SharpDevelop.Gui
DialogResult dr = MessageBox.Show(ResourceService.GetString("MainWindow.SaveChangesMessage"),
ResourceService.GetString("MainWindow.SaveChangesMessageHeader") + " " + Title + " ?",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button3,
MessageBoxDefaultButton.Button1,
RightToLeftConverter.IsRightToLeft ? MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0);
switch (dr) {
case DialogResult.Yes:

12
src/Main/Base/Project/Src/Project/Converter/LanguageConverter.cs

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 14.01.2006
* Time: 14:10
*/
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;

BIN
src/Main/StartUp/Project/Resources/BitmapResources.resources

Binary file not shown.

9
src/SharpDevelop.sln

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.960
# SharpDevelop 2.0.0.990
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -32,6 +32,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CE5B42B7-6 @@ -32,6 +32,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CE5B42B7-6
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpQuery", "AddIns\Misc\SharpQuery\SharpQuery.csproj", "{BDD03ECD-42AE-4B50-9805-9C19090A264F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoReflectionLoader", "AddIns\Misc\MonoReflectionLoader\Project\MonoReflectionLoader.csproj", "{8C52FFA5-35AF-4E28-8498-2DC2F168A241}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoAddIn", "AddIns\Misc\MonoAddIn\Project\MonoAddIn.csproj", "{082DCD64-EE32-4151-A50F-E139CF754CC0}"
@ -240,6 +242,10 @@ Global @@ -240,6 +242,10 @@ Global
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.Build.0 = Release|Any CPU
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Release|Any CPU.Build.0 = Release|Any CPU
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -269,6 +275,7 @@ Global @@ -269,6 +275,7 @@ Global
{5EEB99CF-EA2B-4733-80A6-CE9192D68170} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{082DCD64-EE32-4151-A50F-E139CF754CC0} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{8C52FFA5-35AF-4E28-8498-2DC2F168A241} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{BDD03ECD-42AE-4B50-9805-9C19090A264F} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}

Loading…
Cancel
Save