[mapguide-commits] r5617 - in trunk/Tools/Maestro: Maestro.Base Maestro.Base/UI Maestro.Editors/Generic OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Mar 13 11:44:22 EDT 2011


Author: jng
Date: 2011-03-13 08:44:22 -0700 (Sun, 13 Mar 2011)
New Revision: 5617

Modified:
   trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin
   trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs
   trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx
   trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs
Log:
Fix #1508: The Cut/Copy/Paste commands for the XML editor was being suppressed because the Ctrl+C/X/V keys were already assigned to the global Cut/Copy/Paste commands for the site explorer. This submission removes the keys assignment to the site explorer commands. Instead the SiteExplorer handles the keypress directly and invokes the appropriate command. This way the Ctrl+C/X/V handler for the XML editor does not conflict with the same handler for the Site Explorer.

Also in this submission, apply a whole series of [XmlIgnore] attributes to explicit interface properties which I'm sure Mono will attempt to serialize/deserialize

Modified: trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin	2011-03-09 16:53:02 UTC (rev 5616)
+++ trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin	2011-03-13 15:44:22 UTC (rev 5617)
@@ -125,12 +125,10 @@
                     <MenuItem id="CopyItem"
                               icon="document_copy"
                               label="${res:Menu_Edit_Copy}"
-                              shortcut="Control|C"
                               class="Maestro.Base.Commands.CopyCommand" />
                     <MenuItem id="CutItem"
                               label="${res:Menu_Edit_Cut}"
                               icon="scissors_blue"
-                              shortcut="Control|X"
                               class="Maestro.Base.Commands.CutCommand" />
                 </Condition>
             </Condition>
@@ -138,7 +136,6 @@
                 <MenuItem id="PasteItem"
                           label="${res:Menu_Edit_Paste}"
                           icon="clipboard_paste"
-                          shortcut="Control|V"
                           class="Maestro.Base.Commands.PasteCommand" />
             </Condition>
         </MenuItem>
@@ -409,10 +406,12 @@
                     <MenuItem id="Copy"
                               icon="document_copy"
                               label="${res:SiteExplorer_SelectedItem_Copy}"
+                              shortcut="Control|C"
                               class="Maestro.Base.Commands.CopyCommand" />
                     <MenuItem id="Cut"
                               icon="scissors_blue"
                               label="${res:SiteExplorer_SelectedItem_Cut}"
+                              shortcut="Control|X"
                               class="Maestro.Base.Commands.CutCommand" />
                 </Condition>
             </Condition>
@@ -420,6 +419,7 @@
                 <MenuItem id="Paste"
                           icon="clipboard_paste"
                           label="${res:SiteExplorer_SelectedFolder_Paste}"
+                          shortcut="Control|V"
                           class="Maestro.Base.Commands.PasteCommand" />
             </Condition>
             <MenuItem type="Separator" />
@@ -447,10 +447,12 @@
                 <MenuItem id="Copy"
                           icon="document_copy"
                           label="${res:SiteExplorer_SelectedItem_Copy}"
+                          shortcut="Control|C"
                           class="Maestro.Base.Commands.CopyCommand" />
                 <MenuItem id="Cut"
                           icon="scissors_blue"
                           label="${res:SiteExplorer_SelectedItem_Cut}"
+                          shortcut="Control|X"
                           class="Maestro.Base.Commands.CutCommand" />
             </Condition>
             <MenuItem id="Validate"
@@ -487,10 +489,12 @@
                 <MenuItem id="Copy"
                           icon="document_copy"
                           label="${res:SiteExplorer_SelectedItem_Copy}"
+                          shortcut="Control|C"
                           class="Maestro.Base.Commands.CopyCommand" />
                 <MenuItem id="Cut"
                           icon="scissors_blue"
                           label="${res:SiteExplorer_SelectedItem_Cut}"
+                          shortcut="Control|X"
                           class="Maestro.Base.Commands.CutCommand" />
             </Condition>
             <MenuItem type="Separator" />
