[mapguide-commits] r5227 - in sandbox/maestro-3.0/Maestro.Base: Commands Templates UI

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Oct 1 00:36:11 EDT 2010


Author: jng
Date: 2010-10-01 04:36:11 +0000 (Fri, 01 Oct 2010)
New Revision: 5227

Modified:
   sandbox/maestro-3.0/Maestro.Base/Commands/NewItemCommand.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/DrawingSourceItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/FeatureSourceItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/ItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/LayerDefinitionItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/MapDefinitionItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/PrintLayoutItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/SdfLoadProcedureItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/ShpLoadProcedureItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/SymbolDefinitionItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/UserItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/WebLayoutItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.Designer.cs
   sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.cs
   sandbox/maestro-3.0/Maestro.Base/UI/SiteExplorer.cs
Log:
Remove name and parent folder from New Resource Dialog, since every newly created resource starts in the session repository first and will be saved to the location of the user's choice on save.


Modified: sandbox/maestro-3.0/Maestro.Base/Commands/NewItemCommand.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Commands/NewItemCommand.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Commands/NewItemCommand.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -53,9 +53,8 @@
             if (dlg.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
             {
                 var tpl = dlg.SelectedTemplate;
-                var parent = ResourceIdentifier.GetParentFolder(dlg.ResourceID);
-
-                var res = tpl.CreateItem(conn, parent);
+                
+                var res = tpl.CreateItem(conn);
                 if (res != null)
                 {
                     res.ResourceID = "Session:" + conn.SessionID + "//" + Guid.NewGuid().ToString() + "." + res.ResourceType.ToString();

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.ApplicationDefinition.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateFlexibleLayout(conn);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/DrawingSourceItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/DrawingSourceItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/DrawingSourceItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.DrawingSource.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateDrawingSource(conn);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/FeatureSourceItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/FeatureSourceItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/FeatureSourceItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -40,7 +40,7 @@
             ResourceType = ResourceTypes.FeatureSource.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             var provider = GenericItemSelectionDialog.SelectItem(
                 Properties.Resources.SelectFdoProvider,

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/ItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/ItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/ItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -44,8 +44,7 @@
         /// Creates a new item from this template
         /// </summary>
         /// <param name="conn">The server connection</param>
-        /// <param name="parentFolderId">The resource id of the folder this resource should be created in. Note that this is a hint for templates with regards to default values (for example, the initial folder for a load procedure)</param>
         /// <returns>a new resource, null if the user cancelled during this process</returns>
-        public abstract IResource CreateItem(IServerConnection conn, string parentFolderId);
+        public abstract IResource CreateItem(IServerConnection conn);
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/LayerDefinitionItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/LayerDefinitionItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/LayerDefinitionItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.LayerDefinition.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateLayerDefinition(conn);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/MapDefinitionItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/MapDefinitionItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/MapDefinitionItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.MapDefinition.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateMapDefinition(conn);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/PrintLayoutItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/PrintLayoutItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/PrintLayoutItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.PrintLayout.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreatePrintLayout(conn);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/SdfLoadProcedureItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/SdfLoadProcedureItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/SdfLoadProcedureItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -40,7 +40,7 @@
             ResourceType = ResourceTypes.LoadProcedure.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             using (var dlg = DialogFactory.OpenFile())
             {
@@ -48,9 +48,7 @@
                 dlg.Filter = Properties.Resources.Filter_Sdf_Files;
                 if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
-                    var lp = ObjectFactory.CreateSdfLoadProcedure(conn, dlg.FileNames);
-                    lp.Item.RootPath = parentFolderId;
-                    return lp;
+                    return ObjectFactory.CreateSdfLoadProcedure(conn, dlg.FileNames);
                 }
                 return null;
             }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/ShpLoadProcedureItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/ShpLoadProcedureItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/ShpLoadProcedureItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -40,7 +40,7 @@
             ResourceType = ResourceTypes.LoadProcedure.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             using (var dlg = DialogFactory.OpenFile())
             {
@@ -48,9 +48,7 @@
                 dlg.Filter = Properties.Resources.Filter_Shp_Files;
                 if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
-                    var lp = ObjectFactory.CreateShpLoadProcedure(conn, dlg.FileNames);
-                    lp.Item.RootPath = parentFolderId;
-                    return lp;
+                    return ObjectFactory.CreateShpLoadProcedure(conn, dlg.FileNames);
                 }
             }
             return null;

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/SymbolDefinitionItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/SymbolDefinitionItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/SymbolDefinitionItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.SymbolDefinition.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateSimpleSymbol(conn);
         }
@@ -56,7 +56,7 @@
             ResourceType = ResourceTypes.SymbolDefinition.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateCompoundSymbol(conn);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/UserItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/UserItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/UserItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -59,7 +59,7 @@
             this.ResourceType = _res.ResourceType.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             IResource res = (IResource)_res.Clone();
             res.CurrentConnection = conn;

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/WebLayoutItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/WebLayoutItemTemplate.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/WebLayoutItemTemplate.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -39,7 +39,7 @@
             ResourceType = ResourceTypes.WebLayout.ToString();
         }
 
