[mapguide-commits] r4874 - in sandbox/maestro-2.5: Maestro.Base Maestro.Base/Properties Maestro.Base/Resources Maestro.Base/Services Maestro.Base/UI Thirdparty/TreeViewAdv/Aga.Controls

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu May 13 23:58:36 EDT 2010


Author: jng
Date: 2010-05-13 23:58:35 -0400 (Thu, 13 May 2010)
New Revision: 4874

Added:
   sandbox/maestro-2.5/Maestro.Base/Resources/blueprints.png
Modified:
   sandbox/maestro-2.5/Maestro.Base/Maestro.Base.addin
   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/Services/OpenResourceManager.cs
   sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs
   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/Thirdparty/TreeViewAdv/Aga.Controls/
Log:
Implemented context-aware site explorer context menus. Also all unimplemented commands are sourced from NotImplementedCommand

Modified: sandbox/maestro-2.5/Maestro.Base/Maestro.Base.addin
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Maestro.Base.addin	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/Maestro.Base.addin	2010-05-14 03:58:35 UTC (rev 4874)
@@ -24,7 +24,7 @@
             <MenuItem id="NewItem"
                       label="${res:Menu_File_NewResource}"
                       icon="document__plus"
-                      class="Maestro.Base.Commands.NewItemCommand" />
+                      class="Maestro.Base.Commands.NotImplementedCommand" />
             <MenuItem type="Separator" />
             <MenuItem id="Menu_File_Quit"
                       label="${res:Menu_File_Quit}"
@@ -36,15 +36,15 @@
             <MenuItem id="CopyItem"
                       icon="document_copy"
                       label="${res:Menu_Edit_Copy}"
-                      class="Maestro.Base.Commands.CopyCommand" />
+                      class="Maestro.Base.Commands.NotImplementedCommand" />
             <MenuItem id="CutItem"
                       label="${res:Menu_Edit_Cut}"
                       icon="scissors_blue"
-                      class="Maestro.Base.Commands.CutCommand" />
+                      class="Maestro.Base.Commands.NotImplementedCommand" />
             <MenuItem id="PasteItem"
                       label="${res:Menu_Edit_Paste}"
                       icon="clipboard_paste"
-                      class="Maestro.Base.Commands.PasteCommand" />
+                      class="Maestro.Base.Commands.NotImplementedCommand" />
         </MenuItem>
         <MenuItem id="Menu_Tools"
                   type="Menu"
@@ -52,7 +52,7 @@
             <MenuItem id="Menu_Tools_Options"
                       label="${res:Menu_Tools_Options}"
                       icon="application_task"
-                      class="Maestro.Base.Commands.OptionsCommand"/>
+                      class="Maestro.Base.Commands.NotImplementedCommand"/>
         </MenuItem>
         <MenuItem id="Menu_View"
                   type="Menu"
@@ -96,40 +96,40 @@
         <ToolbarItem id="Connect"
                      icon="plug__plus"
                      label="${res:Menu_File_Connect}"
-                     class="Maestro.Base.Commands.LoginCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="NewItem"
                      icon="document__plus"
                      label="${res:Menu_File_NewResource}"
-                     class="Maestro.Base.Commands.NewItemCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem type="Separator" />
         <ToolbarItem id="CopyItem"
                      icon="document_copy"
-                     class="Maestro.Base.Commands.CopyCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="CutItem"
                      icon="scissors_blue"
-                     class="Maestro.Base.Commands.CutCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="PasteItem"
                      icon="clipboard_paste"
-                     class="Maestro.Base.Commands.PasteCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem type="Separator" />
         <ToolbarItem id="Save"
                      icon="disk"
-                     class="Maestro.Base.Commands.SaveResourceCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="SaveAs"
                      icon="disk__arrow"
-                     class="Maestro.Base.Commands.SaveResourceAsCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="Preview"
                      icon="document_search_result"
-                     class="Maestro.Base.Commands.PreviewResourceCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="XmlEdit"
                      icon="document_code"
-                     class="Maestro.Base.Commands.XmlEditCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="Profile"
                      icon="clock"
-                     class="Maestro.Base.Commands.ProfileResourceCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="Validate"
                      icon="tick"
-                     class="Maestro.Base.Commands.ValidateResourceCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
     </Path>
     
     <!-- Site Explorer Toolbar -->
@@ -137,22 +137,118 @@
         <ToolbarItem id="NewItem"
                      label="${res:Menu_File_NewResource}"
                      icon="document__plus"
