[mapguide-commits] r4920 - in sandbox/maestro-2.5: Maestro.Base
Maestro.Base/Editor Maestro.Editors Maestro.Editors/Common
Maestro.Editors/FeatureSource
Maestro.Editors/FeatureSource/Providers
Maestro.Editors/FeatureSource/Providers/Sdf
Maestro.Editors/FeatureSource/Providers/Shp
Maestro.Editors/Properties OSGeo.MapGuide.MaestroAPI/ObjectModels
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri May 21 06:38:46 EDT 2010
Author: jng
Date: 2010-05-21 06:38:46 -0400 (Fri, 21 May 2010)
New Revision: 4920
Added:
sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.resx
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.resx
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.resx
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.resx
Modified:
sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs
sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.cs
sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj
sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.resx
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.cs
sandbox/maestro-2.5/Maestro.Editors/Maestro.Editors.csproj
sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.Designer.cs
sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.resx
sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs
Log:
This submission fleshes out the implementation of the Feature Source Editor
Modified: sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -28,10 +28,34 @@
/// </summary>
private void InitializeComponent()
{
- components = new System.ComponentModel.Container();
+ this.fsEditorCtrl = new Maestro.Editors.FeatureSource.FeatureSourceEditorCtrl();
+ this.panelBody.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panelBody
+ //
+ this.panelBody.Controls.Add(this.fsEditorCtrl);
+ //
+ // fsEditorCtrl
+ //
+ this.fsEditorCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.fsEditorCtrl.Location = new System.Drawing.Point(0, 0);
+ this.fsEditorCtrl.Name = "fsEditorCtrl";
+ this.fsEditorCtrl.Size = new System.Drawing.Size(614, 520);
+ this.fsEditorCtrl.TabIndex = 0;
+ //
+ // FeatureSourceEditor
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Name = "FeatureSourceEditor";
+ this.panelBody.ResumeLayout(false);
+ this.ResumeLayout(false);
+
}
#endregion
+
+ private Maestro.Editors.FeatureSource.FeatureSourceEditorCtrl fsEditorCtrl;
}
}
Modified: sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -36,7 +36,8 @@
protected override void Bind(Maestro.Editors.IEditorService service)
{
-
+ service.RegisterCustomNotifier(fsEditorCtrl);
+ fsEditorCtrl.Bind(service);
}
}
}
Added: sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.resx (rev 0)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/FeatureSourceEditor.resx 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,120 @@
+<?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>
+</root>
\ 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-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj 2010-05-21 10:38:46 UTC (rev 4920)
@@ -248,6 +248,9 @@
<DependentUpon>EditorContentBase.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="Editor\FeatureSourceEditor.resx">
+ <DependentUpon>FeatureSourceEditor.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Editor\LayerDefinitionEditor.resx">
<DependentUpon>LayerDefinitionEditor.cs</DependentUpon>
</EmbeddedResource>
Modified: sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -28,35 +28,25 @@
/// </summary>
private void InitializeComponent()
{
- this.grdDataFiles = new System.Windows.Forms.DataGridView();
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ResourceDataCtrl));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.btnAdd = new System.Windows.Forms.ToolStripButton();
this.btnDelete = new System.Windows.Forms.ToolStripButton();
this.btnDownload = new System.Windows.Forms.ToolStripButton();
- ((System.ComponentModel.ISupportInitialize)(this.grdDataFiles)).BeginInit();
+ this.btnMark = new System.Windows.Forms.ToolStripButton();
+ this.lstDataFiles = new System.Windows.Forms.ListView();
+ this.imgIcons = new System.Windows.Forms.ImageList(this.components);
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
- // grdDataFiles
- //
- this.grdDataFiles.AllowUserToAddRows = false;
- this.grdDataFiles.AllowUserToDeleteRows = false;
- this.grdDataFiles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.grdDataFiles.Dock = System.Windows.Forms.DockStyle.Fill;
- this.grdDataFiles.Location = new System.Drawing.Point(0, 25);
- this.grdDataFiles.Name = "grdDataFiles";
- this.grdDataFiles.ReadOnly = true;
- this.grdDataFiles.Size = new System.Drawing.Size(453, 185);
- this.grdDataFiles.TabIndex = 3;
- this.grdDataFiles.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdDataFiles_CellClick);
- this.grdDataFiles.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdDataFiles_CellContentClick);
- //
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnAdd,
this.btnDelete,
- this.btnDownload});
+ this.btnDownload,
+ this.btnMark});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(453, 25);
@@ -90,15 +80,43 @@
this.btnDownload.Text = "Download";
this.btnDownload.Click += new System.EventHandler(this.btnDownload_Click);
//
+ // btnMark
+ //
+ this.btnMark.Image = global::Maestro.Editors.Properties.Resources.tick;
+ this.btnMark.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.btnMark.Name = "btnMark";
+ this.btnMark.Size = new System.Drawing.Size(54, 22);
+ this.btnMark.Text = "Mark";
+ this.btnMark.ToolTipText = "Mark as the Data File";
+ this.btnMark.Click += new System.EventHandler(this.btnMark_Click);
+ //
+ // lstDataFiles
+ //
+ this.lstDataFiles.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lstDataFiles.Location = new System.Drawing.Point(0, 25);
+ this.lstDataFiles.MultiSelect = false;
+ this.lstDataFiles.Name = "lstDataFiles";
+ this.lstDataFiles.Size = new System.Drawing.Size(453, 185);
+ this.lstDataFiles.SmallImageList = this.imgIcons;
+ this.lstDataFiles.TabIndex = 3;
+ this.lstDataFiles.UseCompatibleStateImageBehavior = false;
+ this.lstDataFiles.View = System.Windows.Forms.View.List;
+ this.lstDataFiles.SelectedIndexChanged += new System.EventHandler(this.lstDataFiles_SelectedIndexChanged);
+ //
+ // imgIcons
+ //
+ this.imgIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgIcons.ImageStream")));
+ this.imgIcons.TransparentColor = System.Drawing.Color.Transparent;
+ this.imgIcons.Images.SetKeyName(0, "document.png");
+ //
// ResourceDataCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.grdDataFiles);
+ this.Controls.Add(this.lstDataFiles);
this.Controls.Add(this.toolStrip1);
this.Name = "ResourceDataCtrl";
this.Size = new System.Drawing.Size(453, 210);
- ((System.ComponentModel.ISupportInitialize)(this.grdDataFiles)).EndInit();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
@@ -108,10 +126,12 @@
#endregion
- private System.Windows.Forms.DataGridView grdDataFiles;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton btnDelete;
private System.Windows.Forms.ToolStripButton btnDownload;
private System.Windows.Forms.ToolStripButton btnAdd;
+ private System.Windows.Forms.ListView lstDataFiles;
+ private System.Windows.Forms.ToolStripButton btnMark;
+ private System.Windows.Forms.ImageList imgIcons;
}
}
Modified: sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -36,6 +36,7 @@
public ResourceDataCtrl()
{
InitializeComponent();
+ this.MarkEnabled = false;
}
public event EventHandler DataListChanged;
@@ -45,6 +46,7 @@
btnAdd.Enabled = (_edSvc != null);
btnDelete.Enabled = (_edSvc != null && this.SelectedItem != null);
btnDownload.Enabled = (_edSvc != null && this.SelectedItem != null);
+ btnMark.Enabled = (this.SelectedItem != null);
}
private IEditorService _edSvc;
@@ -55,9 +57,9 @@
{
get
{
- if (grdDataFiles.SelectedRows.Count == 1)
+ if (lstDataFiles.SelectedItems.Count == 1)
{
- return grdDataFiles.SelectedRows[0].DataBoundItem as ResourceDataListResourceData;
+ return lstDataFiles.SelectedItems[0].Tag as ResourceDataListResourceData;
}
return null;
}
@@ -80,13 +82,55 @@
EvaluateCommands();
}
+ public bool MarkEnabled
+ {
+ get { return btnMark.Visible; }
+ set { btnMark.Visible = value; }
+ }
+
+ public string MarkedFile
+ {
+ get
+ {
+ foreach (ListViewItem item in lstDataFiles.Items)
+ {
+ if (item.Font.Bold)
+ return (item.Tag as ResourceDataListResourceData).Name;
+ }
+ return string.Empty;
+ }
+ set
+ {
+ ListViewItem it = null;
+ foreach (ListViewItem item in lstDataFiles.Items)
+ {
+ if (item.Name == value)
+ it = item;
+ }
+ if (it != null)
+ {
+ MarkItem(it);
+ }
+ }
+ }
+
private void LoadResourceData()
{
var list = _edSvc.ResourceService.EnumerateResourceData(_edSvc.EditedResourceID);
_data = list.ResourceData;
- grdDataFiles.DataSource = _data;
- grdDataFiles.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
+ foreach (var f in _data)
+ {
+ var item = new ListViewItem();
+ item.Tag = f;
+ item.Text = f.Name;
+ item.Name = f.Name;
+
+ if (_defaultFont == null)
+ _defaultFont = item.Font;
+
+ lstDataFiles.Items.Add(item);
+ }
}
private void btnAdd_Click(object sender, EventArgs e)
@@ -143,6 +187,8 @@
}
}
+ private Font _defaultFont;
+
private void btnDownload_Click(object sender, EventArgs e)
{
var item = this.SelectedItem;
@@ -170,17 +216,29 @@
}
}
- private void grdDataFiles_CellContentClick(object sender, DataGridViewCellEventArgs e)
+ private void btnMark_Click(object sender, EventArgs e)
{
- grdDataFiles.ClearSelection();
- grdDataFiles.Rows[e.RowIndex].Selected = true;
- EvaluateCommands();
+ if (lstDataFiles.SelectedItems.Count == 1)
+ {
+ MarkItem(lstDataFiles.SelectedItems[0]);
+ }
}
- private void grdDataFiles_CellClick(object sender, DataGridViewCellEventArgs e)
+ private void MarkItem(ListViewItem item)
{
- grdDataFiles.ClearSelection();
- grdDataFiles.Rows[e.RowIndex].Selected = true;
+ //Restore original font
+ foreach (ListViewItem it in lstDataFiles.Items)
+ {
+ it.Font = new Font(_defaultFont, _defaultFont.Style);
+ }
+
+ //Bold the selected item
+ var f = item.Font;
+ item.Font = new Font(f, f.Style | FontStyle.Bold);
+ }
+
+ private void lstDataFiles_SelectedIndexChanged(object sender, EventArgs e)
+ {
EvaluateCommands();
}
}
Modified: sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.resx 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/Common/ResourceDataCtrl.resx 2010-05-21 10:38:46 UTC (rev 4920)
@@ -120,4 +120,49 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
+ <metadata name="imgIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>122, 17</value>
+ </metadata>
+ <data name="imgIcons.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>
+ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
+ LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
+ ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAK
+ CAAAAk1TRnQBSQFMAwEBAAEYAQABGAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
+ AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
+ AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
+ AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm
+ AwABmQMAAcwCAAEzAwACMwIAATMBZgIAATMBmQIAATMBzAIAATMB/wIAAWYDAAFmATMCAAJmAgABZgGZ
+ AgABZgHMAgABZgH/AgABmQMAAZkBMwIAAZkBZgIAApkCAAGZAcwCAAGZAf8CAAHMAwABzAEzAgABzAFm
+ AgABzAGZAgACzAIAAcwB/wIAAf8BZgIAAf8BmQIAAf8BzAEAATMB/wIAAf8BAAEzAQABMwEAAWYBAAEz
+ AQABmQEAATMBAAHMAQABMwEAAf8BAAH/ATMCAAMzAQACMwFmAQACMwGZAQACMwHMAQACMwH/AQABMwFm
+ AgABMwFmATMBAAEzAmYBAAEzAWYBmQEAATMBZgHMAQABMwFmAf8BAAEzAZkCAAEzAZkBMwEAATMBmQFm
+ AQABMwKZAQABMwGZAcwBAAEzAZkB/wEAATMBzAIAATMBzAEzAQABMwHMAWYBAAEzAcwBmQEAATMCzAEA
+ ATMBzAH/AQABMwH/ATMBAAEzAf8BZgEAATMB/wGZAQABMwH/AcwBAAEzAv8BAAFmAwABZgEAATMBAAFm
+ AQABZgEAAWYBAAGZAQABZgEAAcwBAAFmAQAB/wEAAWYBMwIAAWYCMwEAAWYBMwFmAQABZgEzAZkBAAFm
+ ATMBzAEAAWYBMwH/AQACZgIAAmYBMwEAA2YBAAJmAZkBAAJmAcwBAAFmAZkCAAFmAZkBMwEAAWYBmQFm
+ AQABZgKZAQABZgGZAcwBAAFmAZkB/wEAAWYBzAIAAWYBzAEzAQABZgHMAZkBAAFmAswBAAFmAcwB/wEA
+ AWYB/wIAAWYB/wEzAQABZgH/AZkBAAFmAf8BzAEAAcwBAAH/AQAB/wEAAcwBAAKZAgABmQEzAZkBAAGZ
+ AQABmQEAAZkBAAHMAQABmQMAAZkCMwEAAZkBAAFmAQABmQEzAcwBAAGZAQAB/wEAAZkBZgIAAZkBZgEz
+ AQABmQEzAWYBAAGZAWYBmQEAAZkBZgHMAQABmQEzAf8BAAKZATMBAAKZAWYBAAOZAQACmQHMAQACmQH/
+ AQABmQHMAgABmQHMATMBAAFmAcwBZgEAAZkBzAGZAQABmQLMAQABmQHMAf8BAAGZAf8CAAGZAf8BMwEA
+ AZkBzAFmAQABmQH/AZkBAAGZAf8BzAEAAZkC/wEAAcwDAAGZAQABMwEAAcwBAAFmAQABzAEAAZkBAAHM
+ AQABzAEAAZkBMwIAAcwCMwEAAcwBMwFmAQABzAEzAZkBAAHMATMBzAEAAcwBMwH/AQABzAFmAgABzAFm
+ ATMBAAGZAmYBAAHMAWYBmQEAAcwBZgHMAQABmQFmAf8BAAHMAZkCAAHMAZkBMwEAAcwBmQFmAQABzAKZ
+ AQABzAGZAcwBAAHMAZkB/wEAAswCAALMATMBAALMAWYBAALMAZkBAAPMAQACzAH/AQABzAH/AgABzAH/
+ ATMBAAGZAf8BZgEAAcwB/wGZAQABzAH/AcwBAAHMAv8BAAHMAQABMwEAAf8BAAFmAQAB/wEAAZkBAAHM
+ ATMCAAH/AjMBAAH/ATMBZgEAAf8BMwGZAQAB/wEzAcwBAAH/ATMB/wEAAf8BZgIAAf8BZgEzAQABzAJm
+ AQAB/wFmAZkBAAH/AWYBzAEAAcwBZgH/AQAB/wGZAgAB/wGZATMBAAH/AZkBZgEAAf8CmQEAAf8BmQHM
+ AQAB/wGZAf8BAAH/AcwCAAH/AcwBMwEAAf8BzAFmAQAB/wHMAZkBAAH/AswBAAH/AcwB/wEAAv8BMwEA
+ AcwB/wFmAQAC/wGZAQAC/wHMAQACZgH/AQABZgH/AWYBAAFmAv8BAAH/AmYBAAH/AWYB/wEAAv8BZgEA
+ ASEBAAGlAQADXwEAA3cBAAOGAQADlgEAA8sBAAOyAQAD1wEAA90BAAPjAQAD6gEAA/EBAAP4AQAB8AH7
+ Af8BAAGkAqABAAOAAwAB/wIAAf8DAAL/AQAB/wMAAf8BAAH/AQAC/wIAA/8BAAH/AfQBvAoHAbwB9AH/
+ MAAC/wEHCv8BBwL/MgABvAr/Abw0AAG8CP8B9AH/Abw0AAG8B/8C9AH/Abw0AAG8Bv8D9AH/Abw0AAG8
+ Bf8E9AH/Abw0AAG8BP8G9AG8NAAB8AP/BfQB8wH0AfA0AAHwAv8F9ALzAfQB8DQAAfAB/wX0AvMB8QH0
+ AfA0AAHwAf8E9ALzAvEB9AHwNAAB8AH/A/QC8wHxA/cBvDQAAfAB/wL0AvMC8QHvAf8B8AH0NAAB8QL/
+ BfQBBwHxAfQ1AAHzCPIB9DQAAUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8RAAHA
+ AQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHAAQMGAAHA
+ AQMGAAHAAQMGAAHAAQcGAAHAAQ8GAAs=
+</value>
+ </data>
</root>
\ No newline at end of file
Modified: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/CoordSysOverrideCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -28,11 +28,18 @@
namespace Maestro.Editors.FeatureSource
{
- public partial class CoordSysOverrideCtrl : CollapsiblePanel
+ public partial class CoordSysOverrideCtrl : CollapsiblePanel, IEditorBindable
{
public CoordSysOverrideCtrl()
{
InitializeComponent();
}
+
+ public void Bind(IEditorService service)
+ {
+
+ }
+
+ public event EventHandler ResourceChanged;
}
}
Modified: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -28,11 +28,18 @@
namespace Maestro.Editors.FeatureSource
{
- public partial class ExtensionsCtrl : CollapsiblePanel
+ public partial class ExtensionsCtrl : CollapsiblePanel, IEditorBindable
{
public ExtensionsCtrl()
{
InitializeComponent();
}
+
+ public void Bind(IEditorService service)
+ {
+
+ }
+
+ public event EventHandler ResourceChanged;
}
}
Modified: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.Designer.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -34,6 +34,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScroll = true;
this.Name = "FeatureSourceEditorCtrl";
this.Size = new System.Drawing.Size(657, 525);
this.ResumeLayout(false);
Modified: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/FeatureSourceEditorCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -24,14 +24,60 @@
using System.Data;
using System.Text;
using System.Windows.Forms;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using System.Diagnostics;
+using Maestro.Shared.UI;
+using Maestro.Editors.FeatureSource.Providers.Sdf;
+using Maestro.Editors.FeatureSource.Providers.Shp;
+using Maestro.Editors.FeatureSource.Providers;
namespace Maestro.Editors.FeatureSource
{
- public partial class FeatureSourceEditorCtrl : UserControl
+ public partial class FeatureSourceEditorCtrl : EditorBase
{
public FeatureSourceEditorCtrl()
{
InitializeComponent();
}
+
+ private FeatureSourceType _fs;
+
+ public override void Bind(IEditorService service)
+ {
+ _fs = service.GetEditedResource() as FeatureSourceType;
+ Debug.Assert(_fs != null);
+
+ CollapsiblePanel panel = ResolveTopPanel(_fs.Provider);
+ var b = panel as IEditorBindable;
+ if (b != null)
+ b.Bind(service);
+
+ panel.Dock = DockStyle.Top;
+
+ var ov = new CoordSysOverrideCtrl();
+ ov.Bind(service);
+
+ ov.Dock = DockStyle.Top;
+
+ var ext = new ExtensionsCtrl();
+ ext.Bind(service);
+
+ ext.Dock = DockStyle.Top;
+
+ this.Controls.Add(ext);
+ this.Controls.Add(ov);
+ this.Controls.Add(panel);
+ }
+
+ private static CollapsiblePanel ResolveTopPanel(string provider)
+ {
+ string name = provider.ToUpper();
+ if (name.StartsWith("OSGEO.SDF"))
+ return new SdfFileCtrl();
+ else if (name.StartsWith("OSGEO.SHP"))
+ return new ShpFileCtrl();
+ else //TODO: Add support for other providers
+ return new GenericCtrl();
+ }
}
}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.Designer.cs (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,153 @@
+namespace Maestro.Editors.FeatureSource.Providers
+{
+ partial class FileBasedCtrl
+ {
+ /// <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.components = new System.ComponentModel.Container();
+ this.rdManaged = new System.Windows.Forms.RadioButton();
+ this.rdUnmanaged = new System.Windows.Forms.RadioButton();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtAlias = new System.Windows.Forms.TextBox();
+ this.btnBrowseAlias = new System.Windows.Forms.Button();
+ this.tt = new System.Windows.Forms.ToolTip(this.components);
+ this.unmanagedPanel = new System.Windows.Forms.Panel();
+ this.resDataCtrl = new Maestro.Editors.Common.ResourceDataCtrl();
+ this.contentPanel.SuspendLayout();
+ this.unmanagedPanel.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // contentPanel
+ //
+ this.contentPanel.Controls.Add(this.unmanagedPanel);
+ this.contentPanel.Controls.Add(this.rdUnmanaged);
+ this.contentPanel.Controls.Add(this.rdManaged);
+ this.contentPanel.Controls.Add(this.resDataCtrl);
+ //
+ // rdManaged
+ //
+ this.rdManaged.AutoSize = true;
+ this.rdManaged.Checked = true;
+ this.rdManaged.Location = new System.Drawing.Point(19, 12);
+ this.rdManaged.Name = "rdManaged";
+ this.rdManaged.Size = new System.Drawing.Size(89, 17);
+ this.rdManaged.TabIndex = 3;
+ this.rdManaged.TabStop = true;
+ this.rdManaged.Text = "Managed File";
+ this.tt.SetToolTip(this.rdManaged, "Managed files exist inside the repository as Resource Data streams. Simply upload" +
+ " the file and mark it as the data file");
+ this.rdManaged.UseVisualStyleBackColor = true;
+ this.rdManaged.CheckedChanged += new System.EventHandler(this.rdManaged_CheckedChanged);
+ //
+ // rdUnmanaged
+ //
+ this.rdUnmanaged.AutoSize = true;
+ this.rdUnmanaged.Location = new System.Drawing.Point(19, 166);
+ this.rdUnmanaged.Name = "rdUnmanaged";
+ this.rdUnmanaged.Size = new System.Drawing.Size(102, 17);
+ this.rdUnmanaged.TabIndex = 4;
+ this.rdUnmanaged.Text = "Unmanaged File";
+ this.tt.SetToolTip(this.rdUnmanaged, "Unmanaged Files reside outside of the repository on the Server\'s file system");
+ this.rdUnmanaged.UseVisualStyleBackColor = true;
+ this.rdUnmanaged.CheckedChanged += new System.EventHandler(this.rdUnmanaged_CheckedChanged);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(3, 8);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(92, 13);
+ this.label1.TabIndex = 5;
+ this.label1.Text = "Folder or File Path";
+ //
+ // txtAlias
+ //
+ this.txtAlias.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtAlias.Location = new System.Drawing.Point(111, 5);
+ this.txtAlias.Name = "txtAlias";
+ this.txtAlias.Size = new System.Drawing.Size(256, 20);
+ this.txtAlias.TabIndex = 6;
+ //
+ // btnBrowseAlias
+ //
+ this.btnBrowseAlias.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBrowseAlias.Location = new System.Drawing.Point(373, 3);
+ this.btnBrowseAlias.Name = "btnBrowseAlias";
+ this.btnBrowseAlias.Size = new System.Drawing.Size(32, 23);
+ this.btnBrowseAlias.TabIndex = 7;
+ this.btnBrowseAlias.Text = "...";
+ this.btnBrowseAlias.UseVisualStyleBackColor = true;
+ //
+ // unmanagedPanel
+ //
+ this.unmanagedPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.unmanagedPanel.Controls.Add(this.label1);
+ this.unmanagedPanel.Controls.Add(this.btnBrowseAlias);
+ this.unmanagedPanel.Controls.Add(this.txtAlias);
+ this.unmanagedPanel.Location = new System.Drawing.Point(19, 189);
+ this.unmanagedPanel.Name = "unmanagedPanel";
+ this.unmanagedPanel.Size = new System.Drawing.Size(407, 30);
+ this.unmanagedPanel.TabIndex = 8;
+ //
+ // resDataCtrl
+ //
+ this.resDataCtrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.resDataCtrl.Location = new System.Drawing.Point(19, 35);
+ this.resDataCtrl.MarkedFile = "";
+ this.resDataCtrl.MarkEnabled = true;
+ this.resDataCtrl.Name = "resDataCtrl";
+ this.resDataCtrl.Size = new System.Drawing.Size(405, 124);
+ this.resDataCtrl.TabIndex = 2;
+ //
+ // FileBasedCtrl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Name = "FileBasedCtrl";
+ this.contentPanel.ResumeLayout(false);
+ this.contentPanel.PerformLayout();
+ this.unmanagedPanel.ResumeLayout(false);
+ this.unmanagedPanel.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.ToolTip tt;
+ private System.Windows.Forms.Panel unmanagedPanel;
+ protected Maestro.Editors.Common.ResourceDataCtrl resDataCtrl;
+ protected System.Windows.Forms.Button btnBrowseAlias;
+ protected System.Windows.Forms.TextBox txtAlias;
+ protected System.Windows.Forms.RadioButton rdUnmanaged;
+ protected System.Windows.Forms.RadioButton rdManaged;
+ }
+}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.cs (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,57 @@
+#region Disclaimer / License
+// Copyright (C) 2010, 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;
+using Maestro.Shared.UI;
+
+namespace Maestro.Editors.FeatureSource.Providers
+{
+ public partial class FileBasedCtrl : CollapsiblePanel, IEditorBindable
+ {
+ public FileBasedCtrl()
+ {
+ InitializeComponent();
+ }
+
+ private void rdManaged_CheckedChanged(object sender, EventArgs e)
+ {
+ unmanagedPanel.Enabled = false;
+ resDataCtrl.Enabled = true;
+ }
+
+ private void rdUnmanaged_CheckedChanged(object sender, EventArgs e)
+ {
+ unmanagedPanel.Enabled = true;
+ resDataCtrl.Enabled = false;
+ }
+
+ public virtual void Bind(IEditorService service)
+ {
+ resDataCtrl.Init(service);
+ }
+
+ public event EventHandler ResourceChanged;
+ }
+}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.resx (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/FileBasedCtrl.resx 2010-05-21 10:38:46 UTC (rev 4920)
@@ -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="tt.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-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.Designer.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -33,14 +33,22 @@
this.grdConnectionParameters = new System.Windows.Forms.DataGridView();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
+ this.btnEditConfiguration = new System.Windows.Forms.Button();
+ this.label4 = new System.Windows.Forms.Label();
+ this.cmbLongTransaction = new System.Windows.Forms.ComboBox();
+ this.btnTest = new System.Windows.Forms.Button();
+ this.txtTestResult = new System.Windows.Forms.TextBox();
this.resDataCtrl = new Maestro.Editors.Common.ResourceDataCtrl();
- this.btnEditConfiguration = new System.Windows.Forms.Button();
this.contentPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.grdConnectionParameters)).BeginInit();
this.SuspendLayout();
//
// contentPanel
//
+ this.contentPanel.Controls.Add(this.txtTestResult);
+ this.contentPanel.Controls.Add(this.btnTest);
+ this.contentPanel.Controls.Add(this.cmbLongTransaction);
+ this.contentPanel.Controls.Add(this.label4);
this.contentPanel.Controls.Add(this.btnEditConfiguration);
this.contentPanel.Controls.Add(this.resDataCtrl);
this.contentPanel.Controls.Add(this.label3);
@@ -71,11 +79,14 @@
//
// grdConnectionParameters
//
+ this.grdConnectionParameters.AllowUserToAddRows = false;
+ this.grdConnectionParameters.AllowUserToDeleteRows = false;
this.grdConnectionParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.grdConnectionParameters.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grdConnectionParameters.Location = new System.Drawing.Point(16, 62);
this.grdConnectionParameters.Name = "grdConnectionParameters";
+ this.grdConnectionParameters.RowHeadersVisible = false;
this.grdConnectionParameters.Size = new System.Drawing.Size(654, 85);
this.grdConnectionParameters.TabIndex = 2;
this.grdConnectionParameters.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.grdConnectionParameters_CellPainting);
@@ -99,31 +110,77 @@
this.label3.TabIndex = 4;
this.label3.Text = "Resource Data Files";
//
+ // btnEditConfiguration
+ //
+ this.btnEditConfiguration.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnEditConfiguration.Location = new System.Drawing.Point(517, 336);
+ this.btnEditConfiguration.Name = "btnEditConfiguration";
+ this.btnEditConfiguration.Size = new System.Drawing.Size(153, 23);
+ this.btnEditConfiguration.TabIndex = 6;
+ this.btnEditConfiguration.Text = "Edit Configuration";
+ this.btnEditConfiguration.UseVisualStyleBackColor = true;
+ this.btnEditConfiguration.Click += new System.EventHandler(this.btnEditConfiguration_Click);
+ //
+ // label4
+ //
+ this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(14, 291);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(123, 13);
+ this.label4.TabIndex = 7;
+ this.label4.Text = "Active Long Transaction";
+ //
+ // cmbLongTransaction
+ //
+ this.cmbLongTransaction.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.cmbLongTransaction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbLongTransaction.FormattingEnabled = true;
+ this.cmbLongTransaction.Location = new System.Drawing.Point(154, 288);
+ this.cmbLongTransaction.Name = "cmbLongTransaction";
+ this.cmbLongTransaction.Size = new System.Drawing.Size(516, 21);
+ this.cmbLongTransaction.TabIndex = 8;
+ //
+ // btnTest
+ //
+ this.btnTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.btnTest.Location = new System.Drawing.Point(17, 336);
+ this.btnTest.Name = "btnTest";
+ this.btnTest.Size = new System.Drawing.Size(133, 23);
+ this.btnTest.TabIndex = 9;
+ this.btnTest.Text = "Test Connection";
+ this.btnTest.UseVisualStyleBackColor = true;
+ this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
+ //
+ // txtTestResult
+ //
+ this.txtTestResult.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtTestResult.Location = new System.Drawing.Point(156, 326);
+ this.txtTestResult.Multiline = true;
+ this.txtTestResult.Name = "txtTestResult";
+ this.txtTestResult.ReadOnly = true;
+ this.txtTestResult.Size = new System.Drawing.Size(355, 33);
+ this.txtTestResult.TabIndex = 10;
+ //
// resDataCtrl
//
this.resDataCtrl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.resDataCtrl.Location = new System.Drawing.Point(16, 175);
+ this.resDataCtrl.MarkedFile = "";
+ this.resDataCtrl.MarkEnabled = true;
this.resDataCtrl.Name = "resDataCtrl";
- this.resDataCtrl.Size = new System.Drawing.Size(654, 147);
+ this.resDataCtrl.Size = new System.Drawing.Size(654, 102);
this.resDataCtrl.TabIndex = 5;
//
- // btnEditConfiguration
- //
- this.btnEditConfiguration.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.btnEditConfiguration.Location = new System.Drawing.Point(16, 337);
- this.btnEditConfiguration.Name = "btnEditConfiguration";
- this.btnEditConfiguration.Size = new System.Drawing.Size(153, 23);
- this.btnEditConfiguration.TabIndex = 6;
- this.btnEditConfiguration.Text = "Edit Configuration Document";
- this.btnEditConfiguration.UseVisualStyleBackColor = true;
- //
// GenericCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.HeaderText = "Connection Settings (Generic)";
+ this.HeaderText = "Feature Source (using Generic Editor)";
this.Name = "GenericCtrl";
this.Size = new System.Drawing.Size(683, 399);
this.contentPanel.ResumeLayout(false);
@@ -142,5 +199,9 @@
private System.Windows.Forms.Label label1;
private Maestro.Editors.Common.ResourceDataCtrl resDataCtrl;
private System.Windows.Forms.Button btnEditConfiguration;
+ private System.Windows.Forms.TextBox txtTestResult;
+ private System.Windows.Forms.Button btnTest;
+ private System.Windows.Forms.ComboBox cmbLongTransaction;
+ private System.Windows.Forms.Label label4;
}
}
Modified: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/GenericCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -26,29 +26,89 @@
using System.Windows.Forms;
using Maestro.Shared.UI;
using OSGeo.MapGuide.MaestroAPI.Services;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using System.Diagnostics;
+using System.Collections.Specialized;
namespace Maestro.Editors.FeatureSource.Providers
{
- public partial class GenericCtrl : CollapsiblePanel
+ public partial class GenericCtrl : CollapsiblePanel, IEditorBindable
{
- private GenericCtrl()
+ internal GenericCtrl()
{
InitializeComponent();
}
- public GenericCtrl(string provider, string featureSourceID, IFeatureService featSvc)
- : this()
+ private FeatureSourceType _fs;
+ private IEditorService _service;
+
+ public void Bind(IEditorService service)
{
- var prov = featSvc.GetFeatureProvider(provider);
+ _service = service;
+ _fs = _service.GetEditedResource() as FeatureSourceType;
+ txtProvider.Text = _fs.Provider;
+
+ Debug.Assert(_fs != null);
+ resDataCtrl.DataListChanged += (sender, e) => { OnResourceChanged(); };
+ InitGrid();
+ InitEnumerableProperties();
+ }
+
+ private void InitEnumerableProperties()
+ {
+ string provider = txtProvider.Text;
+ string ps = GetPartialConnectionString();
+
+ foreach (var cell in _enumCells)
+ {
+ string[] values = _service.FeatureService.GetConnectionPropertyValues(provider, cell.Key, ps);
+ var val = _fs.GetConnectionProperty(cell.Key);
+
+ cell.Value.DataSource = values;
+ if (Array.IndexOf(values, val) >= 0)
+ cell.Value.Value = val;
+ }
+ }
+
+ private string GetPartialConnectionString()
+ {
+ List<string> values = new List<string>();
+ foreach (DataGridViewRow row in grdConnectionParameters.Rows)
+ {
+ if (row.Cells[0].Value != null && row.Cells[1].Value != null)
+ {
+ values.Add(string.Format("{0}={1}",
+ row.Cells[0].Value,
+ row.Cells[1].Value));
+ }
+ }
+ return string.Join(";", values.ToArray());
+ }
+
+ private void OnResourceChanged()
+ {
+ var handler = this.ResourceChanged;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
+ }
+
+ private Dictionary<string, DataGridViewComboBoxCell> _enumCells = new Dictionary<string, DataGridViewComboBoxCell>();
+
+ private void InitGrid()
+ {
+ var prov = _service.FeatureService.GetFeatureProvider(_fs.Provider);
+
var colName = new DataGridViewColumn();
colName.Name = "COL_NAME";
colName.HeaderText = "Name"; //LOCALIZE
colName.ReadOnly = true;
+ colName.CellTemplate = new DataGridViewTextBoxCell();
var colValue = new DataGridViewColumn();
colValue.Name = "COL_VALUE";
colValue.HeaderText = "Value"; //LOCALIZE
colValue.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
+ colValue.CellTemplate = new DataGridViewTextBoxCell();
grdConnectionParameters.Columns.Add(colName);
grdConnectionParameters.Columns.Add(colValue);
@@ -57,19 +117,21 @@
{
var row = new DataGridViewRow();
var nameCell = new DataGridViewTextBoxCell();
- nameCell.Value = p.LocalizedName;
+ nameCell.Value = p.Name;
+ nameCell.ToolTipText = p.LocalizedName;
DataGridViewCell valueCell = null;
if (p.Enumerable)
{
var cell = new DataGridViewComboBoxCell();
cell.DataSource = p.Value;
-
valueCell = cell;
+ _enumCells.Add(p.Name, cell);
}
else
{
valueCell = new DataGridViewTextBoxCell();
+ valueCell.Value = _fs.GetConnectionProperty(p.Name);
}
if (!string.IsNullOrEmpty(p.DefaultValue))
@@ -85,6 +147,8 @@
}
}
+ public event EventHandler ResourceChanged;
+
private List<DataGridViewCell> pwdCells = new List<DataGridViewCell>();
private bool IsPasswordCell(DataGridViewCell cell)
@@ -119,14 +183,40 @@
}
}
}
- }
- internal interface IGenericConnectionView
- {
+ private NameValueCollection GetConnectionParameters()
+ {
+ var nvc = new NameValueCollection();
- }
+ foreach (DataGridViewRow row in grdConnectionParameters.Rows)
+ {
+ if (row.Cells[1].Value != null)
+ {
+ nvc.Add(row.Cells[0].Value.ToString(), row.Cells[1].Value.ToString());
+ }
+ }
- internal class GenericConnectionPresenter
- {
+ return nvc;
+ }
+
+
+ private void btnTest_Click(object sender, EventArgs e)
+ {
+ txtTestResult.Text = string.Empty;
+
+ string msg = _service.FeatureService.TestConnection(
+ txtProvider.Text,
+ GetConnectionParameters());
+
+ if (string.IsNullOrEmpty(msg))
+ msg = Properties.Resources.TestConnectionNoErrors;
+
+ txtTestResult.Text = msg;
+ }
+
+ private void btnEditConfiguration_Click(object sender, EventArgs e)
+ {
+
+ }
}
}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.Designer.cs (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,67 @@
+namespace Maestro.Editors.FeatureSource.Providers.Sdf
+{
+ partial class SdfFileCtrl
+ {
+ /// <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.chkReadOnly = new System.Windows.Forms.CheckBox();
+ this.contentPanel.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // contentPanel
+ //
+ this.contentPanel.Controls.Add(this.chkReadOnly);
+ this.contentPanel.Controls.SetChildIndex(this.chkReadOnly, 0);
+ //
+ // chkReadOnly
+ //
+ this.chkReadOnly.AutoSize = true;
+ this.chkReadOnly.Location = new System.Drawing.Point(19, 240);
+ this.chkReadOnly.Name = "chkReadOnly";
+ this.chkReadOnly.Size = new System.Drawing.Size(162, 17);
+ this.chkReadOnly.TabIndex = 8;
+ this.chkReadOnly.Text = "Feature Source is Read-Only";
+ this.chkReadOnly.UseVisualStyleBackColor = true;
+ this.chkReadOnly.CheckedChanged += new System.EventHandler(this.chkReadOnly_CheckedChanged);
+ //
+ // SdfFileCtrl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.HeaderText = "SDF Feature Source";
+ this.Name = "SdfFileCtrl";
+ this.contentPanel.ResumeLayout(false);
+ this.contentPanel.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.CheckBox chkReadOnly;
+ }
+}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.cs (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,69 @@
+#region Disclaimer / License
+// Copyright (C) 2010, 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;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using System.Diagnostics;
+
+namespace Maestro.Editors.FeatureSource.Providers.Sdf
+{
+ public partial class SdfFileCtrl : FileBasedCtrl
+ {
+ public SdfFileCtrl()
+ {
+ InitializeComponent();
+ }
+
+ private FeatureSourceType _fs;
+
+ public override void Bind(IEditorService service)
+ {
+ base.Bind(service);
+ _fs = service.GetEditedResource() as FeatureSourceType;
+ Debug.Assert(_fs != null);
+
+ var file = _fs.GetConnectionProperty("File");
+ if (!string.IsNullOrEmpty(file))
+ {
+ if (file.Contains("%MG_DATA_FILE_PATH%"))
+ {
+ rdManaged.Checked = true;
+ var df = file.Substring("%MG_DATA_FILE_PATH%".Length);
+ resDataCtrl.MarkedFile = df;
+ }
+ else
+ {
+ rdUnmanaged.Checked = true;
+ txtAlias.Text = file;
+ }
+ }
+ }
+
+ private void chkReadOnly_CheckedChanged(object sender, EventArgs e)
+ {
+ _fs.SetConnectionProperty("ReadOnly", chkReadOnly.Checked.ToString().ToUpper());
+ }
+ }
+}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.resx (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Sdf/SdfFileCtrl.resx 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,120 @@
+<?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>
+</root>
\ No newline at end of file
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.Designer.cs (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,45 @@
+namespace Maestro.Editors.FeatureSource.Providers.Shp
+{
+ partial class ShpFileCtrl
+ {
+ /// <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.SuspendLayout();
+ //
+ // ShpFileCtrl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.HeaderText = "SHP Feature Source";
+ this.Name = "ShpFileCtrl";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.cs (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,37 @@
+#region Disclaimer / License
+// Copyright (C) 2010, 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.Editors.FeatureSource.Providers.Shp
+{
+ public partial class ShpFileCtrl : FileBasedCtrl
+ {
+ public ShpFileCtrl()
+ {
+ InitializeComponent();
+ }
+ }
+}
Added: sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.resx (rev 0)
+++ sandbox/maestro-2.5/Maestro.Editors/FeatureSource/Providers/Shp/ShpFileCtrl.resx 2010-05-21 10:38:46 UTC (rev 4920)
@@ -0,0 +1,120 @@
+<?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>
+</root>
\ No newline at end of file
Modified: sandbox/maestro-2.5/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/Maestro.Editors.csproj 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/Maestro.Editors.csproj 2010-05-21 10:38:46 UTC (rev 4920)
@@ -164,12 +164,30 @@
<Compile Include="FeatureSource\Preview\StandardQueryCtrl.Designer.cs">
<DependentUpon>StandardQueryCtrl.cs</DependentUpon>
</Compile>
+ <Compile Include="FeatureSource\Providers\FileBasedCtrl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="FeatureSource\Providers\FileBasedCtrl.Designer.cs">
+ <DependentUpon>FileBasedCtrl.cs</DependentUpon>
+ </Compile>
<Compile Include="FeatureSource\Providers\GenericCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="FeatureSource\Providers\GenericCtrl.Designer.cs">
<DependentUpon>GenericCtrl.cs</DependentUpon>
</Compile>
+ <Compile Include="FeatureSource\Providers\Sdf\SdfFileCtrl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="FeatureSource\Providers\Sdf\SdfFileCtrl.Designer.cs">
+ <DependentUpon>SdfFileCtrl.cs</DependentUpon>
+ </Compile>
+ <Compile Include="FeatureSource\Providers\Shp\ShpFileCtrl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="FeatureSource\Providers\Shp\ShpFileCtrl.Designer.cs">
+ <DependentUpon>ShpFileCtrl.cs</DependentUpon>
+ </Compile>
<Compile Include="Generic\ResourceDataPanel.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -451,9 +469,18 @@
<DependentUpon>StandardQueryCtrl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="FeatureSource\Providers\FileBasedCtrl.resx">
+ <DependentUpon>FileBasedCtrl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="FeatureSource\Providers\GenericCtrl.resx">
<DependentUpon>GenericCtrl.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="FeatureSource\Providers\Sdf\SdfFileCtrl.resx">
+ <DependentUpon>SdfFileCtrl.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="FeatureSource\Providers\Shp\ShpFileCtrl.resx">
+ <DependentUpon>ShpFileCtrl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Generic\ResourceDataPanel.resx">
<DependentUpon>ResourceDataPanel.cs</DependentUpon>
<SubType>Designer</SubType>
@@ -737,6 +764,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="DrawingSource\Preview\" />
+ <Folder Include="FeatureSource\Providers\Rdbms\" />
<Folder Include="LayerDefinition\Drawing\" />
<Folder Include="LayerDefinition\Geometry\" />
<Folder Include="LayerDefinition\Raster\" />
Modified: sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.Designer.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.Designer.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -424,6 +424,15 @@
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Provider reported no errors.
+ /// </summary>
+ internal static string TestConnectionNoErrors {
+ get {
+ return ResourceManager.GetString("TestConnectionNoErrors", resourceCulture);
+ }
+ }
+
internal static System.Drawing.Bitmap tick {
get {
object obj = ResourceManager.GetObject("tick", resourceCulture);
Modified: sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.resx 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/Maestro.Editors/Properties/Resources.resx 2010-05-21 10:38:46 UTC (rev 4920)
@@ -285,4 +285,7 @@
<data name="FileDownloaded" xml:space="preserve">
<value>File Downloaded</value>
</data>
+ <data name="TestConnectionNoErrors" xml:space="preserve">
+ <value>Provider reported no errors</value>
+ </data>
</root>
\ No newline at end of file
Modified: sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs
===================================================================
--- sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs 2010-05-21 08:22:46 UTC (rev 4919)
+++ sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs 2010-05-21 10:38:46 UTC (rev 4920)
@@ -95,5 +95,70 @@
{
get { return true; }
}
+
+ public string GetConnectionProperty(string name)
+ {
+ foreach (var p in this.Parameter)
+ {
+ if (p.Name == name)
+ {
+ return p.Value;
+ }
+ }
+ return string.Empty;
+ }
+
+ public void SetConnectionProperty(string name, string value)
+ {
+ NameValuePairType pr = null;
+ foreach (var p in this.Parameter)
+ {
+ if (p.Name == name)
+ {
+ pr = p;
+ break;
+ }
+ }
+
+ if (pr != null)
+ {
+ pr.Value = value;
+ }
+ else
+ {
+ this.Parameter.Add(new NameValuePairType() { Name = name, Value = value });
+ }
+ OnPropertyChanged("Parameter");
+ }
+
+ [XmlIgnore]
+ public string ConnectionString
+ {
+ get
+ {
+ List<string> values = new List<string>();
+ foreach (var p in this.Parameter)
+ {
+ values.Add(p.Name + "=" + p.Value);
+ }
+ return string.Join(";", values.ToArray());
+ }
+ set
+ {
+ if (value == null)
+ throw new ArgumentNullException("value");
+
+ this.Parameter.Clear();
+ string[] tokens = value.Split(';');
+ foreach (var tok in tokens)
+ {
+ string[] values = tok.Split('=');
+ if (values.Length == 2)
+ {
+ this.Parameter.Add(new NameValuePairType() { Name = values[0], Value = values[1] });
+ }
+ }
+ }
+ }
}
}
More information about the mapguide-commits
mailing list