List:Commits« Previous MessageNext Message »
From:rburnett Date:April 21 2006 2:32am
Subject:Connector/NET commit: r223 - in trunk/VSTools: . CtcComponents Editors Resources
View as plain text  
Added:
   trunk/VSTools/DebugTrace.cs
   trunk/VSTools/QueryControl.Designer.cs
   trunk/VSTools/QueryControl.cs
   trunk/VSTools/QueryControl.resx
   trunk/VSTools/QueryToolWindow.cs
Removed:
   trunk/VSTools/MyVSTools.sln
Modified:
   trunk/VSTools/CtcComponents/MyVSTools.ctc
   trunk/VSTools/CtcComponents/PkgCmdID.h
   trunk/VSTools/EditorFactory.cs
   trunk/VSTools/Editors/BaseEditor.cs
   trunk/VSTools/Editors/StoredProcedureEditor.cs
   trunk/VSTools/MyExplorerWindow.cs
   trunk/VSTools/MyVSTools.csproj
   trunk/VSTools/PkgCmdID.cs
   trunk/VSTools/Resources/Images_32bit.bmp
   trunk/VSTools/Resources/Thumbs.db
   trunk/VSTools/VSPackage.Designer.cs
   trunk/VSTools/VSPackage.resx
   trunk/VSTools/VsPkg.cs
Log:
MyVSTools.ctc
   added resources for query window
PkgCmdID.h
PkgCmdID.cs
   added constants for query window
EditorFactory.cs
   now uses NodeFromId to get the active node and then asks that node for it's editor
StoredProcedureEditor.cs
   Added SqlText property
MyExplorerWindow.cs
   Changed to using bitmap 300 for the resources
   Added NewQuery handler


Modified: trunk/VSTools/CtcComponents/MyVSTools.ctc
===================================================================
--- trunk/VSTools/CtcComponents/MyVSTools.ctc	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/CtcComponents/MyVSTools.ctc	2006-04-21 02:32:15 UTC (rev 223)
@@ -59,6 +59,7 @@
 
 	  // NewMenu                              Relative to Group                       Priority    Type        Name                    Text
     guidMyVSToolsCmdSet:MyToolbar, guidMyVSToolsCmdSet:MyToolbar, 0x0000, TOOLWINDOWTOOLBAR, "My Toolbar";
+    guidMyVSToolsCmdSet:QueryToolbar, guidMyVSToolsCmdSet:QueryToolbar, 0x0000, TOOLWINDOWTOOLBAR, "Query Toolbar";
     guidMyVSToolsCmdSet:ServerCtxtMenu, guidMyVSToolsCmdSet:0, 0x0000, CONTEXT|ALWAYSCREATE|NOCUSTOMIZE, "ServerContextMenu";
     guidMyVSToolsCmdSet:DatabaseCtxtMenu, guidMyVSToolsCmdSet:0, 0x0000, CONTEXT|ALWAYSCREATE|NOCUSTOMIZE, "DatabaseContextMenu";
     guidMyVSToolsCmdSet:TablesCtxtMenu, guidMyVSToolsCmdSet:0, 0x0000, CONTEXT|ALWAYSCREATE|NOCUSTOMIZE, "TablesContextMenu";
@@ -82,6 +83,8 @@
     // NewGroup                              Parent Group                            Priority
     guidMyVSToolsCmdSet:MyMenuGroup,    guidSHLMainMenu:IDM_VS_MENU_TOOLS, 0x0600;
     guidMyVSToolsCmdSet:MyToolbarGroup,    guidMyVSToolsCmdSet:MyToolbar, 0x0000;
+    guidMyVSToolsCmdSet:QueryToolbarGroup, guidMyVSToolsCmdSet:QueryToolbar, 0x0000;
+    guidMyVSToolsCmdSet:QueryResultsGroup, guidMyVSToolsCmdSet:QueryToolbar, 0x0001;
     guidMyVSToolsCmdSet:ConnectionGroup, guidMyVSToolsCmdSet:ServerCtxtMenu, 0x1000;
     guidMyVSToolsCmdSet:DeleteGroup, guidMyVSToolsCmdSet:ServerCtxtMenu, 0x1001;
     guidMyVSToolsCmdSet:PropertiesGroup, guidMyVSToolsCmdSet:ServerCtxtMenu, 0x1002;
