[mapguide-commits] r5203 - in sandbox/maestro-3.0: Maestro.Base Maestro.Base/Commands Maestro.Base/Properties Maestro.Base/Services Maestro.Base/UI Maestro.ResourceValidation OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI.Http

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Sep 28 11:21:37 EDT 2010


Author: jng
Date: 2010-09-28 15:21:37 +0000 (Tue, 28 Sep 2010)
New Revision: 5203

Added:
   sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.Designer.cs
   sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.cs
   sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.resx
Modified:
   sandbox/maestro-3.0/Maestro.Base/Commands/StartupCommand.cs
   sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin
   sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj
   sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs
   sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx
   sandbox/maestro-3.0/Maestro.Base/Services/ViewContentManager.cs
   sandbox/maestro-3.0/Maestro.ResourceValidation/LayerDefinitionValidator.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs
Log:
This submission includes the following changes:
 - #1379: Implement outbound request logging. Added a outbound request user pane
 - Fix show logic with singleton view content
 - Show messages and outbound request panes on startup

Modified: sandbox/maestro-3.0/Maestro.Base/Commands/StartupCommand.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Commands/StartupCommand.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.Base/Commands/StartupCommand.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -47,10 +47,13 @@
 
                 var mgr = ServiceRegistry.GetService<ViewContentManager>();
 
-                //Show messages
+                //Show messages and outbound requests
                 mgr.OpenContent<MessageViewer>(ViewRegion.Bottom);
+                mgr.OpenContent<OutboundRequestViewer>(ViewRegion.Bottom);
 
                 new LoginCommand().Run();
+
+                
             };
         }
     }

Modified: sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin	2010-09-28 15:21:37 UTC (rev 5203)
@@ -154,6 +154,7 @@
     <!-- Singleton view content -->
     <Path name="/Maestro/Shell/SingleViewContent">
         <Class id="MessageViewer" class="Maestro.Base.UI.MessageViewer" />
+        <Class id="OutboundRequestViewer" class="Maestro.Base.UI.OutboundRequestViewer" />
         <Class id="WelcomeScreen" class="Maestro.Base.UI.WelcomeScreen" />
     </Path>
     

Modified: sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj	2010-09-28 15:21:37 UTC (rev 5203)
@@ -80,67 +80,67 @@
     <Compile Include="Commands\Toggle\ToggleMessagesCommand.cs" />
     <Compile Include="Commands\ValidateResourceCommand.cs" />
     <Compile Include="Commands\XmlEditCommand.cs" />
-    <Compile Include="Editor\DrawingSourceEditor.cs">
+    <Compile Include="Commands\Editor\DrawingSourceEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\DrawingSourceEditor.Designer.cs">
+    <Compile Include="Commands\Editor\DrawingSourceEditor.Designer.cs">
       <DependentUpon>DrawingSourceEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\FeatureSourceEditor.cs">
+    <Compile Include="Commands\Editor\FeatureSourceEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\FeatureSourceEditor.Designer.cs">
+    <Compile Include="Commands\Editor\FeatureSourceEditor.Designer.cs">
       <DependentUpon>FeatureSourceEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\IEditorFactory.cs" />
-    <Compile Include="Editor\LayerDefinitionEditor.cs">
+    <Compile Include="Commands\Editor\IEditorFactory.cs" />
+    <Compile Include="Commands\Editor\LayerDefinitionEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\LayerDefinitionEditor.Designer.cs">
+    <Compile Include="Commands\Editor\LayerDefinitionEditor.Designer.cs">
       <DependentUpon>LayerDefinitionEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\LoadProcedureEditor.cs">
+    <Compile Include="Commands\Editor\LoadProcedureEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\LoadProcedureEditor.Designer.cs">
+    <Compile Include="Commands\Editor\LoadProcedureEditor.Designer.cs">
       <DependentUpon>LoadProcedureEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\MapDefinitionEditor.cs">
+    <Compile Include="Commands\Editor\MapDefinitionEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\MapDefinitionEditor.Designer.cs">
+    <Compile Include="Commands\Editor\MapDefinitionEditor.Designer.cs">
       <DependentUpon>MapDefinitionEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\PrintLayoutEditor.cs">
+    <Compile Include="Commands\Editor\PrintLayoutEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\PrintLayoutEditor.Designer.cs">
+    <Compile Include="Commands\Editor\PrintLayoutEditor.Designer.cs">
       <DependentUpon>PrintLayoutEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\ResourceEditorService.cs" />
