[mapguide-commits] r4871 - in sandbox/maestro-2.5: Maestro.Base Maestro.Base/Properties Maestro.Base/Resources Maestro.Base/UI OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/ObjectModels Thirdparty/TreeViewAdv Thirdparty/TreeViewAdv/SampleApp Thirdparty/TreeViewAdv/UnitTests

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu May 13 23:00:56 EDT 2010


Author: jng
Date: 2010-05-13 23:00:55 -0400 (Thu, 13 May 2010)
New Revision: 4871

Added:
   sandbox/maestro-2.5/Maestro.Base/Resources/application-browser.png
   sandbox/maestro-2.5/Maestro.Base/Resources/application-sidebar-list.png
   sandbox/maestro-2.5/Maestro.Base/Resources/applications-stack.png
   sandbox/maestro-2.5/Maestro.Base/Resources/database--arrow.png
   sandbox/maestro-2.5/Maestro.Base/Resources/database-share.png
   sandbox/maestro-2.5/Maestro.Base/Resources/document.png
   sandbox/maestro-2.5/Maestro.Base/Resources/folder-horizontal.png
   sandbox/maestro-2.5/Maestro.Base/Resources/images-stack.png
   sandbox/maestro-2.5/Maestro.Base/Resources/layer.png
   sandbox/maestro-2.5/Maestro.Base/Resources/map.png
   sandbox/maestro-2.5/Maestro.Base/Resources/printer.png
   sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs
   sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs
Modified:
   sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj
   sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs
   sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx
   sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs
   sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.cs
   sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx
   sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
   sandbox/maestro-2.5/Thirdparty/TreeViewAdv/
   sandbox/maestro-2.5/Thirdparty/TreeViewAdv/SampleApp/
   sandbox/maestro-2.5/Thirdparty/TreeViewAdv/UnitTests/
Log:
We now have a Site Explorer that shows stuff!

Modified: sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj	2010-05-14 03:00:55 UTC (rev 4871)
@@ -121,6 +121,7 @@
     <Compile Include="UI\NewResourceDialog.Designer.cs">
       <DependentUpon>NewResourceDialog.cs</DependentUpon>
     </Compile>
+    <Compile Include="UI\RepositoryTreeModel.cs" />
     <Compile Include="UI\SingletonViewContent.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -156,6 +157,17 @@
   </ItemGroup>
   <ItemGroup>
     <Content Include="Maestro.Base.addin" />
+    <None Include="Resources\folder-horizontal.png" />
+    <None Include="Resources\document.png" />
+    <None Include="Resources\printer.png" />
+    <None Include="Resources\map.png" />
+    <None Include="Resources\layer.png" />
+    <None Include="Resources\images-stack.png" />
+    <None Include="Resources\database-share.png" />
+    <None Include="Resources\database--arrow.png" />
+    <None Include="Resources\applications-stack.png" />
+    <None Include="Resources\application-sidebar-list.png" />
+    <None Include="Resources\application-browser.png" />
     <None Include="Resources\reports-stack.png" />
     <None Include="Resources\cross-small.png" />
     <None Include="Resources\tick.png" />

Modified: sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs	2010-05-14 03:00:55 UTC (rev 4871)
@@ -87,6 +87,20 @@
             }
         }
         