@@ -531,10 +535,12 @@
                 <MenuItem id="Copy"
                           icon="document_copy"
                           label="${res:SiteExplorer_SelectedItem_Copy}"
+                          shortcut="Control|C"
                           class="Maestro.Base.Commands.CopyCommand" />
                 <MenuItem id="Cut"
                           icon="scissors_blue"
                           label="${res:SiteExplorer_SelectedItem_Cut}"
+                          shortcut="Control|X"
                           class="Maestro.Base.Commands.CutCommand" />
             </Condition>
             <MenuItem type="Separator" />
@@ -564,10 +570,12 @@
                 <MenuItem id="Copy"
                           icon="document_copy"
                           label="${res:SiteExplorer_SelectedItem_Copy}"
+                          shortcut="Control|C"
                           class="Maestro.Base.Commands.CopyCommand" />
                 <MenuItem id="Cut"
                           icon="scissors_blue"
                           label="${res:SiteExplorer_SelectedItem_Cut}"
+                          shortcut="Control|X"
                           class="Maestro.Base.Commands.CutCommand" />
             </Condition>
             <MenuItem id="Validate"

Modified: trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs	2011-03-09 16:53:02 UTC (rev 5616)
+++ trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs	2011-03-13 15:44:22 UTC (rev 5617)
@@ -65,6 +65,7 @@
             this.trvResources.Expanding += new System.EventHandler<Aga.Controls.Tree.TreeViewAdvEventArgs>(this.trvResources_Expanding);
             this.trvResources.DragEnter += new System.Windows.Forms.DragEventHandler(this.trvResources_DragEnter);
             this.trvResources.KeyUp += new System.Windows.Forms.KeyEventHandler(this.trvResources_KeyUp);
+            this.trvResources.KeyDown += new System.Windows.Forms.KeyEventHandler(this.trvResources_KeyDown);
             this.trvResources.Expanded += new System.EventHandler<Aga.Controls.Tree.TreeViewAdvEventArgs>(this.trvResources_Expanded);
             this.trvResources.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.trvResources_ItemDrag);
             // 

Modified: trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs	2011-03-09 16:53:02 UTC (rev 5616)
+++ trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs	2011-03-13 15:44:22 UTC (rev 5617)
@@ -472,5 +472,32 @@
                 new DeleteSelectedItemsCommand().Run();
             }
         }
+
+        private void trvResources_KeyDown(object sender, KeyEventArgs e)
+        {
+            //Note: Even though the attached context menu has the shortcuts specified
+            //for Cut/Copy/Paste, I'm guessing the TreeViewAdv control is muffling the
+            //event. Nevertheless this handler's got it covered and keeping those 
+            //shortcuts there is useful as a visual reference, even if they don't work
+            //the original way.
+
+            //Note: We handle keydown when intercepting pressing the Control+C/X/V
+            //because the keys are not actually released yet.
+            if (e.Control)
+            {
+                switch (e.KeyCode)
+                {
+                    case Keys.C:
+                        new CopyCommand().Run();
+                        break;
+                    case Keys.X:
+                        new CutCommand().Run();
+                        break;
+                    case Keys.V:
+                        new PasteCommand().Run();
+                        break;
+                }
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx	2011-03-09 16:53:02 UTC (rev 5616)
+++ trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx	2011-03-13 15:44:22 UTC (rev 5617)
@@ -118,7 +118,7 @@
     <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>
+    <value>0, 0</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="tsSiteExplorer.Location" type="System.Drawing.Point, System.Drawing">
@@ -193,6 +193,6 @@
     <value>SiteExplorer</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.ViewContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.ViewContentBase, Maestro.Base, Version=3.0.0.5610, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx	2011-03-09 16:53:02 UTC (rev 5616)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.resx	2011-03-13 15:44:22 UTC (rev 5617)
@@ -330,7 +330,7 @@
     <value>resDataCtrl</value>
   </data>
   <data name="&gt;&gt;resDataCtrl.Type" xml:space="preserve">
-    <value>Maestro.Editors.Generic.ResourceDataPanel, Maestro.Editors, Version=3.0.0.5475, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.Generic.ResourceDataPanel, Maestro.Editors, Version=3.0.0.5610, Culture=neutral, PublicKeyToken=null</value>
   </data>
   <data name="&gt;&gt;resDataCtrl.Parent" xml:space="preserve">
     <value>$this</value>
@@ -450,6 +450,6 @@
     <value>XmlEditorCtrl</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Editors.EditorBase, Maestro.Editors, Version=3.0.0.5475, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.EditorBase, Maestro.Editors, Version=3.0.0.5610, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs	2011-03-09 16:53:02 UTC (rev 5616)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs	2011-03-13 15:44:22 UTC (rev 5617)
@@ -120,6 +120,7 @@
             get { return true; }
         }
 
+        [XmlIgnore]
         IEnumerable<IGraphicBase> ISimpleSymbolDefinition.Graphics
         {
             get 
@@ -149,6 +150,7 @@
             }
         }
 