-    <Compile Include="Editor\EditorContentBase.cs">
+    <Compile Include="Commands\Editor\ResourceEditorService.cs" />
+    <Compile Include="Commands\Editor\EditorContentBase.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\EditorContentBase.Designer.cs">
+    <Compile Include="Commands\Editor\EditorContentBase.Designer.cs">
       <DependentUpon>EditorContentBase.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\IEditorViewContent.cs" />
-    <Compile Include="Editor\SymbolDefinitionEditor.cs">
+    <Compile Include="Commands\Editor\IEditorViewContent.cs" />
+    <Compile Include="Commands\Editor\SymbolDefinitionEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\SymbolDefinitionEditor.Designer.cs">
+    <Compile Include="Commands\Editor\SymbolDefinitionEditor.Designer.cs">
       <DependentUpon>SymbolDefinitionEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\WebLayoutEditor.cs">
+    <Compile Include="Commands\Editor\WebLayoutEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\WebLayoutEditor.Designer.cs">
+    <Compile Include="Commands\Editor\WebLayoutEditor.Designer.cs">
       <DependentUpon>WebLayoutEditor.cs</DependentUpon>
     </Compile>
-    <Compile Include="Editor\XmlEditor.cs">
+    <Compile Include="Commands\Editor\XmlEditor.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="Editor\XmlEditor.Designer.cs">
+    <Compile Include="Commands\Editor\XmlEditor.Designer.cs">
       <DependentUpon>XmlEditor.cs</DependentUpon>
     </Compile>
     <Compile Include="Events\EventWatcher.cs" />
@@ -200,6 +200,12 @@
     <Compile Include="UI\NewResourceDialog.Designer.cs">
       <DependentUpon>NewResourceDialog.cs</DependentUpon>
     </Compile>
+    <Compile Include="UI\OutboundRequestViewer.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="UI\OutboundRequestViewer.Designer.cs">
+      <DependentUpon>OutboundRequestViewer.cs</DependentUpon>
+    </Compile>
     <Compile Include="UI\RenameItemDialog.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -305,38 +311,38 @@
     <None Include="Resources\MapGuide Maestro.ico" />
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="Editor\DrawingSourceEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\DrawingSourceEditor.resx">
       <DependentUpon>DrawingSourceEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\EditorContentBase.resx">
+    <EmbeddedResource Include="Commands\Editor\EditorContentBase.resx">
       <DependentUpon>EditorContentBase.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\FeatureSourceEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\FeatureSourceEditor.resx">
       <DependentUpon>FeatureSourceEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\LayerDefinitionEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\LayerDefinitionEditor.resx">
       <DependentUpon>LayerDefinitionEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\LoadProcedureEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\LoadProcedureEditor.resx">
       <DependentUpon>LoadProcedureEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\MapDefinitionEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\MapDefinitionEditor.resx">
       <DependentUpon>MapDefinitionEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\PrintLayoutEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\PrintLayoutEditor.resx">
       <DependentUpon>PrintLayoutEditor.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\WebLayoutEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\WebLayoutEditor.resx">
       <DependentUpon>WebLayoutEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="Editor\XmlEditor.resx">
+    <EmbeddedResource Include="Commands\Editor\XmlEditor.resx">
       <DependentUpon>XmlEditor.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
@@ -365,6 +371,9 @@
       <DependentUpon>NewResourceDialog.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
+    <EmbeddedResource Include="UI\OutboundRequestViewer.resx">
+      <DependentUpon>OutboundRequestViewer.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="UI\RenameItemDialog.resx">
       <DependentUpon>RenameItemDialog.cs</DependentUpon>
     </EmbeddedResource>