@@ -116,6 +119,7 @@
     guidMyVSToolsCmdSet:cmdidMyExplorerWindow,    guidSHLMainMenu:IDG_VS_WNDO_OTRWNDWS1,    0x0100,        guidMyVSToolsCmdSet:bmpPic2,    BUTTON,    ,            "MySQL Explorer";
 
     guidMyVSToolsCmdSet:cmdidModifyConnection, guidMyVSToolsCmdSet:ConnectionGroup, 0x0101, guidMyVSToolsCmdSet:0, BUTTON, ,"Modify Connection...";
+    guidMyVSToolsCmdSet:cmdidNewQuery, guidMyVSToolsCmdSet:ConnectionGroup, 0x102, guidMyVSToolsCmdSet:bmpPicNewQuery, BUTTON, "New Query";
     guidMyVSToolsCmdSet:cmdidDelete, guidMyVSToolsCmdSet:DeleteGroup, 0x100, guidMyVSToolsCmdSet:bmpPicDelete, BUTTON, , "Delete";
 //    guidMyVSToolsCmdSet:cmdidRename, guidMyVSToolsCmdSet:DeleteGroup, 0x101, guidMyVSToolsCmdSet:0, BUTTON, , "Rename";
     guidMyVSToolsCmdSet:cmdidProperties, guidMyVSToolsCmdSet:PropertiesGroup, 0x100, guidMyVSToolsCmdSet:bmpPicProperties, BUTTON, , "Properties";
@@ -139,6 +143,12 @@
 
    // Trigger menus
    guidMyVSToolsCmdSet:cmdidAddNewTrigger, guidMyVSToolsCmdSet:TriggerGroup, 0x100, guidMyVSToolsCmdSet:0, BUTTON, , "Add New &Trigger";
+
+   // Query toolbar
+   guidMyVSToolsCmdSet:cmdidExecuteQuery, guidMyVSToolsCmdSet:QueryToolbarGroup, 0x100, guidMyVSToolsCmdSet:bmpPicExecQuery, BUTTON, "Execute Query";
+   guidMyVSToolsCmdSet:cmdidShowSQL, guidMyVSToolsCmdSet:QueryResultsGroup, 0x100, guidMyVSToolsCmdSet:bmpPicSql, BUTTON "Show SQL";
+   guidMyVSToolsCmdSet:cmdidShowGrid, guidMyVSToolsCmdSet:QueryResultsGroup, 0x101, guidMyVSToolsCmdSet:bmpPicGrid, BUTTON "Show results as grid";
+   guidMyVSToolsCmdSet:cmdidShowText, guidMyVSToolsCmdSet:QueryResultsGroup, 0x102, guidMyVSToolsCmdSet:bmpPicText, BUTTON "Show results as text";
   BUTTONS_END
 
   // The bitmaps section is used to define the bitmaps that are used for the commands.
@@ -150,7 +160,7 @@
     // must be the actual index (1-based) of the bitmap inside the bitmap strip.
 
 	  // Bitmap                          Bitmap Index, Bitmap Index, ...
-    guidMyVSToolsCmdSet:IDB_MENU_IMAGES,    bmpPic1, bmpPic2, bmpPicSmile, bmpPicX, bmpPicArrows, bmpPicRefresh, bmpPicDelete, bmpPicProperties, bmpPicOpen, bmpPicClone;
+    guidMyVSToolsCmdSet:IDB_MENU_IMAGES,    bmpPic1, bmpPic2, bmpPicSmile, bmpPicX, bmpPicArrows, bmpPicRefresh, bmpPicDelete, bmpPicProperties, bmpPicOpen, bmpPicClone, bmpPicExecQuery, bmpPicSql, bmpPicGrid, bmpPicText, bmpPicNewQuery;
   BITMAPS_END
 
 CMDS_END

