List:Commits« Previous MessageNext Message »
From:rburnett Date:December 9 2008 6:24pm
Subject:Connector/NET commit: r1478 - trunk/MySql.VisualStudio/Nodes
View as plain text  
Modified:
   trunk/MySql.VisualStudio/Nodes/BaseNode.cs
Log:
Added DefaultStorageEngine property and added a call to SetNodeProperty so our new objects are not referenced by their # but rather by their unique name

Modified: trunk/MySql.VisualStudio/Nodes/BaseNode.cs
===================================================================
--- trunk/MySql.VisualStudio/Nodes/BaseNode.cs	2008-12-09 18:13:38 UTC (rev 1477)
+++ trunk/MySql.VisualStudio/Nodes/BaseNode.cs	2008-12-09 18:24:07 UTC (rev 1478)
@@ -24,6 +24,7 @@
 		protected Guid editorGuid;
 		protected Guid commandGroupGuid;
         protected string name;
+        private static string defaultStorageEngine;
 
 		public BaseNode(DataViewHierarchyAccessor hierarchyAccessor, int id)
 		{
@@ -88,6 +89,20 @@
             }
         }
 
+        public string DefaultStorageEngine
+        {
+            get
+            {
+                if (defaultStorageEngine == null)
+                {
+                    DataTable dt = GetDataTable("SHOW VARIABLES LIKE 'storage_engine'");
+                    defaultStorageEngine = "MyISAM";
+                    if (dt != null && dt.Rows.Count == 1)
+                        defaultStorageEngine = (string)dt.Rows[0][1];
+                }
+                return defaultStorageEngine;
+            }
+        }
 
     	#endregion
 
@@ -178,6 +193,7 @@
                         uniqueIndex++;
                 }
                 Name = String.Format("{0}{1}", NodeId, uniqueIndex).Replace(" ", "");
+                HierarchyAccessor.SetProperty(ItemId, (int)__VSHPROPID.VSHPROPID_Name, Name);
                 return Name;
             }
             finally

Thread
Connector/NET commit: r1478 - trunk/MySql.VisualStudio/Nodesrburnett9 Dec