-                     class="Maestro.Base.Commands.NewItemCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem type="Separator" />
         <ToolbarItem id="DeleteItem"
                      icon="cross_script"
-                     class="Maestro.Base.Commands.DeleteResourceCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="SiteExplorer_Refresh"
                      icon="arrow-circle-045-left"
-                     class="Maestro.Base.Commands.SiteExplorer.RefreshCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
         <ToolbarItem id="SiteExplorer_Disconnect"
                      icon="plug--minus"
-                     class="Maestro.Base.Commands.SiteExplorer.DisconnectCommand" />
+                     class="Maestro.Base.Commands.NotImplementedCommand" />
     </Path>
     
     <!-- Site Explorer Context Menu -->
-    <Path name="/Maestro/Shell/SiteExplorer/ContextMenu">
-        
+    <Path name="/Maestro/Shell/SiteExplorer/SelectedFolder">
+        <MenuItem id="CreatePackage"
+                  label="${res:SiteExplorer_SelectedFolder_CreatePackage}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Delete"
+                  label="${res:SiteExplorer_SelectedItem_Delete}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="LoadPackage"
+                  label="${res:SiteExplorer_SelectedFolder_LoadPackage}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem type="Separator" />
+        <MenuItem id="Copy"
+                  label="${res:SiteExplorer_SelectedItem_Copy}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Cut"
+                  label="${res:SiteExplorer_SelectedItem_Cut}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Paste"
+                  label="${res:SiteExplorer_SelectedFolder_Paste}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
     </Path>
+
+    <!-- Site Explorer Context Menu -->
+    <Path name="/Maestro/Shell/SiteExplorer/SelectedFolders">
+        <MenuItem id="CreatePackage"
+                  label="${res:SiteExplorer_SelectedFolder_CreatePackage}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Delete"
+                  label="${res:SiteExplorer_SelectedItem_Delete}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem type="Separator" />
+        <MenuItem id="Copy"
+                  label="${res:SiteExplorer_SelectedItem_Copy}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Cut"
+                  label="${res:SiteExplorer_SelectedItem_Cut}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+    </Path>
+
+    <!-- Site Explorer Context Menu -->
+    <Path name="/Maestro/Shell/SiteExplorer/SelectedDocument">
+        <MenuItem id="Open"
+                  label="${res:SiteExplorer_SelectedItem_Open}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Rename"
+                  label="${res:SiteExplorer_SelectedItem_Rename}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Delete"
+                  label="${res:SiteExplorer_SelectedItem_Delete}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem type="Separator" />
+        <MenuItem id="Copy"
+                  label="${res:SiteExplorer_SelectedItem_Copy}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Cut"
+                  label="${res:SiteExplorer_SelectedItem_Cut}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Paste"
+                  label="${res:SiteExplorer_SelectedFolder_Paste}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+    </Path>
+
+    <!-- Site Explorer Context Menu -->
+    <Path name="/Maestro/Shell/SiteExplorer/SelectedDocuments">
+        <MenuItem id="Open"
+                  label="${res:SiteExplorer_SelectedItem_Open}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Delete"
+                  label="${res:SiteExplorer_SelectedItem_Delete}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem type="Separator" />
+        <MenuItem id="Copy"
+                  label="${res:SiteExplorer_SelectedItem_Copy}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Cut"
+                  label="${res:SiteExplorer_SelectedItem_Cut}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+    </Path>
+
+    <!-- Site Explorer Context Menu -->
+    <Path name="/Maestro/Shell/SiteExplorer/SelectedMixedResources">
+        <MenuItem id="Open"
+                  label="${res:SiteExplorer_SelectedItem_Open}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />s
+        <MenuItem id="Delete"
+                  label="${res:SiteExplorer_SelectedItem_Delete}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem type="Separator" />
+        <MenuItem id="CreatePackage"
+                 label="${res:SiteExplorer_SelectedFolder_CreatePackage}"
+                 class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem type="Separator" />
+        <MenuItem id="Copy"
+                  label="${res:SiteExplorer_SelectedItem_Copy}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+        <MenuItem id="Cut"
+                  label="${res:SiteExplorer_SelectedItem_Cut}"
+                  class="Maestro.Base.Commands.NotImplementedCommand" />
+    </Path>
     
 </AddIn>
\ No newline at end of file

Modified: sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj	2010-05-14 03:58:35 UTC (rev 4874)
@@ -157,6 +157,7 @@
   </ItemGroup>
   <ItemGroup>
     <Content Include="Maestro.Base.addin" />