Modified: sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.4927
+//     Runtime Version:2.0.50727.4952
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -278,6 +278,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Outbound Requests.
+        /// </summary>
+        internal static string Content_OutboundRequests {
+            get {
+                return ResourceManager.GetString("Content_OutboundRequests", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Site Explorer.
         /// </summary>
         internal static string Content_SiteExplorer {

Modified: sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx	2010-09-28 15:21:37 UTC (rev 5203)
@@ -643,4 +643,7 @@
   <data name="RenameTo" xml:space="preserve">
     <value>Rename to</value>
   </data>
+  <data name="Content_OutboundRequests" xml:space="preserve">
+    <value>Outbound Requests</value>
+  </data>
 </root>
\ No newline at end of file

Modified: sandbox/maestro-3.0/Maestro.Base/Services/ViewContentManager.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Services/ViewContentManager.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.Base/Services/ViewContentManager.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -114,7 +114,7 @@
                     if (type.IsAssignableFrom(cnt.GetType()))
                     {
                         if (!cnt.IsAttached)
-                            Workbench.Instance.ShowContent(cnt);
+                            _wb.ShowContent(cnt);
                         cnt.Activate();
                         if (_wb != null)
                             _wb.CheckContainerStatus();
@@ -153,7 +153,11 @@
                 {
                     if (type.IsAssignableFrom(cnt.GetType()))
                     {
+                        if (!cnt.IsAttached)
+                            _wb.ShowContent(cnt);
                         cnt.Activate();
+                        if (_wb != null)
+                            _wb.CheckContainerStatus();
                         return (T)cnt;
                     }
                 }

Added: sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.Designer.cs	                        (rev 0)
+++ sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.Designer.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -0,0 +1,100 @@
+namespace Maestro.Base.UI
+{
+    partial class OutboundRequestViewer
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.txtMessages = new System.Windows.Forms.TextBox();
+            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+            this.btnSave = new System.Windows.Forms.ToolStripButton();
+            this.btnClear = new System.Windows.Forms.ToolStripButton();
+            this.toolStrip1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // txtMessages
+            // 
+            this.txtMessages.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.txtMessages.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.txtMessages.Location = new System.Drawing.Point(0, 25);
+            this.txtMessages.Multiline = true;
+            this.txtMessages.Name = "txtMessages";
+            this.txtMessages.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.txtMessages.Size = new System.Drawing.Size(709, 215);
+            this.txtMessages.TabIndex = 3;
+            // 
+            // toolStrip1
+            // 
+            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.btnSave,
+            this.btnClear});
+            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
+            this.toolStrip1.Name = "toolStrip1";
+            this.toolStrip1.Size = new System.Drawing.Size(709, 25);
+            this.toolStrip1.TabIndex = 2;
+            this.toolStrip1.Text = "toolStrip1";
+            // 
+            // btnSave
+            // 
+            this.btnSave.Image = global::Maestro.Base.Properties.Resources.disk;
+            this.btnSave.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(51, 22);
+            this.btnSave.Text = "Save";
+            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+            // 
+            // btnClear
+            // 
+            this.btnClear.Image = global::Maestro.Base.Properties.Resources.cross_script;
+            this.btnClear.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.btnClear.Name = "btnClear";
+            this.btnClear.Size = new System.Drawing.Size(54, 22);
+            this.btnClear.Text = "Clear";
+            this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
+            // 
+            // OutboundRequestViewer
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.txtMessages);
+            this.Controls.Add(this.toolStrip1);
+            this.Name = "OutboundRequestViewer";
+            this.Size = new System.Drawing.Size(709, 240);
+            this.toolStrip1.ResumeLayout(false);
+            this.toolStrip1.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox txtMessages;
+        private System.Windows.Forms.ToolStrip toolStrip1;
+        private System.Windows.Forms.ToolStripButton btnSave;
+        private System.Windows.Forms.ToolStripButton btnClear;
+    }
+}

Added: sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.cs	                        (rev 0)
+++ sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using Maestro.Shared.UI;
+using System.IO;
+using ICSharpCode.Core;
+using Maestro.Base.Services;
+
+namespace Maestro.Base.UI
+{
+    public partial class OutboundRequestViewer : SingletonViewContent
+    {
+        public OutboundRequestViewer()
+        {
+            InitializeComponent();
+            this.Title = this.Description = Properties.Resources.Content_OutboundRequests;
+        }
+
+        protected override void OnLoad(EventArgs e)
+        {
+            base.OnLoad(e);
+
+            //TODO: Re-evaluate design when we decide to support multiple site connections
+            var wb = Workbench.Instance;
+            var exp = wb.ActiveSiteExplorer;
+
+            var connMgr = ServiceRegistry.GetService<ServerConnectionManager>();
+            var conn = connMgr.GetConnection(exp.ConnectionName);
+            conn.RequestDispatched += new OSGeo.MapGuide.MaestroAPI.RequestEventHandler(OnRequestDispatched);
+        }
+
+        void OnRequestDispatched(object sender, OSGeo.MapGuide.MaestroAPI.RequestEventArgs e)
+        {
+            string msg = string.Format("[{0}]: {1}", DateTime.Now.ToString("dd MMM yyyy hh:mm:ss"), e.Data);
+
+            if (!txtMessages.IsDisposed)
+            {
+                if (txtMessages.InvokeRequired)
+                {
+                    txtMessages.Invoke(new MethodInvoker(() =>
+                    {
+                        txtMessages.AppendText(msg + Environment.NewLine);
+                        txtMessages.ScrollToCaret();
+                    }));
+                }
+                else
+                {
+                    txtMessages.AppendText(msg + Environment.NewLine);
+                    txtMessages.ScrollToCaret();
+                }
+            }
+        }
+
+        private void btnClear_Click(object sender, EventArgs e)
+        {
+            txtMessages.Clear();
+        }
+
+        private void btnSave_Click(object sender, EventArgs e)
+        {
+            using (var save = DialogFactory.SaveFile())
+            {
+                save.Filter = "*.log|*.log";
+                if (save.ShowDialog() == DialogResult.OK)
+                {
+                    File.WriteAllText(save.FileName, txtMessages.Text);
+                    MessageService.ShowMessage(string.Format(Properties.Resources.Log_Saved, save.FileName));
+                }
+            }
+        }
+
+        public override ViewRegion DefaultRegion
+        {
+            get
+            {
+                return ViewRegion.Bottom;
+            }
+        }
+    }
+}

Added: sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.resx	                        (rev 0)
+++ sandbox/maestro-3.0/Maestro.Base/UI/OutboundRequestViewer.resx	2010-09-28 15:21:37 UTC (rev 5203)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
\ No newline at end of file

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/LayerDefinitionValidator.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/LayerDefinitionValidator.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/LayerDefinitionValidator.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -29,7 +29,7 @@
 {
     public class LayerDefinitionValidator : IResourceValidator
     {
-        public ValidationIssue[] Validate(IResource resource, bool recurse)
+        public virtual ValidationIssue[] Validate(IResource resource, bool recurse)
         {
             if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition)
                 return null;
@@ -37,6 +37,11 @@
             if (resource.ResourceVersion != new Version(1, 0, 0))
                 return null;
 
+            return ValidateBase(resource, recurse);
+        }
+
+        private static ValidationIssue[] ValidateBase(IResource resource, bool recurse)
+        {
             LayerDefinition ldef = resource as LayerDefinition;
             VectorLayerDefinitionType vldef = ldef.Item as VectorLayerDefinitionType;
             GridLayerDefinitionType gldef = ldef.Item as GridLayerDefinitionType;
@@ -167,7 +172,7 @@
             return issues.ToArray();
         }
 
-        public ResourceTypeDescriptor SupportedResourceAndVersion
+        public virtual ResourceTypeDescriptor SupportedResourceAndVersion
         {
             get { return new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.0.0"); }
         }

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -132,8 +132,25 @@
         /// <param name="name"></param>
         /// <returns></returns>
         object GetCustomProperty(string name);
+
+        /// <summary>
+        /// Raised when a outbound request has been dispatched
+        /// </summary>
+        event RequestEventHandler RequestDispatched;
     }
 
+    public delegate void RequestEventHandler(object sender, RequestEventArgs e);
+
+    public class RequestEventArgs : EventArgs
+    {
+        public string Data { get; private set; }
+
+        public RequestEventArgs(string data)
+        {
+            this.Data = data;
+        }
+    }
+
     public static class ConnectionExtensionMethods
     {
         public static string GenerateSessionResourceId(this IServerConnection conn, ResourceTypes resType)

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -1627,5 +1627,17 @@
                     return null;
             }
         }
+
+        /// <summary>
+        /// Raised when a outbound request has been dispatched
+        /// </summary>
+        public event RequestEventHandler RequestDispatched;
+
+        protected void OnRequestDispatched(string data)
+        {
+            var handler = this.RequestDispatched;
+            if (handler != null)
+                handler(this, new RequestEventArgs(data));
+        }
     }
 }

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2010-09-28 14:33:11 UTC (rev 5202)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2010-09-28 15:21:37 UTC (rev 5203)
@@ -1297,6 +1297,7 @@
                 if (_cred != null)
                     httpreq.Credentials = _cred;
                 var httpresp = httpreq.GetResponse();
+                OnRequestDispatched(req);
                 return httpresp.GetResponseStream();
 			}
 			catch (Exception ex)



More information about the mapguide-commits mailing list