-        public override IResource CreateItem(IServerConnection conn, string parentFolderId)
+        public override IResource CreateItem(IServerConnection conn)
         {
             return ObjectFactory.CreateWebLayout(conn, string.Empty);
         }

Modified: sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.Designer.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.Designer.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -32,24 +32,20 @@
             this.lstCategories = new System.Windows.Forms.ListBox();
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.txtName = new System.Windows.Forms.TextBox();
-            this.txtParentFolder = new System.Windows.Forms.TextBox();
-            this.txtType = new System.Windows.Forms.TextBox();
             this.txtDescription = new System.Windows.Forms.TextBox();
-            this.label5 = new System.Windows.Forms.Label();
             this.btnOK = new System.Windows.Forms.Button();
             this.btnCancel = new System.Windows.Forms.Button();
-            this.btnBrowse = new System.Windows.Forms.Button();
+            this.label3 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // lstTemplates
             // 
+            this.lstTemplates.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
             this.lstTemplates.Location = new System.Drawing.Point(163, 37);
             this.lstTemplates.MultiSelect = false;
             this.lstTemplates.Name = "lstTemplates";
-            this.lstTemplates.Size = new System.Drawing.Size(433, 225);
+            this.lstTemplates.Size = new System.Drawing.Size(433, 251);
             this.lstTemplates.TabIndex = 0;
             this.lstTemplates.UseCompatibleStateImageBehavior = false;
             this.lstTemplates.View = System.Windows.Forms.View.Tile;
@@ -57,10 +53,12 @@
             // 
             // lstCategories
             // 
+            this.lstCategories.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                        | System.Windows.Forms.AnchorStyles.Left)));
             this.lstCategories.FormattingEnabled = true;
             this.lstCategories.Location = new System.Drawing.Point(12, 37);
             this.lstCategories.Name = "lstCategories";
-            this.lstCategories.Size = new System.Drawing.Size(145, 225);
+            this.lstCategories.Size = new System.Drawing.Size(145, 251);
             this.lstCategories.TabIndex = 1;
             this.lstCategories.SelectedIndexChanged += new System.EventHandler(this.lstCategories_SelectedIndexChanged);
             // 
@@ -82,71 +80,22 @@
             this.label2.TabIndex = 3;
             this.label2.Text = "Available Templates";
             // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(12, 300);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(35, 13);
-            this.label3.TabIndex = 4;
-            this.label3.Text = "Name";
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(12, 330);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(50, 13);
-            this.label4.TabIndex = 5;
-            this.label4.Text = "Create In";
-            // 
-            // txtName
-            // 
-            this.txtName.Location = new System.Drawing.Point(69, 297);
-            this.txtName.Name = "txtName";
-            this.txtName.Size = new System.Drawing.Size(156, 20);
-            this.txtName.TabIndex = 6;
-            this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged);
-            // 
-            // txtParentFolder
-            // 
-            this.txtParentFolder.Location = new System.Drawing.Point(69, 327);
-            this.txtParentFolder.Name = "txtParentFolder";
-            this.txtParentFolder.ReadOnly = true;
-            this.txtParentFolder.Size = new System.Drawing.Size(495, 20);
-            this.txtParentFolder.TabIndex = 7;
-            this.txtParentFolder.TextChanged += new System.EventHandler(this.txtParentFolder_TextChanged);
-            // 
-            // txtType
-            // 
-            this.txtType.Location = new System.Drawing.Point(270, 297);
-            this.txtType.Name = "txtType";
-            this.txtType.ReadOnly = true;
-            this.txtType.Size = new System.Drawing.Size(326, 20);
-            this.txtType.TabIndex = 8;
-            // 
             // txtDescription
             // 
-            this.txtDescription.Location = new System.Drawing.Point(12, 268);
+            this.txtDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtDescription.Location = new System.Drawing.Point(12, 312);
+            this.txtDescription.Multiline = true;
             this.txtDescription.Name = "txtDescription";
             this.txtDescription.ReadOnly = true;
-            this.txtDescription.Size = new System.Drawing.Size(584, 20);
+            this.txtDescription.Size = new System.Drawing.Size(584, 23);
             this.txtDescription.TabIndex = 9;
             // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(231, 300);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(31, 13);
-            this.label5.TabIndex = 10;
-            this.label5.Text = "Type";
-            // 
             // btnOK
             // 
             this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.btnOK.Enabled = false;
-            this.btnOK.Location = new System.Drawing.Point(440, 359);
+            this.btnOK.Location = new System.Drawing.Point(440, 341);
             this.btnOK.Name = "btnOK";
             this.btnOK.Size = new System.Drawing.Size(75, 23);
             this.btnOK.TabIndex = 11;
@@ -158,7 +107,7 @@
             // 
             this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.btnCancel.Location = new System.Drawing.Point(521, 359);
+            this.btnCancel.Location = new System.Drawing.Point(521, 341);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(75, 23);
             this.btnCancel.TabIndex = 12;