+    <None Include="Resources\blueprints.png" />
     <None Include="Resources\folder-horizontal.png" />
     <None Include="Resources\document.png" />
     <None Include="Resources\printer.png" />

Modified: sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/Properties/Resources.Designer.cs	2010-05-14 03:58:35 UTC (rev 4874)
@@ -136,6 +136,13 @@
             }
         }
         
+        internal static System.Drawing.Bitmap blueprints {
+            get {
+                object obj = ResourceManager.GetObject("blueprints", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Done.
         /// </summary>
@@ -632,6 +639,78 @@
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Package folder.
+        /// </summary>
+        internal static string SiteExplorer_SelectedFolder_CreatePackage {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedFolder_CreatePackage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Load Package into this folder.
+        /// </summary>
+        internal static string SiteExplorer_SelectedFolder_LoadPackage {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedFolder_LoadPackage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Paste into this folder.
+        /// </summary>
+        internal static string SiteExplorer_SelectedFolder_Paste {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedFolder_Paste", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Copy selected item(s).
+        /// </summary>
+        internal static string SiteExplorer_SelectedItem_Copy {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedItem_Copy", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Cut selected items(s).
+        /// </summary>
+        internal static string SiteExplorer_SelectedItem_Cut {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedItem_Cut", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Delete selected item(s).
+        /// </summary>
+        internal static string SiteExplorer_SelectedItem_Delete {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedItem_Delete", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Open.
+        /// </summary>
+        internal static string SiteExplorer_SelectedItem_Open {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedItem_Open", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Rename.
+        /// </summary>
+        internal static string SiteExplorer_SelectedItem_Rename {
+            get {
+                return ResourceManager.GetString("SiteExplorer_SelectedItem_Rename", resourceCulture);
+            }
+        }
+        
         internal static System.Drawing.Bitmap tick {
             get {
                 object obj = ResourceManager.GetObject("tick", resourceCulture);

Modified: sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/Properties/Resources.resx	2010-05-14 03:58:35 UTC (rev 4874)
@@ -340,4 +340,31 @@
   <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>
+  <data name="blueprints" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\blueprints.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="SiteExplorer_SelectedFolder_CreatePackage" xml:space="preserve">
+    <value>Package folder</value>
+  </data>
+  <data name="SiteExplorer_SelectedFolder_LoadPackage" xml:space="preserve">
+    <value>Load Package into this folder</value>
+  </data>
+  <data name="SiteExplorer_SelectedFolder_Paste" xml:space="preserve">
+    <value>Paste into this folder</value>
+  </data>
+  <data name="SiteExplorer_SelectedItem_Copy" xml:space="preserve">
+    <value>Copy selected item(s)</value>
+  </data>
+  <data name="SiteExplorer_SelectedItem_Cut" xml:space="preserve">
+    <value>Cut selected items(s)</value>
+  </data>
+  <data name="SiteExplorer_SelectedItem_Delete" xml:space="preserve">
+    <value>Delete selected item(s)</value>
+  </data>
+  <data name="SiteExplorer_SelectedItem_Open" xml:space="preserve">
+    <value>Open</value>
+  </data>
+  <data name="SiteExplorer_SelectedItem_Rename" xml:space="preserve">
+    <value>Rename</value>
+  </data>
 </root>
\ No newline at end of file

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


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

Modified: sandbox/maestro-2.5/Maestro.Base/Services/OpenResourceManager.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Services/OpenResourceManager.cs	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/Services/OpenResourceManager.cs	2010-05-14 03:58:35 UTC (rev 4874)
@@ -21,6 +21,7 @@
 using System.Collections.Generic;
 using System.Text;
 using ICSharpCode.Core;
+using Maestro.Base.UI;
 
 namespace Maestro.Base.Services
 {
@@ -31,5 +32,18 @@
             base.Initialize();
             LoggingService.Info(Properties.Resources.Service_Init_Open_Resource_Manager);
         }
+
+        public void Open(RepositoryItem item)
+        {
+            if (item.IsFolder)
+                return;
+
+            throw new NotImplementedException();
+        }
+
+        public void Open(RepositoryItem [] items)
+        {
+            throw new NotImplementedException();
+        }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/UI/RepositoryTreeModel.cs	2010-05-14 03:58:35 UTC (rev 4874)
@@ -27,6 +27,9 @@
 
 namespace Maestro.Base.UI
 {
+    /// <summary>
+    /// Models an object in the repository
+    /// </summary>
     public class RepositoryItem
     {
         private IRepositoryItem _item;
@@ -63,6 +66,8 @@
                 {
                     switch (_item.ResourceType)
                     {
+                        case "DrawingSource":
+                            return Properties.Resources.blueprints;
                         case "FeatureSource":
                             return Properties.Resources.database_share;
                         case "LayerDefinition":
@@ -85,6 +90,9 @@
         }
     }
 
+    /// <summary>
+    /// Defines the repository model for the treeview
+    /// </summary>
     public class RepositoryTreeModel : ITreeModel
     {
         private IServerConnection _conn;

Modified: sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.Designer.cs	2010-05-14 03:58:35 UTC (rev 4874)
@@ -28,10 +28,8 @@
         /// </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();
@@ -48,7 +46,6 @@
             // 
             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;
@@ -63,12 +60,9 @@
             this.trvResources.SelectionMode = Aga.Controls.Tree.TreeSelectionMode.MultiSameParent;
             this.trvResources.Size = new System.Drawing.Size(233, 458);
             this.trvResources.TabIndex = 2;
+            this.trvResources.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trvResources_MouseDoubleClick);
+            this.trvResources.MouseClick += new System.Windows.Forms.MouseEventHandler(this.trvResources_MouseClick);
             // 
-            // ctxRepository
-            // 
-            this.ctxRepository.Name = "ctxRepository";
-            this.ctxRepository.Size = new System.Drawing.Size(61, 4);
-            // 
             // rdResourceIcon
             // 
             this.rdResourceIcon.DataPropertyName = "Icon";
@@ -101,7 +95,6 @@
 
         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-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.cs	2010-05-14 03:58:35 UTC (rev 4874)
@@ -86,5 +86,64 @@
         {
             
         }
+
+        private void trvResources_MouseDoubleClick(object sender, MouseEventArgs e)
+        {
+            TreeNodeAdv node = trvResources.GetNodeAt(new Point(e.X, e.Y));
+            if (node != null)
+            {
+                var item = node.Tag as RepositoryItem;
+                if (item != null && !item.IsFolder)
+                {
+                    var resMgr = ServiceRegistry.GetService<OpenResourceManager>();
+                    resMgr.Open(item);
+                }
+            }
+        }
+
+        private void trvResources_MouseClick(object sender, MouseEventArgs e)
+        {
+            if (e.Button == MouseButtons.Right)
+            {
+                var nodes = trvResources.SelectedNodes;
+                if (nodes != null && nodes.Count > 0)
+                {
+                    if (nodes.Count == 1) //Single select
+                    {
+                        var node = nodes[0];
+                        RepositoryItem item = (RepositoryItem)node.Tag;
+                        if (item.IsFolder)
+                            MenuService.ShowContextMenu(this, "/Maestro/Shell/SiteExplorer/SelectedFolder", trvResources, e.X, e.Y);
+                        else
+                            MenuService.ShowContextMenu(this, "/Maestro/Shell/SiteExplorer/SelectedDocument", trvResources, e.X, e.Y);
+                    }
+                    else //Multi select
+                    {
+                        //All must be uniform type
+                        int folderCount = 0;
+
+                        foreach (var node in nodes)
+                        {
+                            var item = (RepositoryItem)node.Tag;
+                            if (item.IsFolder)
+                                folderCount++;
+                        }
+
+                        if (folderCount == 0) //All selected documents
+                        {
+                            MenuService.ShowContextMenu(this, "/Maestro/Shell/SiteExplorer/SelectedDocuments", trvResources, e.X, e.Y);
+                        }
+                        else if (folderCount == nodes.Count) //All selected folders
+                        {
+                            MenuService.ShowContextMenu(this, "/Maestro/Shell/SiteExplorer/SelectedFolders", trvResources, e.X, e.Y);
+                        }
+                        else //Mixed selection
+                        {
+                            MenuService.ShowContextMenu(this, "/Maestro/Shell/SiteExplorer/SelectedMixedResources", trvResources, e.X, e.Y);
+                        }
+                    }
+                }
+            }
+        }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx	2010-05-14 03:10:46 UTC (rev 4873)
+++ sandbox/maestro-2.5/Maestro.Base/UI/SiteExplorer.resx	2010-05-14 03:58:35 UTC (rev 4874)
@@ -120,7 +120,4 @@
   <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


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




More information about the mapguide-commits mailing list