Modified: trunk/VSTools/CtcComponents/PkgCmdID.h
===================================================================
--- trunk/VSTools/CtcComponents/PkgCmdID.h	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/CtcComponents/PkgCmdID.h	2006-04-21 02:32:15 UTC (rev 223)
@@ -21,6 +21,7 @@
 #define FunctionCtxtMenu            0x1010
 #define TriggerCtxtMenu             0x1011
 #define ColumnCtxtMenu              0x1012
+#define QueryToolbar                0x1013
 
 ///////////////////////////////////////////////////////////////////////////////
 // Menu Group IDs
@@ -39,6 +40,8 @@
 #define ViewGroup                   0x1060
 #define FunctionGroup               0x1061
 #define TriggerGroup                0x1062
+#define QueryToolbarGroup           0x1063
+#define QueryResultsGroup           0x1064
 
 ///////////////////////////////////////////////////////////////////////////////
 // Command IDs
@@ -59,6 +62,11 @@
 #define cmdidShowTableData    0x113
 #define cmdidAddNewView       0x114
 #define cmdidAddNewFunction   0x115
+#define cmdidNewQuery         0x116
+#define cmdidExecuteQuery     0x117
+#define cmdidShowSQL          0x118
+#define cmdidShowGrid         0x119
+#define cmdidShowText         0x120
 
 ///////////////////////////////////////////////////////////////////////////////
 // Bitmap IDs
@@ -72,6 +80,10 @@
 #define bmpPicProperties 8
 #define bmpPicOpen       9
 #define bmpPicClone      10
+#define bmpPicExecQuery  11
+#define bmpPicSql        12
+#define bmpPicGrid       13
+#define bmpPicText       14
+#define bmpPicNewQuery   15
 
-
 #endif // __PKGCMDID_H_

Added: trunk/VSTools/DebugTrace.cs
===================================================================
--- trunk/VSTools/DebugTrace.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/DebugTrace.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -0,0 +1,13 @@
+using System;
+using System.Diagnostics;
+
+namespace MySql.VSTools
+{
+    class DebugTrace
+    {
+        public static void Trace(string message)
+        {
+            Debug.WriteLine(message);
+        }
+    }
+}

Modified: trunk/VSTools/EditorFactory.cs
===================================================================
--- trunk/VSTools/EditorFactory.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/EditorFactory.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -120,10 +120,12 @@
             }
 
             // Create the Document (editor)
-//            DummyEditor newEditor = new DummyEditor();
-  //          ppunkDocView = Marshal.GetIUnknownForObject(newEditor);
-    //        ppunkDocData = Marshal.GetIUnknownForObject(newEditor);
-      //      pbstrEditorCaption = "";
+            ServerNode parent = (pvHier as ServerNode);
+            ProcedureNode pn = (ProcedureNode)parent.NodeFromId(itemid);
+            BaseEditor newEditor = pn.GetEditor();
+            ppunkDocView = Marshal.GetIUnknownForObject(newEditor);
+            ppunkDocData = Marshal.GetIUnknownForObject(newEditor);
+            pbstrEditorCaption = "";
 
             return VSConstants.S_OK;
         }

Modified: trunk/VSTools/Editors/BaseEditor.cs
===================================================================
--- trunk/VSTools/Editors/BaseEditor.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/Editors/BaseEditor.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -419,6 +419,16 @@
 
         int IVsWindowPane.ClosePane()
         {
+/*            string filename2;
+            uint flags, readLocks, editLocks, itemId;
+            IVsHierarchy pHeir;
+            IntPtr punkData;
+            int result = rdt.GetDocumentInfo(cookie, out flags, out readLocks, out editLocks,
+                out filename2, out pHeir, out itemId, out punkData);
+            result = rdt.UnlockDocument((uint)_VSRDTFLAGS.RDT_Unlock_PromptSave,
+                Cookie);
+            result = rdt.GetDocumentInfo(cookie, out flags, out readLocks, out editLocks,
+                out filename2, out pHeir, out itemId, out punkData);*/
             this.Dispose(true);
             return VSConstants.S_OK;
         }

