[mapguide-commits] r5715 - in trunk/Tools/Maestro/Maestro.Base: .
Editor
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Apr 21 09:57:00 EDT 2011
Author: jng
Date: 2011-04-21 06:57:00 -0700 (Thu, 21 Apr 2011)
New Revision: 5715
Added:
trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.Designer.cs
trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.cs
trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.resx
Modified:
trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs
trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj
Log:
#1668: Show a placeholder prompting to use the XML editor when opening a DWG or Raster load procedure
Modified: trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs 2011-04-21 06:45:58 UTC (rev 5714)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs 2011-04-21 13:57:00 UTC (rev 5715)
@@ -25,6 +25,7 @@
using System.Text;
using System.Windows.Forms;
using Maestro.Editors.LoadProcedure;
+using OSGeo.MapGuide.ObjectModels.LoadProcedure;
namespace Maestro.Base.Editor
{
@@ -38,12 +39,23 @@
protected override void Bind(Maestro.Editors.IEditorService service)
{
panelBody.Controls.Clear();
+ var lp = (ILoadProcedure)service.GetEditedResource();
+ //DWG and Raster load procedures cannot be edited with this editor so load placeholder
+ if (lp.SubType.Type == LoadType.Dwg ||
+ lp.SubType.Type == LoadType.Raster)
+ {
+ var ctrl = new UnsupportedEditorControl();
+ ctrl.Dock = DockStyle.Fill;
+ panelBody.Controls.Add(ctrl);
+ }
+ else
+ {
+ var lpEditor = new LoadProcedureEditorCtrl();
+ lpEditor.Dock = DockStyle.Fill;
+ panelBody.Controls.Add(lpEditor);
- var lpEditor = new LoadProcedureEditorCtrl();
- lpEditor.Dock = DockStyle.Fill;
- panelBody.Controls.Add(lpEditor);
-
- lpEditor.Bind(service);
+ lpEditor.Bind(service);
+ }
}
}
}
Added: trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.Designer.cs 2011-04-21 13:57:00 UTC (rev 5715)
@@ -0,0 +1,54 @@
+namespace Maestro.Base.Editor
+{
+ partial class UnsupportedEditorControl
+ {
+ /// <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()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UnsupportedEditorControl));
+ this.label1 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ resources.ApplyResources(this.label1, "label1");
+ this.label1.Name = "label1";
+ //
+ // UnsupportedEditorControl
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.Controls.Add(this.label1);
+ this.Name = "UnsupportedEditorControl";
+ resources.ApplyResources(this, "$this");
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.cs 2011-04-21 13:57:00 UTC (rev 5715)
@@ -0,0 +1,40 @@
+#region Disclaimer / License
+// Copyright (C) 2011, 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.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Maestro.Base.Editor
+{
+ /// <summary>
+ /// A placeholder control for resource sub-types that cannot be edited with a specialized editor
+ /// </summary>
+ public partial class UnsupportedEditorControl : UserControl
+ {
+ public UnsupportedEditorControl()
+ {
+ InitializeComponent();
+ }
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/UnsupportedEditorControl.resx 2011-04-21 13:57:00 UTC (rev 5715)
@@ -0,0 +1,165 @@
+<?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>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="label1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+ <value>Fill</value>
+ </data>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>0, 0</value>
+ </data>
+ <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>454, 189</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="label1.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="label1.Text" xml:space="preserve">
+ <value>This specialized editor does not support editing this type of resource. If you wish to edit this resource, use the "Open Resource with XML editor" command from the Site Explorer</value>
+ </data>
+ <data name="label1.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
+ <value>MiddleCenter</value>
+ </data>
+ <data name=">>label1.Name" xml:space="preserve">
+ <value>label1</value>
+ </data>
+ <data name=">>label1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label1.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label1.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
+ <value>454, 189</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>UnsupportedEditorControl</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj 2011-04-21 06:45:58 UTC (rev 5714)
+++ trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj 2011-04-21 13:57:00 UTC (rev 5715)
@@ -191,6 +191,12 @@
<Compile Include="Editor\SymbolDefinitionEditor.Designer.cs">
<DependentUpon>SymbolDefinitionEditor.cs</DependentUpon>
</Compile>
+ <Compile Include="Editor\UnsupportedEditorControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Editor\UnsupportedEditorControl.Designer.cs">
+ <DependentUpon>UnsupportedEditorControl.cs</DependentUpon>
+ </Compile>
<Compile Include="Editor\WebLayoutEditor.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -458,6 +464,9 @@
<EmbeddedResource Include="Editor\SymbolDefinitionEditor.resx">
<DependentUpon>SymbolDefinitionEditor.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Editor\UnsupportedEditorControl.resx">
+ <DependentUpon>UnsupportedEditorControl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Editor\WebLayoutEditor.resx">
<DependentUpon>WebLayoutEditor.cs</DependentUpon>
</EmbeddedResource>
More information about the mapguide-commits
mailing list