+        [XmlIgnore]
         IResizeBox ISimpleSymbolDefinition.ResizeBox
         {
             get
@@ -161,6 +163,7 @@
             }
         }
 
+        [XmlIgnore]
         IPointUsage ISimpleSymbolDefinition.PointUsage
         {
             get
@@ -173,6 +176,7 @@
             }
         }
 
+        [XmlIgnore]
         ILineUsage ISimpleSymbolDefinition.LineUsage
         {
             get
@@ -185,6 +189,7 @@
             }
         }
 
+        [XmlIgnore]
         IAreaUsage ISimpleSymbolDefinition.AreaUsage
         {
             get
@@ -197,6 +202,7 @@
             }
         }
 
+        [XmlIgnore]
         IParameterDefinition ISimpleSymbolDefinition.ParameterDefinition
         {
             get { return parameterDefinitionField; }
@@ -209,7 +215,7 @@
     partial class Text : IText
 #endif
     {
-
+        [XmlIgnore]
         bool? IText.Bold
         {
             get
@@ -228,6 +234,7 @@
             }
         }
 
+        [XmlIgnore]
         bool? IText.Italic
         {
             get
@@ -246,6 +253,7 @@
             }
         }
 
+        [XmlIgnore]
         bool? IText.Underlined
         {
             get
@@ -264,6 +272,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IText.Height
         {
             get
@@ -282,6 +291,7 @@
             }
         }
 