Modified: trunk/VSTools/Editors/StoredProcedureEditor.cs
===================================================================
--- trunk/VSTools/Editors/StoredProcedureEditor.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/Editors/StoredProcedureEditor.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -46,8 +46,12 @@
             sqlText.Font = new Font(family.Value.ToString(), 
                 float.Parse(size.Value.ToString()));
         }
-		
 
+        public string SqlText
+        {
+            get { return sqlText.Text; }
+        }
+
         protected override Guid EditorGuid
         {
             get { return GuidList.guidProcedureEditor; }

Modified: trunk/VSTools/MyExplorerWindow.cs
===================================================================
--- trunk/VSTools/MyExplorerWindow.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/MyExplorerWindow.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -28,7 +28,6 @@
         // using the Window property. Note that, even if this class implements IDispose, we are
         // not calling Dispose on this object. This is because ToolWindowPane calls Dispose on 
         // the object returned by the Window property.
-//        private ExplorerControl control;
         private ITrackSelection trackSel;
         private SelectionContainer selectContainer;
         private List<ServerNode> serverList;
@@ -51,7 +50,7 @@
             // The resource ID correspond to the one defined in the resx file
             // while the Index is the offset in the bitmap strip. Each image in
             // the strip being 16x16.
-            this.BitmapResourceID = 301;
+            this.BitmapResourceID = 300;
             this.BitmapIndex = 1;
 
 
@@ -182,6 +181,7 @@
                 AddCommand(mcs, PkgCmdIDList.cmdidAddNewFunction);
                 AddCommand(mcs, PkgCmdIDList.cmdidAddNewView);
                 AddCommand(mcs, PkgCmdIDList.cmdidOpenTableDef);
+                AddCommand(mcs, PkgCmdIDList.cmdidNewQuery);
             }
         }
 

Modified: trunk/VSTools/MyVSTools.csproj
===================================================================
--- trunk/VSTools/MyVSTools.csproj	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/MyVSTools.csproj	2006-04-21 02:32:15 UTC (rev 223)
@@ -89,6 +89,7 @@
     <Compile Include="..\\mysqlclient\\ConnectionString.cs" />
     <Compile Include="..\\mysqlclient\\common\\dbConnectionString.cs" />
     <Compile Include="..\\mysqlclient\\common\\utility.cs" />
+    <Compile Include="DebugTrace.cs" />
     <Compile Include="Editor.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -116,6 +117,13 @@
     <Compile Include="Nodes\MyHierarchyNode.cs" />
     <None Include="Resources\Microsoft.VisualStudio.Package.Project.cs" />
     <Compile Include="Nodes\TriggerNode.cs" />
+    <Compile Include="QueryControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="QueryControl.Designer.cs">
+      <DependentUpon>QueryControl.cs</DependentUpon>
+    </Compile>
+    <Compile Include="QueryToolWindow.cs" />
     <Compile Include="TableDataControl.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -167,6 +175,10 @@
       <DependentUpon>TableEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
+    <EmbeddedResource Include="QueryControl.resx">
+      <SubType>Designer</SubType>
+      <DependentUpon>QueryControl.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Resources\Microsoft.VisualStudio.Package.Project.resx">
       <DependentUpon>Microsoft.VisualStudio.Package.Project.cs</DependentUpon>
       <SubType>Designer</SubType>

