[mapguide-commits] r5816 - in trunk/Tools/Maestro: Maestro.Editors/Common Maestro.Editors/DrawingSource OSGeo.MapGuide.MaestroAPI/Commands

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed May 18 11:29:00 EDT 2011


Author: jng
Date: 2011-05-18 08:29:00 -0700 (Wed, 18 May 2011)
New Revision: 5816

Modified:
   trunk/Tools/Maestro/Maestro.Editors/Common/ResourceDataCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs
Log:
#1696: Re-calculate sheet extents when a DWF resource data file has been marked.


Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ResourceDataCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ResourceDataCtrl.cs	2011-05-18 14:58:52 UTC (rev 5815)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ResourceDataCtrl.cs	2011-05-18 15:29:00 UTC (rev 5816)
@@ -310,6 +310,10 @@
             }
         }
 
+        public bool ContainsFile(string name)
+        {
+            return lstDataFiles.Items.ContainsKey(name);
+        }
 
         private void lstDataFiles_SelectedIndexChanged(object sender, EventArgs e)
         {

Modified: trunk/Tools/Maestro/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs	2011-05-18 14:58:52 UTC (rev 5815)
+++ trunk/Tools/Maestro/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs	2011-05-18 15:29:00 UTC (rev 5816)
@@ -51,12 +51,17 @@
             _dws = (IDrawingSource)service.GetEditedResource();
 
             resDataCtrl.Init(service);
-            resDataCtrl.DataListChanged += (sender, e) => { OnResourceChanged(); };
+            resDataCtrl.DataListChanged += new EventHandler(OnResourceDataListChanged);
             resDataCtrl.ResourceDataMarked += new ResourceDataSelectionEventHandler(OnResourceDataMarked);
             TextBoxBinder.BindText(txtSourceCs, _dws, "CoordinateSpace");
             MarkSelected();
         }
 
+        void OnResourceDataListChanged(object sender, EventArgs e)
+        {
+            OnResourceChanged();
+        }
+
         private void MarkSelected()
         {
             var file = _dws.SourceName;
@@ -68,9 +73,25 @@
 
         void OnResourceDataMarked(object sender, string dataName)
         {
-            if (!dataName.Equals(_dws.SourceName))
+            _dws.SourceName = dataName;
+
+            //Re-calc sheet extents for this DWF
+            using (new WaitCursor(this))
             {
-                _dws.SourceName = dataName;
+                _dws.RemoveAllSheets();
+                _edSvc.SyncSessionCopy();
+
+                //Re-populate sheets
+                IDrawingService dwSvc = (IDrawingService)_dws.CurrentConnection.GetService((int)ServiceType.Drawing);
+                var sheets = dwSvc.EnumerateDrawingSections(_dws.ResourceID);
+                foreach (var sht in sheets.Section)
+                {
+                    _dws.AddSheet(_dws.CreateSheet(sht.Name, 0, 0, 0, 0));
+                }
+
+                _edSvc.SyncSessionCopy();
+                //Re-calc extents
+                _dws.UpdateExtents();
             }
         }
 

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs	2011-05-18 14:58:52 UTC (rev 5815)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs	2011-05-18 15:29:00 UTC (rev 5816)
@@ -592,8 +592,6 @@
                                 {
                                     foreach(var sect in list.Section)
                                     {
-                                        //TODO: Extract CS and extent info of each sheet and reg them into the document content
-                                        //DWF files are ZIP files, so we have the ability to peek at its internals
                                         var sht = ds.CreateSheet(sect.Name, 0, 0, 0, 0);
                                         ds.AddSheet(sht);
                                     }



More information about the mapguide-commits mailing list