@@ -166,15 +115,14 @@
             this.btnCancel.UseVisualStyleBackColor = true;
             this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
             // 
-            // btnBrowse
+            // label3
             // 
-            this.btnBrowse.Location = new System.Drawing.Point(570, 325);
-            this.btnBrowse.Name = "btnBrowse";
-            this.btnBrowse.Size = new System.Drawing.Size(26, 23);
-            this.btnBrowse.TabIndex = 13;
-            this.btnBrowse.Text = "...";
-            this.btnBrowse.UseVisualStyleBackColor = true;
-            this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(12, 295);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(60, 13);
+            this.label3.TabIndex = 13;
+            this.label3.Text = "Description";
             // 
             // NewResourceDialog
             // 
@@ -182,18 +130,12 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.CancelButton = this.btnCancel;
-            this.ClientSize = new System.Drawing.Size(608, 394);
+            this.ClientSize = new System.Drawing.Size(608, 376);
             this.ControlBox = false;
-            this.Controls.Add(this.btnBrowse);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.btnCancel);
             this.Controls.Add(this.btnOK);
-            this.Controls.Add(this.label5);
             this.Controls.Add(this.txtDescription);
-            this.Controls.Add(this.txtType);
-            this.Controls.Add(this.txtParentFolder);
-            this.Controls.Add(this.txtName);
-            this.Controls.Add(this.label4);
-            this.Controls.Add(this.label3);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.lstCategories);
@@ -213,15 +155,9 @@
         private System.Windows.Forms.ListBox lstCategories;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.TextBox txtName;
-        private System.Windows.Forms.TextBox txtParentFolder;
-        private System.Windows.Forms.TextBox txtType;
         private System.Windows.Forms.TextBox txtDescription;
-        private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Button btnOK;
         private System.Windows.Forms.Button btnCancel;
-        private System.Windows.Forms.Button btnBrowse;
+        private System.Windows.Forms.Label label3;
     }
 }
\ No newline at end of file

Modified: sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/UI/NewResourceDialog.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -31,10 +31,6 @@
 
 namespace Maestro.Base.UI
 {
-    //FIXME: Name field is not needed. Because any new resource will be loaded into
-    //the session repository FIRST before being saved via Save As, which will
-    //ask where you want to save it.
-
     public partial class NewResourceDialog : Form
     {
         private NewResourceDialog()
@@ -51,8 +47,6 @@
         {
             _resSvc = resSvc;
             _nits = nits;
-
-            txtParentFolder.Text = startPoint;
         }
 
         protected override void OnLoad(EventArgs e)
@@ -60,15 +54,6 @@
             lstCategories.DataSource = _nits.GetCategories();
         }
 
-        private void btnBrowse_Click(object sender, EventArgs e)
-        {
-            var picker = new ResourcePicker(_resSvc, ResourcePickerMode.OpenFolder);
-            if (picker.ShowDialog() == DialogResult.OK)
-            {
-                txtParentFolder.Text = picker.ResourceID;
-            }
-        }
-
         private void btnCancel_Click(object sender, EventArgs e)
         {
             this.DialogResult = DialogResult.Cancel;
@@ -117,21 +102,20 @@
 
         private void lstTemplates_SelectedIndexChanged(object sender, EventArgs e)
         {
-            txtType.Text = "";
             txtDescription.Text = "";
             if (lstTemplates.SelectedItems.Count == 1)
             {
                 var li = lstTemplates.SelectedItems[0];
                 var tpl = (ItemTemplate)li.Tag;
 
-                txtType.Text = tpl.ResourceType;
                 txtDescription.Text = tpl.Description;
+                CheckButtonState();
             }
         }
 
         private void CheckButtonState()
         {
-            btnOK.Enabled = !string.IsNullOrEmpty(txtName.Text) && !string.IsNullOrEmpty(txtParentFolder.Text);
+            btnOK.Enabled = this.SelectedTemplate != null;
         }
 
         private void txtName_TextChanged(object sender, EventArgs e)
@@ -163,16 +147,5 @@
                 return null;
             }
         }
-
-        /// <summary>
-        /// Gets the location where this new resource will be created
-        /// </summary>
-        public string ResourceID
-        {
-            get
-            {
-                return txtParentFolder.Text + txtName.Text + "." + txtType.Text;
-            }
-        }
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Base/UI/SiteExplorer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/SiteExplorer.cs	2010-09-30 13:46:14 UTC (rev 5226)
+++ sandbox/maestro-3.0/Maestro.Base/UI/SiteExplorer.cs	2010-10-01 04:36:11 UTC (rev 5227)
@@ -116,6 +116,9 @@
                 var rid = new ResourceIdentifier(resId);
                 if (!rid.IsFolder)
                     resId = rid.ParentFolder;
+                
+                //If this node is not initially expanded, we get NRE on refresh
+                ExpandNode(resId);
 
                 var path = _model.GetPathFromResourceId(resId);
                 var node = trvResources.FindNode(path, true);



More information about the mapguide-commits mailing list