+        internal static System.Drawing.Bitmap application_browser {
+            get {
+                object obj = ResourceManager.GetObject("application_browser", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        internal static System.Drawing.Bitmap application_sidebar_list {
+            get {
+                object obj = ResourceManager.GetObject("application_sidebar_list", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Bitmap application_task {
             get {
                 object obj = ResourceManager.GetObject("application_task", resourceCulture);
@@ -94,6 +108,13 @@
             }
         }
         
+        internal static System.Drawing.Bitmap applications_stack {
+            get {
+                object obj = ResourceManager.GetObject("applications_stack", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Bitmap arrow {
             get {
                 object obj = ResourceManager.GetObject("arrow", resourceCulture);
@@ -195,6 +216,20 @@
             }
         }
         
+        internal static System.Drawing.Bitmap database__arrow {
+            get {
+                object obj = ResourceManager.GetObject("database__arrow", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        internal static System.Drawing.Bitmap database_share {
+            get {
+                object obj = ResourceManager.GetObject("database_share", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Bitmap disk {
             get {
                 object obj = ResourceManager.GetObject("disk", resourceCulture);
@@ -209,6 +244,13 @@
             }
         }
         
+        internal static System.Drawing.Bitmap document {
+            get {
+                object obj = ResourceManager.GetObject("document", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Bitmap document__plus {
             get {
                 object obj = ResourceManager.GetObject("document__plus", resourceCulture);
@@ -264,6 +306,27 @@
             }
         }
         
+        internal static System.Drawing.Bitmap folder_horizontal {
+            get {
+                object obj = ResourceManager.GetObject("folder_horizontal", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        internal static System.Drawing.Bitmap images_stack {
+            get {
+                object obj = ResourceManager.GetObject("images_stack", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        internal static System.Drawing.Bitmap layer {
+            get {
+                object obj = ResourceManager.GetObject("layer", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Bitmap loading {
             get {
                 object obj = ResourceManager.GetObject("loading", resourceCulture);
@@ -280,6 +343,13 @@
             }
         }
         
+        internal static System.Drawing.Bitmap map {
+            get {
+                object obj = ResourceManager.GetObject("map", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Icon MapGuide_Maestro {
             get {
                 object obj = ResourceManager.GetObject("MapGuide_Maestro", resourceCulture);
@@ -480,6 +550,13 @@
             }
         }
         
+        internal static System.Drawing.Bitmap printer {
+            get {
+                object obj = ResourceManager.GetObject("printer", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         internal static System.Drawing.Bitmap reports_stack {
             get {
                 object obj = ResourceManager.GetObject("reports_stack", resourceCulture);

Modified: sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx	2010-05-14 03:00:55 UTC (rev 4871)
@@ -307,4 +307,37 @@
   <data name="Error_ViewContent_Type_Not_Singleton" xml:space="preserve">
     <value>The specified view content type is not a singleton: {0}</value>
   </data>
+  <data name="applications_stack" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\applications-stack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="application_browser" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\application-browser.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="application_sidebar_list" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\application-sidebar-list.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="database_share" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\database-share.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="database__arrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\database--arrow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="images_stack" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\images-stack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="layer" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\layer.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="map" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\map.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="printer" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\printer.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="document" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\document.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="folder_horizontal" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\folder-horizontal.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>
\ No newline at end of file

Added: sandbox/maestro-2.5/Maestro.Base/Resources/application-browser.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/application-browser.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/application-sidebar-list.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/application-sidebar-list.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/applications-stack.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/applications-stack.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/database--arrow.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/database--arrow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/database-share.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/database-share.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/document.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/document.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/folder-horizontal.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/folder-horizontal.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/images-stack.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/images-stack.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/layer.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/layer.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/map.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/map.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/Resources/printer.png
===================================================================
(Binary files differ)


Property changes on: sandbox/maestro-2.5/Maestro.Base/Resources/printer.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs	                        (rev 0)
+++ sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs	2010-05-14 03:00:55 UTC (rev 4871)
@@ -0,0 +1,183 @@
+#region Disclaimer / License
+// Copyright (C) 2010, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Aga.Controls.Tree;
+using OSGeo.MapGuide.MaestroAPI;
+using OSGeo.MapGuide.ObjectModels.Common;
+using System.Drawing;
+
+namespace Maestro.Base.UI
+{
+    public class RepositoryItem
+    {
+        private IRepositoryItem _item;
+
+        public RepositoryItem(IRepositoryItem item)
+        {
+            _item = item;
+        }
+
+        public string ResourceId
+        {
+            get { return _item.ResourceId; }
+        }
+
+        public string Name
+        {
+            get { return _item.Name; }
+        }
+
+        public bool IsFolder
+        {
+            get { return _item.IsFolder; }
+        }
+
+        public Image Icon
+        {
+            get
+            {
+                if (_item.IsFolder)
+                {
+                    return Properties.Resources.folder_horizontal;
+                }
+                else
+                {
+                    switch (_item.ResourceType)
+                    {
+                        case "FeatureSource":
+                            return Properties.Resources.database_share;
+                        case "LayerDefinition":
+                            return Properties.Resources.layer;
+                        case "MapDefinition":
+                            return Properties.Resources.map;
+                        case "WebLayout":
+                            return Properties.Resources.application_browser;
+                        case "ApplicationDefinition":
+                            return Properties.Resources.applications_stack;
+                        case "SymbolLibrary":
+                            return Properties.Resources.images_stack;
+                        case "PrintLayout":
+                            return Properties.Resources.printer;
+                        default:
+                            return Properties.Resources.document;
+                    }
+                }
+            }
+        }
+    }
+
+    public class RepositoryTreeModel : ITreeModel
+    {
+        private IServerConnection _conn;
+
+        public RepositoryTreeModel(IServerConnection conn)
+        {
+            _conn = conn;
+        }
+
+        private System.Collections.IEnumerable GetSorted(ResourceList list)
+        {
+            //Sort them before returning them
+            SortedList<string, RepositoryItem> folders = new SortedList<string, RepositoryItem>();
+            SortedList<string, RepositoryItem> docs = new SortedList<string, RepositoryItem>();
+            foreach (var item in list.Children)
+            {
+                var it = new RepositoryItem(item);
+                if (it.IsFolder)
+                    folders.Add(it.Name, it);
+                else
+                    docs.Add(it.Name, it);
+            }
+            foreach (var folder in folders.Values)
+            {
+                yield return folder;
+            }
+            foreach (var doc in docs.Values)
+            {
+                yield return doc;
+            }
+        }
+
+        public System.Collections.IEnumerable GetChildren(TreePath treePath)
+        {
+            if (treePath.IsEmpty())
+            {
+                var list = _conn.ResourceService.GetRepositoryResources("Library://", 1);
+                return GetSorted(list);
+            }
+            else
+            {
+                var node = treePath.LastNode as RepositoryItem;
+                if (node != null && node.IsFolder) //Can't enumerate children of documents
+                {
+                    var list = _conn.ResourceService.GetRepositoryResources(node.ResourceId, 1);
+                    return GetSorted(list);
+                }
+                else
+                {
+                    return new RepositoryItem[0];
+                }
+            }
+        }
+
+        public bool IsLeaf(TreePath treePath)
+        {
+            return !((RepositoryItem)treePath.LastNode).IsFolder;
+        }
+
+        protected void OnNodesChanged(TreeModelEventArgs e)
+        {
+            var handler = this.NodesChanged;
+            if (handler != null)
+                handler(this, e);
+        }
+
+        public event EventHandler<TreeModelEventArgs> NodesChanged;
+
+        protected void OnNodesInserted(TreeModelEventArgs e)
+        {
+            var handler = this.NodesInserted;
+            if (handler != null)
+                handler(this, e);
+        }
+
+        public event EventHandler<TreeModelEventArgs> NodesInserted;
+
+        protected void OnNodesRemoved(TreeModelEventArgs e)
+        {
+            var handler = this.NodesRemoved;
+            if (handler != null)
+                handler(this, e);
+        }
+
+        public event EventHandler<TreeModelEventArgs> NodesRemoved;
+
+        protected void OnStructureChanged(TreePathEventArgs e)
+        {
+            var handler = this.StructureChanged;
+            if (handler != null)
+                handler(this, e);
+        }
+
+        public event EventHandler<TreePathEventArgs> StructureChanged;
+    }
+}

Modified: sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs	2010-05-14 03:00:55 UTC (rev 4871)
@@ -28,19 +28,83 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
+            this.tsSiteExplorer = new System.Windows.Forms.ToolStrip();
+            this.trvResources = new Aga.Controls.Tree.TreeViewAdv();
+            this.ctxRepository = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.rdResourceIcon = new Aga.Controls.Tree.NodeControls.NodeIcon();
+            this.ndResource = new Aga.Controls.Tree.NodeControls.NodeTextBox();
             this.SuspendLayout();
             // 
+            // tsSiteExplorer
+            // 
+            this.tsSiteExplorer.Location = new System.Drawing.Point(0, 0);
+            this.tsSiteExplorer.Name = "tsSiteExplorer";
+            this.tsSiteExplorer.Size = new System.Drawing.Size(233, 25);
+            this.tsSiteExplorer.TabIndex = 1;
+            this.tsSiteExplorer.Text = "toolStrip1";
+            // 
+            // trvResources
+            // 
+            this.trvResources.BackColor = System.Drawing.SystemColors.Window;
+            this.trvResources.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.trvResources.ContextMenuStrip = this.ctxRepository;
+            this.trvResources.DefaultToolTipProvider = null;
+            this.trvResources.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.trvResources.DragDropMarkColor = System.Drawing.Color.Black;
+            this.trvResources.LineColor = System.Drawing.SystemColors.ControlDark;
+            this.trvResources.LoadOnDemand = true;
+            this.trvResources.Location = new System.Drawing.Point(0, 25);
+            this.trvResources.Model = null;
+            this.trvResources.Name = "trvResources";
+            this.trvResources.NodeControls.Add(this.rdResourceIcon);
+            this.trvResources.NodeControls.Add(this.ndResource);
+            this.trvResources.SelectedNode = null;
+            this.trvResources.SelectionMode = Aga.Controls.Tree.TreeSelectionMode.MultiSameParent;
+            this.trvResources.Size = new System.Drawing.Size(233, 458);
+            this.trvResources.TabIndex = 2;
+            // 
+            // ctxRepository
+            // 
+            this.ctxRepository.Name = "ctxRepository";
+            this.ctxRepository.Size = new System.Drawing.Size(61, 4);
+            // 
+            // rdResourceIcon
+            // 
+            this.rdResourceIcon.DataPropertyName = "Icon";
+            this.rdResourceIcon.LeftMargin = 1;
+            this.rdResourceIcon.ParentColumn = null;
+            this.rdResourceIcon.ScaleMode = Aga.Controls.Tree.ImageScaleMode.Clip;
+            // 
+            // ndResource
+            // 
+            this.ndResource.DataPropertyName = "Name";
+            this.ndResource.EditEnabled = true;
+            this.ndResource.IncrementalSearchEnabled = true;
+            this.ndResource.LeftMargin = 3;
+            this.ndResource.ParentColumn = null;
+            // 
             // SiteExplorer
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.trvResources);
+            this.Controls.Add(this.tsSiteExplorer);
             this.Name = "SiteExplorer";
             this.Size = new System.Drawing.Size(233, 483);
             this.ResumeLayout(false);
+            this.PerformLayout();
 
         }
 
         #endregion
 
+        private System.Windows.Forms.ToolStrip tsSiteExplorer;
+        private Aga.Controls.Tree.TreeViewAdv trvResources;
+        private System.Windows.Forms.ContextMenuStrip ctxRepository;
+        private Aga.Controls.Tree.NodeControls.NodeTextBox ndResource;
+        private Aga.Controls.Tree.NodeControls.NodeIcon rdResourceIcon;
+
+
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.cs	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.cs	2010-05-14 03:00:55 UTC (rev 4871)
@@ -26,15 +26,12 @@
 using System.Windows.Forms;
 using ICSharpCode.Core.WinForms;
 using Aga.Controls.Tree;
+using Maestro.Base.Services;
 
 namespace Maestro.Base.UI
 {
     public partial class SiteExplorer : ViewContentBase, ISiteExplorer
     {
-        private ToolStrip toolStrip;
-        private TreeViewAdv trvResources;
-        private ContextMenuStrip trvContextMenu;
-
         /// <summary>
         /// Internal use only. Do not invoke directly. Use <see cref="ViewContentManager"/> for that
         /// </summary>
@@ -58,14 +55,15 @@
         {
             this.Title = Properties.Resources.Content_SiteExplorer;
             this.Description = string.Format("{0}: {1}", Properties.Resources.Content_SiteExplorer, this.ConnectionName);
-            toolStrip = ToolbarService.CreateToolStrip(this, "/Maestro/Shell/SiteExplorer/Toolbar");
-            trvResources = new TreeViewAdv();
-            trvResources.BorderStyle = BorderStyle.FixedSingle;
-            trvContextMenu = MenuService.CreateContextMenu(this, "/Maestro/Shell/SiteExplorer/ContextMenu");
-            toolStrip.Dock = DockStyle.Top;
-            trvResources.Dock = DockStyle.Fill;
-            this.Controls.Add(trvResources);
-            this.Controls.Add(toolStrip);
+
+            var ts = ToolbarService.CreateToolStripItems("/Maestro/Shell/SiteExplorer/Toolbar", this, true);
+            tsSiteExplorer.Items.AddRange(ts);
+
+            var mgr = ServiceRegistry.GetService<ServerConnectionManager>();
+            var conn = mgr.GetConnection(this.ConnectionName);
+
+            var model = new RepositoryTreeModel(conn);
+            trvResources.Model = model;
         }
 
         public override bool AllowUserClose
@@ -84,10 +82,9 @@
             }
         }
 
-
         public void Refresh(string folderID)
         {
-            throw new NotImplementedException();
+            
         }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx	2010-05-14 03:00:55 UTC (rev 4871)
@@ -117,4 +117,10 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="tsSiteExplorer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="ctxRepository.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>143, 17</value>
+  </metadata>
 </root>
\ No newline at end of file

Modified: sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2010-05-13 22:11:11 UTC (rev 4870)
+++ sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2010-05-14 03:00:55 UTC (rev 4871)
@@ -3,7 +3,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
+    <ProductVersion>9.0.30729</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</ProjectGuid>
     <OutputType>Library</OutputType>
@@ -191,6 +191,7 @@
     <Compile Include="ObjectModels\LoadProcedure.cs" />
     <Compile Include="ObjectModels\MapDefinition.cs" />
     <Compile Include="ObjectModels\PrintLayout.cs" />
+    <Compile Include="ObjectModels\ResourceItems.cs" />
     <Compile Include="ObjectModels\SymbolDefinition.cs" />
     <Compile Include="ObjectModels\SymbolLibrary.cs" />
     <Compile Include="ObjectModels\WebLayout.cs" />

Added: sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs
===================================================================
--- sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs	                        (rev 0)
+++ sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs	2010-05-14 03:00:55 UTC (rev 4871)
@@ -0,0 +1,75 @@
+#region Disclaimer / License
+// Copyright (C) 2010, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Resource;
+
+namespace OSGeo.MapGuide.ObjectModels.Common
+{
+    public interface IRepositoryItem
+    {
+        string Name { get; }
+
+        string ResourceId { get; }
+
+        string ResourceType { get; }
+
+        bool IsFolder { get; }
+    }
+
+    partial class ResourceList
+    {
+        public IEnumerable<IRepositoryItem> Children
+        {
+            get
+            {
+                foreach (var obj in this.Items)
+                {
+                    yield return (IRepositoryItem)obj;
+                }
+            }
+        }
+    }
+
+    partial class ResourceListResourceDocument : IRepositoryItem 
+    {
+        public string Name
+        {
+            get { return ResourceIdentifier.GetName(this.ResourceId); }
+        }
+
+        public string ResourceType { get { return ResourceIdentifier.GetExtension(this.ResourceId); } }
+
+        public bool IsFolder { get { return false; } }
+    }
+
+    partial class ResourceListResourceFolder : IRepositoryItem
+    {
+        public string Name
+        {
+            get { return ResourceIdentifier.GetName(this.ResourceId); }
+        }
+
+        public string ResourceType { get { return ResourceIdentifier.GetExtension(this.ResourceId); } }
+
+        public bool IsFolder { get { return true; } }
+    }
+}


Property changes on: sandbox/maestro-2.5/Thirdparty/TreeViewAdv
___________________________________________________________________
Added: svn:ignore
   + *.suo



Property changes on: sandbox/maestro-2.5/Thirdparty/TreeViewAdv/SampleApp
___________________________________________________________________
Added: svn:ignore
   + bin
obj



Property changes on: sandbox/maestro-2.5/Thirdparty/TreeViewAdv/UnitTests
___________________________________________________________________
Added: svn:ignore
   + bin
obj




More information about the mapguide-commits mailing list