Deleted: trunk/VSTools/MyVSTools.sln
===================================================================
--- trunk/VSTools/MyVSTools.sln	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/MyVSTools.sln	2006-04-21 02:32:15 UTC (rev 223)
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyVSTools", "MyVSTools.csproj", "{70DE1923-4FE6-4A4B-B027-8F55E60D4CA0}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{70DE1923-4FE6-4A4B-B027-8F55E60D4CA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{70DE1923-4FE6-4A4B-B027-8F55E60D4CA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{70DE1923-4FE6-4A4B-B027-8F55E60D4CA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{70DE1923-4FE6-4A4B-B027-8F55E60D4CA0}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

Modified: trunk/VSTools/PkgCmdID.cs
===================================================================
--- trunk/VSTools/PkgCmdID.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/PkgCmdID.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -23,6 +23,7 @@
         public const uint FunctionCtxtMenu = 0x1010;
         public const uint TriggerCtxtMenu = 0x1011;
         public const uint ColumnCtxtMenu = 0x1012;
+        public const uint QueryToolbar = 0x1013;
 
         // commands
         public const int cmdidRefresh = 0x102;
@@ -39,5 +40,10 @@
         public const int cmdidShowTableData = 0x113;
         public const int cmdidAddNewView = 0x114;
         public const int cmdidAddNewFunction = 0x115;
+        public const int cmdidNewQuery = 0x116;
+        public const int cmdidExecuteQuery = 0x117;
+        public const int cmdidShowSQL = 0x118;
+        public const int cmdidShowGrid = 0x119;
+        public const int cmdidShowText = 0x120;
     };
 }
\ No newline at end of file

Added: trunk/VSTools/QueryControl.Designer.cs
===================================================================
--- trunk/VSTools/QueryControl.Designer.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/QueryControl.Designer.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -0,0 +1,101 @@
+namespace MySql.VSTools
+{
+    partial class QueryControl
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.inputBox = new System.Windows.Forms.RichTextBox();
+            this.splitter1 = new System.Windows.Forms.Splitter();
+            this.resultsGrid = new System.Windows.Forms.DataGridView();
+            this.resultsText = new System.Windows.Forms.TextBox();
+            ((System.ComponentModel.ISupportInitialize)(this.resultsGrid)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // inputBox
+            // 
+            this.inputBox.Dock = System.Windows.Forms.DockStyle.Top;
+            this.inputBox.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.inputBox.Location = new System.Drawing.Point(5, 5);
+            this.inputBox.Name = "inputBox";
+            this.inputBox.Size = new System.Drawing.Size(356, 96);
+            this.inputBox.TabIndex = 0;
+            this.inputBox.Text = "";
+            // 
+            // splitter1
+            // 
+            this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.splitter1.Location = new System.Drawing.Point(5, 101);
+            this.splitter1.Name = "splitter1";
+            this.splitter1.Size = new System.Drawing.Size(356, 3);
+            this.splitter1.TabIndex = 1;
+            this.splitter1.TabStop = false;
+            // 
+            // resultsGrid
+            // 
+            this.resultsGrid.AllowUserToOrderColumns = true;
+            this.resultsGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.resultsGrid.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.resultsGrid.Location = new System.Drawing.Point(5, 104);
+            this.resultsGrid.Name = "resultsGrid";
+            this.resultsGrid.Size = new System.Drawing.Size(356, 219);
+            this.resultsGrid.TabIndex = 2;
+            // 
+            // resultsText
+            // 
+            this.resultsText.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.resultsText.Location = new System.Drawing.Point(5, 5);
+            this.resultsText.Multiline = true;
+            this.resultsText.Name = "resultsText";
+            this.resultsText.Size = new System.Drawing.Size(356, 318);
+            this.resultsText.TabIndex = 3;
+            this.resultsText.Visible = false;
+            // 
+            // QueryControl
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.resultsGrid);
+            this.Controls.Add(this.splitter1);
+            this.Controls.Add(this.inputBox);
+            this.Controls.Add(this.resultsText);
+            this.Name = "QueryControl";
+            this.Padding = new System.Windows.Forms.Padding(5);
+            this.Size = new System.Drawing.Size(366, 328);
+            ((System.ComponentModel.ISupportInitialize)(this.resultsGrid)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.RichTextBox inputBox;
+        private System.Windows.Forms.Splitter splitter1;
+        private System.Windows.Forms.DataGridView resultsGrid;
+        private System.Windows.Forms.TextBox resultsText;
+    }
+}

Added: trunk/VSTools/QueryControl.cs
===================================================================
--- trunk/VSTools/QueryControl.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/QueryControl.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.Common;
+using MySql.Data.MySqlClient;
+
+namespace MySql.VSTools
+{
+    public partial class QueryControl : UserControl
+    {
+        private MySqlConnection connection;
+        private bool showingSql;
+        private bool showingGrid;
+        private bool showingText;
+
+        public QueryControl()
+        {
+            InitializeComponent();
+            showingSql = true;
+            showingGrid = true;
+            showingText = false;
+        }
+
+        public DbConnection Connection
+        {
+            set { this.connection = (MySqlConnection)value; }
+        }
+
+        public bool ShowingSql
+        {
+            get { return showingSql; }
+            set { showingSql = value; ToggleWindows();  }
+        }
+
+        public bool ShowingGrid
+        {
+            get { return showingGrid; }
+            set { showingGrid = value; ToggleWindows();  }
+        }
+
+        public bool ShowingText
+        {
+            get { return showingText; }
+            set { showingText = value; ToggleWindows();  }
+        }
+
+        private void ToggleWindows()
+        {
+            inputBox.Visible = ShowingSql;
+            resultsGrid.Visible = ShowingGrid;
+            resultsText.Visible = ShowingText;
+        }
+
+        public void Execute()
+        {
+            MySqlDataAdapter da = new MySqlDataAdapter(inputBox.Text, connection);
+            DataTable dt = new DataTable();
+            da.Fill(dt);
+            this.resultsGrid.DataSource = dt;
+       }
+    }
+}

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

Added: trunk/VSTools/QueryToolWindow.cs
===================================================================
--- trunk/VSTools/QueryToolWindow.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/QueryToolWindow.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.VisualStudio.Shell;
+using System.Runtime.InteropServices;
+using System.ComponentModel.Design;
+using Microsoft.VisualStudio.OLE.Interop;
+using Microsoft.VisualStudio;
+
+namespace MySql.VSTools
+{
+    [Guid("C1BEFA59-9F84-443d-ABF0-035AE4CEE549")]
+    class QueryToolWindow : ToolWindowPane, IOleCommandTarget
+    {
+        private QueryControl queryControl;
+
+        public QueryToolWindow() : base(null)
+        {
+            this.ToolBar = new CommandID(GuidList.guidMyVSToolsCmdSet, 
+                (int)PkgCmdIDList.QueryToolbar);
+            queryControl = new QueryControl();
+
+            // Set the window title reading it from the resources.
+            Caption = MyVSTools.GetResourceString("QueryWindowTitle");
+
+            // Set the image that will appear on the tab of the window frame
+            // when docked with an other window
+            // The resource ID correspond to the one defined in the resx file
+            // while the Index is the offset in the bitmap strip. Each image in
+            // the strip being 16x16.
+            BitmapResourceID = 300;
+            BitmapIndex = 14;
+        }
+
+        public override System.Windows.Forms.IWin32Window Window
+        {
+            get { return queryControl; }
+        }
+
+        #region IOleCommandTarget Members
+
+        int IOleCommandTarget.Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
+        {
+            DebugTrace.Trace("group = " + pguidCmdGroup + ":cmdid=" + nCmdID);
+            if (pguidCmdGroup != GuidList.guidMyVSToolsCmdSet)
+                return (int)Microsoft.VisualStudio.OLE.Interop.Constants.OLECMDERR_E_UNKNOWNGROUP;
+
+            switch (nCmdID)
+            {
+                case PkgCmdIDList.cmdidExecuteQuery:
+                    queryControl.Execute();
+                    break;
+                case PkgCmdIDList.cmdidShowSQL:
+                    queryControl.ShowingSql = !queryControl.ShowingSql;
+                    break;
+                case PkgCmdIDList.cmdidShowGrid:
+                    queryControl.ShowingGrid = !queryControl.ShowingGrid;
+                    break;
+                case PkgCmdIDList.cmdidShowText:
+                    queryControl.ShowingText = !queryControl.ShowingText;
+                    break;
+            }
+            return VSConstants.S_OK;
+        }
+
+        int IOleCommandTarget.QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
+        {
+            if (pguidCmdGroup != GuidList.guidMyVSToolsCmdSet)
+                return (int)Microsoft.VisualStudio.OLE.Interop.Constants.OLECMDERR_E_UNKNOWNGROUP;
+
+            for (int i = 0; i < cCmds; i++)
+            {
+                if (prgCmds[i].cmdID == PkgCmdIDList.cmdidShowGrid)
+                    prgCmds[i].cmdf = (uint)(queryControl.ShowingGrid ? OLECMDF.OLECMDF_LATCHED :
+                        OLECMDF.OLECMDF_ENABLED);
+                if (prgCmds[i].cmdID == PkgCmdIDList.cmdidShowText)
+                    prgCmds[i].cmdf = (uint)(queryControl.ShowingText ? OLECMDF.OLECMDF_LATCHED :
+                        OLECMDF.OLECMDF_ENABLED);
+                if (prgCmds[i].cmdID == PkgCmdIDList.cmdidShowSQL)
+                    prgCmds[i].cmdf = (uint)(queryControl.ShowingSql ? OLECMDF.OLECMDF_LATCHED :
+                        OLECMDF.OLECMDF_ENABLED);
+            }
+
+            return VSConstants.S_OK;
+        }
+
+        #endregion
+    }
+}

Modified: trunk/VSTools/Resources/Images_32bit.bmp
===================================================================
(Binary files differ)

Modified: trunk/VSTools/Resources/Thumbs.db
===================================================================
(Binary files differ)

Modified: trunk/VSTools/VSPackage.Designer.cs
===================================================================
--- trunk/VSTools/VSPackage.Designer.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/VSPackage.Designer.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -100,6 +100,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Unable to create new query window.
+        /// </summary>
+        internal static string CanNotCreateQueryWindow {
+            get {
+                return ResourceManager.GetString("CanNotCreateQueryWindow", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Can not create tool window..
         /// </summary>
         internal static string CanNotCreateWindow {
@@ -188,6 +197,15 @@
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to QueryWindow Title.
+        /// </summary>
+        internal static string QueryWindowTitle {
+            get {
+                return ResourceManager.GetString("QueryWindowTitle", resourceCulture);
+            }
+        }
+        
         internal static System.Drawing.Bitmap server_node {
             get {
                 object obj = ResourceManager.GetObject("server-node", resourceCulture);

Modified: trunk/VSTools/VSPackage.resx
===================================================================
--- trunk/VSTools/VSPackage.resx	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/VSPackage.resx	2006-04-21 02:32:15 UTC (rev 223)
@@ -190,4 +190,10 @@
   <data name="column" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>Resources\db.Column.16x16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="CanNotCreateQueryWindow" xml:space="preserve">
+    <value>Unable to create new query window</value>
+  </data>
+  <data name="QueryWindowTitle" xml:space="preserve">
+    <value>QueryWindow Title</value>
+  </data>
 </root>
\ No newline at end of file

Modified: trunk/VSTools/VsPkg.cs
===================================================================
--- trunk/VSTools/VsPkg.cs	2006-04-19 18:17:51 UTC (rev 222)
+++ trunk/VSTools/VsPkg.cs	2006-04-21 02:32:15 UTC (rev 223)
@@ -46,7 +46,8 @@
     [ProvideMenuResource(1000, 1)]
     // This attribute registers a tool window exposed by this package.
     [ProvideToolWindow(typeof(MyToolWindow))]
-    [ProvideToolWindow(typeof(TableDataWindow), Style=Microsoft.VisualStudio.Shell.VsDockStyle.MDI)]
+    [ProvideToolWindow(typeof(QueryToolWindow), Style = Microsoft.VisualStudio.Shell.VsDockStyle.MDI)]
+    [ProvideToolWindow(typeof(TableDataWindow), Style = Microsoft.VisualStudio.Shell.VsDockStyle.MDI)]
     [ProvideEditorLogicalView(typeof(EditorFactory), "{7651a703-06e5-11d1-8ebd-00a0c90f26ea}")]
     [Guid("5ceb61c4-7111-44f8-b7f2-ac049b81ad32")]
     public sealed class MyVSTools : Package

Thread
Connector/NET commit: r223 - in trunk/VSTools: . CtcComponents Editors Resourcesrburnett21 Apr