+        [XmlIgnore]
         bool? IText.HeightScalable
         {
             get
@@ -300,6 +310,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IText.Angle
         {
             get
@@ -318,6 +329,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IText.PositionX
         {
             get
@@ -336,6 +348,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IText.PositionY
         {
             get
@@ -354,6 +367,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IText.LineSpacing
         {
             get
@@ -372,6 +386,7 @@
             }
         }
 
+        [XmlIgnore]
         ITextFrame IText.Frame
         {
             get
@@ -387,6 +402,7 @@
 
     partial class TextFrame : ITextFrame
     {
+        [XmlIgnore]
         double? ITextFrame.OffsetX
         {
             get
@@ -405,6 +421,7 @@
             }
         }
 
+        [XmlIgnore]
         double? ITextFrame.OffsetY
         {
             get
@@ -426,6 +443,7 @@
 
     partial class ResizeBox : IResizeBox
     {
+        [XmlIgnore]
         double? IResizeBox.SizeX
         {
             get
@@ -444,6 +462,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IResizeBox.SizeY
         {
             get
@@ -462,6 +481,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IResizeBox.PositionX
         {
             get
@@ -480,6 +500,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IResizeBox.PositionY
         {
             get
@@ -501,6 +522,7 @@
 
     partial class Graphics : IGraphics
     {
+        [XmlIgnore]
         public IEnumerable<IGraphicBase> Elements
         {
             get 
@@ -538,6 +560,7 @@
 
     partial class Parameter : IParameter
     {
+        [XmlIgnore]
         string IParameter.DataType
         {
             get
@@ -558,6 +581,7 @@
 
     partial class ParameterDefinition : IParameterDefinition
     {
+        [XmlIgnore]
         IEnumerable<IParameter> IParameterDefinition.Parameter
         {
             get 
@@ -590,6 +614,7 @@
 
     partial class LineUsage : ILineUsage
     {
+        [XmlIgnore]
         double? ILineUsage.StartOffset
         {
             get
@@ -608,6 +633,7 @@
             }
         }
 
+        [XmlIgnore]
         double? ILineUsage.EndOffset
         {
             get
@@ -626,6 +652,7 @@
             }
         }
 
+        [XmlIgnore]
         double? ILineUsage.Repeat
         {
             get
@@ -644,6 +671,7 @@
             }
         }
 
+        [XmlIgnore]
         double? ILineUsage.VertexAngleLimit
         {
             get
@@ -662,6 +690,7 @@
             }
         }
 
+        [XmlIgnore]
         IPath ILineUsage.DefaultPath
         {
             get
@@ -674,7 +703,7 @@
             }
         }
 
-
+        [XmlIgnore]
         double? IUsageBase.Angle
         {
             get
@@ -696,6 +725,7 @@
 
     partial class PointUsage : IPointUsage
     {
+        [XmlIgnore]
         double? IPointUsage.OriginOffsetX
         {
             get
@@ -714,6 +744,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IPointUsage.OriginOffsetY
         {
             get
@@ -732,6 +763,7 @@
             }
         }
 
+        [XmlIgnore]
         string IUsageBase.AngleControl
         {
             get
@@ -744,6 +776,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IUsageBase.Angle
         {
             get
@@ -765,6 +798,7 @@
 
     partial class AreaUsage : IAreaUsage
     {
+        [XmlIgnore]
         double? IAreaUsage.OriginX
         {
             get
@@ -783,6 +817,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IAreaUsage.OriginY
         {
             get
@@ -801,6 +836,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IAreaUsage.RepeatX
         {
             get
@@ -819,6 +855,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IAreaUsage.RepeatY
         {
             get
@@ -837,6 +874,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IAreaUsage.BufferWidth
         {
             get
@@ -855,6 +893,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IUsageBase.Angle
         {
             get
@@ -876,6 +915,7 @@
 
     partial class Path : IPath
     {
+        [XmlIgnore]
         double? IPath.LineWeight
         {
             get
@@ -894,6 +934,7 @@
             }
         }
 
+        [XmlIgnore]
         bool? IPath.LineWeightScalable
         {
             get
@@ -912,6 +953,7 @@
             }
         }
 
+        [XmlIgnore]
         double? IPath.LineMiterLimit
         {
             get
@@ -1010,6 +1052,7 @@
             get { return true; }
         }
 
+        [XmlIgnore]
         IEnumerable<ISimpleSymbolReferenceBase> ICompoundSymbolDefinition.SimpleSymbol
         {
             get 
@@ -1042,6 +1085,7 @@
 
     partial class SimpleSymbol : ISimpleSymbolInlineReference, ISimpleSymbolLibraryReference
     {
+        [XmlIgnore]
         ISimpleSymbolDefinition ISimpleSymbolInlineReference.SimpleSymbolDefinition
         {
             get
@@ -1054,6 +1098,7 @@
             }
         }
 
+        [XmlIgnore]
         public SimpleSymbolReferenceType Type
         {
             get 
@@ -1069,6 +1114,7 @@
             }
         }
 
+        [XmlIgnore]
         string ISimpleSymbolLibraryReference.ResourceId
         {
             get
@@ -1092,6 +1138,7 @@
  
     partial class ImageReference : ISymbolLibraryReference
     {
+        [XmlIgnore]
         SymbolInstanceType ISymbolInstanceReference.Type
         {
             get { return SymbolInstanceType.Reference; }



More information about the mapguide-commits mailing list