[mapguide-commits] r5306 - in sandbox/maestro-3.0:
Maestro.Base/Editor Maestro.Base/Properties
Maestro.Base/Templates Maestro.Editors Maestro.Editors/FeatureSource
Maestro.Editors/FeatureSource/Extensions Maestro.Editors/Properties
OSGeo.MapGuide.MaestroAPI/ObjectModels
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Oct 20 10:50:30 EDT 2010
Author: jng
Date: 2010-10-20 07:50:30 -0700 (Wed, 20 Oct 2010)
New Revision: 5306
Added:
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.resx
Modified:
sandbox/maestro-3.0/Maestro.Base/Editor/LayerDefinitionEditor.cs
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/Templates/RasterLayerDefinitionItemTemplate.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.resx
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs
Log:
3.0 sandbox changes:
- Fix the broken join editor. The lesson learned here is: Chained comboboxes + databinding = trouble!
- Fix non-functional delete button in Feature Source Extensions editor
- Disable raster layer template creation as raster support is yet to be ported over from 2.x
Modified: sandbox/maestro-3.0/Maestro.Base/Editor/LayerDefinitionEditor.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Editor/LayerDefinitionEditor.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Base/Editor/LayerDefinitionEditor.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -76,7 +76,7 @@
}
else
{
- throw new NotSupportedException("Could not determine the sub-layer type"); //LOCALIZE
+ throw new NotSupportedException(Properties.Resources.LayerSubTypeNotSupported);
}
}
}
Modified: sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -590,6 +590,15 @@
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Could not determine the sub-layer type or this type is not currently supported.
+ /// </summary>
+ internal static string LayerSubTypeNotSupported {
+ get {
+ return ResourceManager.GetString("LayerSubTypeNotSupported", resourceCulture);
+ }
+ }
+
internal static System.Drawing.Bitmap loading {
get {
object obj = ResourceManager.GetObject("loading", resourceCulture);
Modified: sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx 2010-10-20 14:50:30 UTC (rev 5306)
@@ -724,4 +724,7 @@
<data name="XmlResHandlerAction" xml:space="preserve">
<value>Load this resource into the Site Repository</value>
</data>
+ <data name="LayerSubTypeNotSupported" xml:space="preserve">
+ <value>Could not determine the sub-layer type or this type is not currently supported</value>
+ </data>
</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -38,6 +38,15 @@
ResourceType = ResourceTypes.LayerDefinition.ToString();
}
+ //temp disable as raster support is still being ported from 2.x
+ public override Version MinimumSiteVersion
+ {
+ get
+ {
+ return new Version(99, 0);
+ }
+ }
+
public override IResource CreateItem(IServerConnection conn)
{
return ObjectFactory.CreateDefaultLayer(conn, OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerType.Raster, new Version(1, 0, 0));
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.Designer.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.Designer.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -34,7 +34,6 @@
this.txtFeatureSource = new System.Windows.Forms.TextBox();
this.btnBrowse = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
- this.cmbFeatureClass = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.rdAssociation = new System.Windows.Forms.RadioButton();
this.rdInner = new System.Windows.Forms.RadioButton();
@@ -42,17 +41,17 @@
this.rdLeftOuter = new System.Windows.Forms.RadioButton();
this.chkForceOneToOne = new System.Windows.Forms.CheckBox();
this.grdJoinKeys = new System.Windows.Forms.DataGridView();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.lnkDelete = new System.Windows.Forms.LinkLabel();
- this.lnkAdd = new System.Windows.Forms.LinkLabel();
- this.cmbSecondary = new System.Windows.Forms.ComboBox();
- this.cmbPrimary = new System.Windows.Forms.ComboBox();
- this.label6 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
this.COL_PRIMARY = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.COL_SECONDARY = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.btnAddKey = new System.Windows.Forms.ToolStripButton();
+ this.btnDeleteKey = new System.Windows.Forms.ToolStripButton();
+ this.btnBrowseSecondaryClass = new System.Windows.Forms.Button();
+ this.txtSecondaryClass = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.grdJoinKeys)).BeginInit();
this.groupBox1.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// label1
@@ -112,24 +111,10 @@
this.label3.TabIndex = 5;
this.label3.Text = "Feature Class";
//
- // cmbFeatureClass
- //
- this.cmbFeatureClass.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.cmbFeatureClass.DisplayMember = "Fullname";
- this.cmbFeatureClass.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbFeatureClass.FormattingEnabled = true;
- this.cmbFeatureClass.Location = new System.Drawing.Point(144, 65);
- this.cmbFeatureClass.Name = "cmbFeatureClass";
- this.cmbFeatureClass.Size = new System.Drawing.Size(296, 21);
- this.cmbFeatureClass.TabIndex = 6;
- this.cmbFeatureClass.ValueMember = "Fullname";
- this.cmbFeatureClass.SelectionChangeCommitted += new System.EventHandler(this.cmbFeatureClass_SelectedIndexChanged);
- //
// label4
//
this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(7, 99);
+ this.label4.Location = new System.Drawing.Point(7, 98);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 13);
this.label4.TabIndex = 7;
@@ -138,7 +123,7 @@
// rdAssociation
//
this.rdAssociation.Image = global::Maestro.Editors.Properties.Resources.databases_relation;
- this.rdAssociation.Location = new System.Drawing.Point(243, 115);
+ this.rdAssociation.Location = new System.Drawing.Point(243, 114);
this.rdAssociation.Name = "rdAssociation";
this.rdAssociation.Size = new System.Drawing.Size(105, 24);
this.rdAssociation.TabIndex = 11;
@@ -151,7 +136,7 @@
// rdInner
//
this.rdInner.Image = global::Maestro.Editors.Properties.Resources.sql_join_inner;
- this.rdInner.Location = new System.Drawing.Point(144, 115);
+ this.rdInner.Location = new System.Drawing.Point(144, 114);
this.rdInner.Name = "rdInner";
this.rdInner.Size = new System.Drawing.Size(75, 24);
this.rdInner.TabIndex = 10;
@@ -164,7 +149,7 @@
// rdRightOuter
//
this.rdRightOuter.Image = global::Maestro.Editors.Properties.Resources.sql_join_right;
- this.rdRightOuter.Location = new System.Drawing.Point(243, 92);
+ this.rdRightOuter.Location = new System.Drawing.Point(243, 91);
this.rdRightOuter.Name = "rdRightOuter";
this.rdRightOuter.Size = new System.Drawing.Size(105, 24);
this.rdRightOuter.TabIndex = 9;
@@ -178,7 +163,7 @@
//
this.rdLeftOuter.Checked = true;
this.rdLeftOuter.Image = global::Maestro.Editors.Properties.Resources.sql_join_left;
- this.rdLeftOuter.Location = new System.Drawing.Point(144, 92);
+ this.rdLeftOuter.Location = new System.Drawing.Point(144, 91);
this.rdLeftOuter.Name = "rdLeftOuter";
this.rdLeftOuter.Size = new System.Drawing.Size(98, 24);
this.rdLeftOuter.TabIndex = 8;
@@ -191,7 +176,7 @@
// chkForceOneToOne
//
this.chkForceOneToOne.AutoSize = true;
- this.chkForceOneToOne.Location = new System.Drawing.Point(10, 122);
+ this.chkForceOneToOne.Location = new System.Drawing.Point(10, 121);
this.chkForceOneToOne.Name = "chkForceOneToOne";
this.chkForceOneToOne.Size = new System.Drawing.Size(83, 17);
this.chkForceOneToOne.TabIndex = 12;
@@ -202,124 +187,108 @@
//
this.grdJoinKeys.AllowUserToAddRows = false;
this.grdJoinKeys.AllowUserToDeleteRows = false;
- this.grdJoinKeys.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.grdJoinKeys.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grdJoinKeys.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.COL_PRIMARY,
this.COL_SECONDARY});
- this.grdJoinKeys.Location = new System.Drawing.Point(6, 76);
+ this.grdJoinKeys.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.grdJoinKeys.Location = new System.Drawing.Point(3, 41);
this.grdJoinKeys.Name = "grdJoinKeys";
this.grdJoinKeys.ReadOnly = true;
- this.grdJoinKeys.Size = new System.Drawing.Size(418, 138);
+ this.grdJoinKeys.Size = new System.Drawing.Size(424, 177);
this.grdJoinKeys.TabIndex = 14;
this.grdJoinKeys.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdJoinKeys_CellClick);
this.grdJoinKeys.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdJoinKeys_CellClick);
//
+ // COL_PRIMARY
+ //
+ this.COL_PRIMARY.DataPropertyName = "FeatureClassProperty";
+ this.COL_PRIMARY.HeaderText = "Primary";
+ this.COL_PRIMARY.Name = "COL_PRIMARY";
+ this.COL_PRIMARY.ReadOnly = true;
+ this.COL_PRIMARY.Width = 130;
+ //
+ // COL_SECONDARY
+ //
+ this.COL_SECONDARY.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.COL_SECONDARY.DataPropertyName = "AttributeClassProperty";
+ this.COL_SECONDARY.HeaderText = "Secondary";
+ this.COL_SECONDARY.Name = "COL_SECONDARY";
+ this.COL_SECONDARY.ReadOnly = true;
+ //
// groupBox1
//
this.groupBox1.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.groupBox1.Controls.Add(this.lnkDelete);
- this.groupBox1.Controls.Add(this.lnkAdd);
- this.groupBox1.Controls.Add(this.cmbSecondary);
- this.groupBox1.Controls.Add(this.cmbPrimary);
- this.groupBox1.Controls.Add(this.label6);
- this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.grdJoinKeys);
- this.groupBox1.Location = new System.Drawing.Point(10, 145);
+ this.groupBox1.Controls.Add(this.toolStrip1);
+ this.groupBox1.Location = new System.Drawing.Point(10, 144);
this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(430, 220);
+ this.groupBox1.Size = new System.Drawing.Size(430, 221);
this.groupBox1.TabIndex = 15;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Join Properties (Must specify at least one)";
//
- // lnkDelete
+ // toolStrip1
//
- this.lnkDelete.BackColor = System.Drawing.Color.Transparent;
- this.lnkDelete.Enabled = false;
- this.lnkDelete.Location = new System.Drawing.Point(61, 49);
- this.lnkDelete.Name = "lnkDelete";
- this.lnkDelete.Size = new System.Drawing.Size(60, 13);
- this.lnkDelete.TabIndex = 20;
- this.lnkDelete.TabStop = true;
- this.lnkDelete.Text = "Delete Pair";
- this.lnkDelete.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkDelete_LinkClicked);
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.btnAddKey,
+ this.btnDeleteKey});
+ this.toolStrip1.Location = new System.Drawing.Point(3, 16);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.Size = new System.Drawing.Size(424, 25);
+ this.toolStrip1.TabIndex = 15;
+ this.toolStrip1.Text = "toolStrip1";
//
- // lnkAdd
+ // btnAddKey
//
- this.lnkAdd.BackColor = System.Drawing.Color.Transparent;
- this.lnkAdd.Enabled = false;
- this.lnkAdd.Location = new System.Drawing.Point(7, 49);
- this.lnkAdd.Name = "lnkAdd";
- this.lnkAdd.Size = new System.Drawing.Size(48, 13);
- this.lnkAdd.TabIndex = 19;
- this.lnkAdd.TabStop = true;
- this.lnkAdd.Text = "Add Pair";
- this.lnkAdd.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkAdd_LinkClicked);
+ this.btnAddKey.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.btnAddKey.Image = global::Maestro.Editors.Properties.Resources.plus_circle;
+ this.btnAddKey.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.btnAddKey.Name = "btnAddKey";
+ this.btnAddKey.Size = new System.Drawing.Size(23, 22);
+ this.btnAddKey.ToolTipText = "Add a new property join";
+ this.btnAddKey.Click += new System.EventHandler(this.btnAddKey_Click);
//
- // cmbSecondary
+ // btnDeleteKey
//
- this.cmbSecondary.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.cmbSecondary.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbSecondary.FormattingEnabled = true;
- this.cmbSecondary.Location = new System.Drawing.Point(311, 17);
- this.cmbSecondary.Name = "cmbSecondary";
- this.cmbSecondary.Size = new System.Drawing.Size(113, 21);
- this.cmbSecondary.TabIndex = 18;
- this.cmbSecondary.SelectedIndexChanged += new System.EventHandler(this.CheckAddStatus);
+ this.btnDeleteKey.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.btnDeleteKey.Enabled = false;
+ this.btnDeleteKey.Image = global::Maestro.Editors.Properties.Resources.cross_script;
+ this.btnDeleteKey.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.btnDeleteKey.Name = "btnDeleteKey";
+ this.btnDeleteKey.Size = new System.Drawing.Size(23, 22);
+ this.btnDeleteKey.ToolTipText = "Delete the selected property join";
+ this.btnDeleteKey.Click += new System.EventHandler(this.btnDeleteKey_Click);
//
- // cmbPrimary
+ // btnBrowseSecondaryClass
//
- this.cmbPrimary.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbPrimary.FormattingEnabled = true;
- this.cmbPrimary.Location = new System.Drawing.Point(95, 17);
- this.cmbPrimary.Name = "cmbPrimary";
- this.cmbPrimary.Size = new System.Drawing.Size(104, 21);
- this.cmbPrimary.TabIndex = 17;
- this.cmbPrimary.SelectedIndexChanged += new System.EventHandler(this.CheckAddStatus);
+ this.btnBrowseSecondaryClass.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBrowseSecondaryClass.Location = new System.Drawing.Point(413, 63);
+ this.btnBrowseSecondaryClass.Name = "btnBrowseSecondaryClass";
+ this.btnBrowseSecondaryClass.Size = new System.Drawing.Size(27, 23);
+ this.btnBrowseSecondaryClass.TabIndex = 17;
+ this.btnBrowseSecondaryClass.Text = "...";
+ this.btnBrowseSecondaryClass.UseVisualStyleBackColor = true;
+ this.btnBrowseSecondaryClass.Click += new System.EventHandler(this.btnBrowseSecondaryClass_Click);
//
- // label6
+ // txtSecondaryClass
//
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(205, 20);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(100, 13);
- this.label6.TabIndex = 16;
- this.label6.Text = "Secondary Property";
+ this.txtSecondaryClass.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtSecondaryClass.Location = new System.Drawing.Point(144, 65);
+ this.txtSecondaryClass.Name = "txtSecondaryClass";
+ this.txtSecondaryClass.ReadOnly = true;
+ this.txtSecondaryClass.Size = new System.Drawing.Size(263, 20);
+ this.txtSecondaryClass.TabIndex = 16;
//
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(6, 20);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(83, 13);
- this.label5.TabIndex = 15;
- this.label5.Text = "Primary Property";
- //
- // COL_PRIMARY
- //
- this.COL_PRIMARY.DataPropertyName = "FeatureClassProperty";
- this.COL_PRIMARY.HeaderText = "Primary";
- this.COL_PRIMARY.Name = "COL_PRIMARY";
- this.COL_PRIMARY.ReadOnly = true;
- this.COL_PRIMARY.Width = 130;
- //
- // COL_SECONDARY
- //
- this.COL_SECONDARY.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.COL_SECONDARY.DataPropertyName = "AttributeClassProperty";
- this.COL_SECONDARY.HeaderText = "Secondary";
- this.COL_SECONDARY.Name = "COL_SECONDARY";
- this.COL_SECONDARY.ReadOnly = true;
- //
// JoinSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.btnBrowseSecondaryClass);
+ this.Controls.Add(this.txtSecondaryClass);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.chkForceOneToOne);
this.Controls.Add(this.rdAssociation);
@@ -327,7 +296,6 @@
this.Controls.Add(this.rdRightOuter);
this.Controls.Add(this.rdLeftOuter);
this.Controls.Add(this.label4);
- this.Controls.Add(this.cmbFeatureClass);
this.Controls.Add(this.label3);
this.Controls.Add(this.btnBrowse);
this.Controls.Add(this.txtFeatureSource);
@@ -339,6 +307,8 @@
((System.ComponentModel.ISupportInitialize)(this.grdJoinKeys)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -352,7 +322,6 @@
private System.Windows.Forms.TextBox txtFeatureSource;
private System.Windows.Forms.Button btnBrowse;
private System.Windows.Forms.Label label3;
- private System.Windows.Forms.ComboBox cmbFeatureClass;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.RadioButton rdLeftOuter;
private System.Windows.Forms.RadioButton rdRightOuter;
@@ -361,13 +330,12 @@
private System.Windows.Forms.CheckBox chkForceOneToOne;
private System.Windows.Forms.DataGridView grdJoinKeys;
private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.LinkLabel lnkDelete;
- private System.Windows.Forms.LinkLabel lnkAdd;
- private System.Windows.Forms.ComboBox cmbSecondary;
- private System.Windows.Forms.ComboBox cmbPrimary;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label5;
private System.Windows.Forms.DataGridViewTextBoxColumn COL_PRIMARY;
private System.Windows.Forms.DataGridViewTextBoxColumn COL_SECONDARY;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton btnAddKey;
+ private System.Windows.Forms.ToolStripButton btnDeleteKey;
+ private System.Windows.Forms.Button btnBrowseSecondaryClass;
+ private System.Windows.Forms.TextBox txtSecondaryClass;
}
}
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -28,6 +28,7 @@
using Maestro.Shared.UI;
using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI;
+using Maestro.Editors.Common;
namespace Maestro.Editors.FeatureSource.Extensions
{
@@ -36,47 +37,43 @@
private JoinSettings()
{
InitializeComponent();
+ _propertyJoins = new BindingList<IRelateProperty>();
+ grdJoinKeys.DataSource = _propertyJoins;
}
private bool _init = false;
private IAttributeRelation _rel;
- public JoinSettings(FeatureSetColumn[] primaryColumns, IAttributeRelation rel)
+ private ClassDefinition _primaryClass;
+ private ClassDefinition[] _secondaryClasses;
+ private ClassDefinition _secondaryClass;
+
+ private BindingList<IRelateProperty> _propertyJoins;
+
+ public JoinSettings(ClassDefinition primaryClass, IAttributeRelation rel)
: this()
{
Check.NotNull(rel, "rel");
+ Check.NotNull(primaryClass, "primaryClass");
+ _primaryClass = primaryClass;
- //FIXME: Everything :( This control is currently broken. I have learned the hard way that dependent comboboxes + Automated databinding = Recipe for trouble!
- //So re-design this control to *not* use comboboxes for such cases.
-
_init = true;
grdJoinKeys.AutoGenerateColumns = false;
_rel = rel;
+ }
- TextBoxBinder.BindText(txtJoinName, _rel, "Name");
- //TextBoxBinder.BindText(txtFeatureSource, _rel, "ResourceId");
- txtFeatureSource.TextChanged += new EventHandler(txtFeatureSource_TextChanged);
- //rb.ReadValue();
- UpdateJoinClass();
-
- //CheckBoxBinder.BindChecked(chkForceOneToOne, _rel, "ForceOneToOne");
- //CheckBoxBinder is failing me here, so let's do it manually
- chkForceOneToOne.Checked = _rel.ForceOneToOne;
- chkForceOneToOne.CheckedChanged += (s, e) => { _rel.ForceOneToOne = chkForceOneToOne.Checked; };
-
- var bin = ComboBoxBinder.BindSelectedIndexChanged(cmbFeatureClass, "SelectedValue", _rel, "AttributeClass");
- bin.ReadValue();
-
- //UpdateSecondary();
-
- _rel.PropertyChanged += (sender, e) => { OnResourceChanged(); };
-
- cmbPrimary.DisplayMember = "Name";
- cmbPrimary.ValueMember = "Name";
- cmbPrimary.DataSource = primaryColumns;
-
- UpdateJoinKeyList(rel);
+ void OnPropertyJoinListChanged(object sender, ListChangedEventArgs e)
+ {
+ switch (e.ListChangedType)
+ {
+ case ListChangedType.ItemAdded:
+ _rel.AddRelateProperty(_propertyJoins[e.NewIndex]);
+ break;
+ case ListChangedType.Reset:
+ _rel.RemoveAllRelateProperties();
+ break;
+ }
}
private void UpdateJoinKeyList(IAttributeRelation rel)
@@ -84,42 +81,44 @@
grdJoinKeys.DataSource = new List<IRelateProperty>(rel.RelateProperty);
}
- void txtFeatureSource_TextChanged(object sender, EventArgs e)
+ private void btnBrowse_Click(object sender, EventArgs e)
{
- _rel.ResourceId = txtFeatureSource.Text;
- UpdateJoinClass();
+ string resId = _edSvc.SelectResource(OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource);
+ if (!string.IsNullOrEmpty(resId))
+ {
+ txtFeatureSource.Text = resId;
+
+ var schema = _edSvc.FeatureService.DescribeFeatureSource(txtFeatureSource.Text);
+ _secondaryClasses = schema.Classes;
+ //Invalidate existing secondary class
+ txtSecondaryClass.Text = string.Empty;
+ _secondaryClass = null;
+ //Clear existing property joins
+ ClearPropertyJoins();
+ CheckAddStatus();
+ }
}
- private void UpdateJoinClass()
+ private void btnBrowseSecondaryClass_Click(object sender, EventArgs e)
{
- try
+ if (string.IsNullOrEmpty(txtFeatureSource.Text))
{
- var rt = ResourceIdentifier.GetResourceType(txtFeatureSource.Text);
- if (rt == ResourceTypes.FeatureSource)
- {
- var fs = _edSvc.FeatureService.DescribeFeatureSource(txtFeatureSource.Text);
- cmbFeatureClass.DataSource = fs.Classes;
+ MessageBox.Show(Properties.Resources.SpecifySecondaryFeatureSource);
+ return;
+ }
- if (fs.Classes.Length > 0)
- {
- cmbFeatureClass.SelectedIndex = 0;
- UpdateSecondary();
- }
- }
- }
- catch
+ var selClass = GenericItemSelectionDialog.SelectItem(Properties.Resources.SelectFeatureClass, Properties.Resources.SelectFeatureClass, _secondaryClasses, "QualifiedNameDecoded", "QualifiedNameDecoded");
+ if (selClass != null)
{
-
+ _secondaryClass = selClass;
+ txtSecondaryClass.Text = _secondaryClass.QualifiedNameDecoded;
+ CheckAddStatus();
}
}
- private void btnBrowse_Click(object sender, EventArgs e)
+ private void ClearPropertyJoins()
{
- string resId = _edSvc.SelectResource(OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource);
- if (!string.IsNullOrEmpty(resId))
- {
- txtFeatureSource.Text = resId;
- }
+ _propertyJoins.Clear();
}
private IEditorService _edSvc;
@@ -128,6 +127,58 @@
{
_edSvc = service;
_edSvc.RegisterCustomNotifier(this);
+
+ TextBoxBinder.BindText(txtJoinName, _rel, "Name");
+ TextBoxBinder.BindText(txtFeatureSource, _rel, "ResourceId");
+ TextBoxBinder.BindText(txtSecondaryClass, _rel, "AttributeClass");
+
+ //Init selected classes
+ if (!string.IsNullOrEmpty(_rel.ResourceId))
+ {
+ var schema = _edSvc.FeatureService.DescribeFeatureSource(_rel.ResourceId);
+ _secondaryClasses = schema.Classes;
+
+ if (!string.IsNullOrEmpty(_rel.AttributeClass))
+ {
+ foreach (var cls in _secondaryClasses)
+ {
+ if (cls.QualifiedNameDecoded.Equals(_rel.AttributeClass))
+ {
+ _secondaryClass = cls;
+ break;
+ }
+ }
+ }
+ }
+
+ //CheckBoxBinder.BindChecked(chkForceOneToOne, _rel, "ForceOneToOne");
+ //CheckBoxBinder is failing me here, so let's do it manually
+ chkForceOneToOne.Checked = _rel.ForceOneToOne;
+ chkForceOneToOne.CheckedChanged += (s, e) => { _rel.ForceOneToOne = chkForceOneToOne.Checked; };
+
+ switch (_rel.RelateType)
+ {
+ case RelateTypeEnum.Association:
+ rdAssociation.Checked = true;
+ break;
+ case RelateTypeEnum.Inner:
+ rdInner.Checked = true;
+ break;
+ case RelateTypeEnum.LeftOuter:
+ rdLeftOuter.Checked = true;
+ break;
+ case RelateTypeEnum.RightOuter:
+ rdRightOuter.Checked = true;
+ break;
+ }
+
+ _rel.PropertyChanged += (sender, e) => { OnResourceChanged(); };
+
+ foreach (var join in _rel.RelateProperty)
+ {
+ _propertyJoins.Add(join);
+ }
+ _propertyJoins.ListChanged += new ListChangedEventHandler(OnPropertyJoinListChanged);
}
private void OnResourceChanged()
@@ -164,63 +215,40 @@
_rel.RelateType = GetJoinType();
}
- private void cmbFeatureClass_SelectedIndexChanged(object sender, EventArgs e)
+ private void CheckAddStatus()
{
- UpdateSecondary();
+ btnAddKey.Enabled = !string.IsNullOrEmpty(txtFeatureSource.Text) && !string.IsNullOrEmpty(txtSecondaryClass.Text);
}
- private void UpdateSecondary()
- {
- //Invalidate
- if (!_init)
- _rel.RemoveAllRelateProperties();
-
- var item = cmbFeatureClass.SelectedItem as ClassDefinition;
- if (item != null)
- {
- cmbSecondary.DisplayMember = "Name";
- cmbSecondary.ValueMember = "Name";
- cmbSecondary.DataSource = item.Columns;
- }
- }
-
- private void lnkClear_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- _rel.RemoveAllRelateProperties();
- }
-
- private void CheckAddStatus(object sender, EventArgs e)
- {
- lnkAdd.Enabled = cmbPrimary.SelectedIndex >= 0 && cmbSecondary.SelectedIndex >= 0;
- }
-
private void grdJoinKeys_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
grdJoinKeys.Rows[e.RowIndex].Selected = true;
- lnkDelete.Enabled = true;
+ btnDeleteKey.Enabled = true;
}
}
- private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ private void btnAddKey_Click(object sender, EventArgs e)
{
- if (cmbSecondary.SelectedIndex >= 0 && cmbSecondary.SelectedIndex >= 0)
+ if (_primaryClass != null && _secondaryClass != null)
{
- string primary = ((FeatureSetColumn)cmbPrimary.SelectedItem).Name;
- string secondary = ((FeatureSetColumn)cmbSecondary.SelectedItem).Name;
-
- _rel.AddRelateProperty(primary, secondary);
- UpdateJoinKeyList(_rel);
+ var dlg = new SelectJoinKeyDialog(_primaryClass, _secondaryClass);
+ if (dlg.ShowDialog() == DialogResult.OK)
+ {
+ var rel = _rel.CreatePropertyJoin(dlg.PrimaryProperty, dlg.SecondaryProperty);
+ _propertyJoins.Add(rel);
+ }
}
}
- private void lnkDelete_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ private void btnDeleteKey_Click(object sender, EventArgs e)
{
if (grdJoinKeys.SelectedRows.Count == 1)
{
- _rel.RemoveRelateProperty((IRelateProperty)grdJoinKeys.SelectedRows[0].DataBoundItem);
- UpdateJoinKeyList(_rel);
+ var join = (IRelateProperty)grdJoinKeys.SelectedRows[0].DataBoundItem;
+ _rel.RemoveRelateProperty(join);
+ _propertyJoins.Remove(join);
}
}
}
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.resx 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.resx 2010-10-20 14:50:30 UTC (rev 5306)
@@ -123,4 +123,16 @@
<metadata name="COL_SECONDARY.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+ <metadata name="COL_PRIMARY.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="COL_SECONDARY.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <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="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
Added: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.Designer.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.Designer.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -0,0 +1,176 @@
+namespace Maestro.Editors.FeatureSource.Extensions
+{
+ partial class SelectJoinKeyDialog
+ {
+ /// <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 Windows Form 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.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.lblPrimary = new System.Windows.Forms.Label();
+ this.cmbPrimary = new System.Windows.Forms.ComboBox();
+ this.cmbSecondary = new System.Windows.Forms.ComboBox();
+ this.lblSecondary = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.label6 = new System.Windows.Forms.Label();
+ this.btnOK = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 24);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(108, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Primary Feature Class";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 47);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(46, 13);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "Property";
+ //
+ // lblPrimary
+ //
+ this.lblPrimary.AutoSize = true;
+ this.lblPrimary.Location = new System.Drawing.Point(162, 24);
+ this.lblPrimary.Name = "lblPrimary";
+ this.lblPrimary.Size = new System.Drawing.Size(35, 13);
+ this.lblPrimary.TabIndex = 2;
+ this.lblPrimary.Text = "label3";
+ //
+ // cmbPrimary
+ //
+ this.cmbPrimary.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbPrimary.FormattingEnabled = true;
+ this.cmbPrimary.Location = new System.Drawing.Point(165, 44);
+ this.cmbPrimary.Name = "cmbPrimary";
+ this.cmbPrimary.Size = new System.Drawing.Size(261, 21);
+ this.cmbPrimary.TabIndex = 3;
+ //
+ // cmbSecondary
+ //
+ this.cmbSecondary.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbSecondary.FormattingEnabled = true;
+ this.cmbSecondary.Location = new System.Drawing.Point(165, 104);
+ this.cmbSecondary.Name = "cmbSecondary";
+ this.cmbSecondary.Size = new System.Drawing.Size(261, 21);
+ this.cmbSecondary.TabIndex = 7;
+ //
+ // lblSecondary
+ //
+ this.lblSecondary.AutoSize = true;
+ this.lblSecondary.Location = new System.Drawing.Point(162, 84);
+ this.lblSecondary.Name = "lblSecondary";
+ this.lblSecondary.Size = new System.Drawing.Size(35, 13);
+ this.lblSecondary.TabIndex = 6;
+ this.lblSecondary.Text = "label4";
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(12, 107);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(46, 13);
+ this.label5.TabIndex = 5;
+ this.label5.Text = "Property";
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(12, 84);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(125, 13);
+ this.label6.TabIndex = 4;
+ this.label6.Text = "Secondary Feature Class";
+ //
+ // btnOK
+ //
+ this.btnOK.Location = new System.Drawing.Point(270, 143);
+ this.btnOK.Name = "btnOK";
+ this.btnOK.Size = new System.Drawing.Size(75, 23);
+ this.btnOK.TabIndex = 8;
+ this.btnOK.Text = "OK";
+ this.btnOK.UseVisualStyleBackColor = true;
+ this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(351, 143);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 9;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // SelectJoinKeyDialog
+ //
+ this.AcceptButton = this.btnOK;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.btnCancel;
+ this.ClientSize = new System.Drawing.Size(450, 181);
+ this.ControlBox = false;
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnOK);
+ this.Controls.Add(this.cmbSecondary);
+ this.Controls.Add(this.lblSecondary);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.cmbPrimary);
+ this.Controls.Add(this.lblPrimary);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.Name = "SelectJoinKeyDialog";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Add Property Join";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label lblPrimary;
+ private System.Windows.Forms.ComboBox cmbPrimary;
+ private System.Windows.Forms.ComboBox cmbSecondary;
+ private System.Windows.Forms.Label lblSecondary;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.Button btnOK;
+ private System.Windows.Forms.Button btnCancel;
+ }
+}
\ No newline at end of file
Added: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -0,0 +1,86 @@
+#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.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI;
+
+namespace Maestro.Editors.FeatureSource.Extensions
+{
+ public partial class SelectJoinKeyDialog : Form
+ {
+ internal SelectJoinKeyDialog()
+ {
+ InitializeComponent();
+ }
+
+ public SelectJoinKeyDialog(ClassDefinition primary, ClassDefinition secondary)
+ : this()
+ {
+ lblPrimary.Text = primary.QualifiedNameDecoded;
+ lblSecondary.Text = secondary.QualifiedNameDecoded;
+
+ cmbPrimary.DisplayMember = "Name";
+ cmbSecondary.DisplayMember = "Name";
+
+ cmbPrimary.DataSource = primary.Columns;
+ cmbSecondary.DataSource = secondary.Columns;
+
+ cmbPrimary.SelectedIndex = 0;
+ cmbSecondary.SelectedIndex = 0;
+ }
+
+ public string PrimaryProperty
+ {
+ get
+ {
+ var col = cmbPrimary.SelectedItem as FeatureSetColumn;
+ if (col != null)
+ return col.Name;
+ return string.Empty;
+ }
+ }
+
+ public string SecondaryProperty
+ {
+ get
+ {
+ var col = cmbSecondary.SelectedItem as FeatureSetColumn;
+ if (col != null)
+ return col.Name;
+ return string.Empty;
+ }
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = DialogResult.Cancel;
+ }
+
+ private void btnOK_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = DialogResult.OK;
+ }
+ }
+}
Added: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.resx (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/SelectJoinKeyDialog.resx 2010-10-20 14:50:30 UTC (rev 5306)
@@ -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-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -334,6 +334,7 @@
splitContainer1.Panel2.Controls.Clear();
splitContainer1.Panel2.Controls.Add(ctl);
+ btnDelete.Enabled = true;
btnNewCalculation.Enabled = btnNewJoin.Enabled = IsValidExtension(ext);
}
@@ -354,11 +355,12 @@
if (cls != null)
{
- var ctl = new JoinSettings(cls.Columns, join);
+ var ctl = new JoinSettings(cls, join);
ctl.Bind(_edSvc);
ctl.Dock = DockStyle.Fill;
splitContainer1.Panel2.Controls.Clear();
splitContainer1.Panel2.Controls.Add(ctl);
+ btnDelete.Enabled = true;
}
}
}
@@ -383,6 +385,7 @@
ctl.Dock = DockStyle.Fill;
splitContainer1.Panel2.Controls.Clear();
splitContainer1.Panel2.Controls.Add(ctl);
+ btnDelete.Enabled = true;
}
}
}
Modified: sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj 2010-10-20 14:50:30 UTC (rev 5306)
@@ -160,6 +160,12 @@
<Compile Include="FeatureSource\Extensions\JoinSettings.Designer.cs">
<DependentUpon>JoinSettings.cs</DependentUpon>
</Compile>
+ <Compile Include="FeatureSource\Extensions\SelectJoinKeyDialog.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="FeatureSource\Extensions\SelectJoinKeyDialog.Designer.cs">
+ <DependentUpon>SelectJoinKeyDialog.cs</DependentUpon>
+ </Compile>
<Compile Include="FeatureSource\FeatureSourceEditorCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -650,6 +656,9 @@
<DependentUpon>JoinSettings.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="FeatureSource\Extensions\SelectJoinKeyDialog.resx">
+ <DependentUpon>SelectJoinKeyDialog.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="FeatureSource\FeatureSourceEditorCtrl.resx">
<DependentUpon>FeatureSourceEditorCtrl.cs</DependentUpon>
<SubType>Designer</SubType>
Modified: sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.Designer.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -1855,6 +1855,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to Select Feature Class.
+ /// </summary>
+ internal static string SelectFeatureClass {
+ get {
+ return ResourceManager.GetString("SelectFeatureClass", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Select Folder.
/// </summary>
internal static string SelectFolder {
@@ -1922,6 +1931,15 @@
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Please specify the secondary feature source.
+ /// </summary>
+ internal static string SpecifySecondaryFeatureSource {
+ get {
+ return ResourceManager.GetString("SpecifySecondaryFeatureSource", resourceCulture);
+ }
+ }
+
internal static System.Drawing.Bitmap sql {
get {
object obj = ResourceManager.GetObject("sql", resourceCulture);
Modified: sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/Maestro.Editors/Properties/Resources.resx 2010-10-20 14:50:30 UTC (rev 5306)
@@ -965,4 +965,10 @@
<data name="SelectLayer" xml:space="preserve">
<value>Select Layer</value>
</data>
+ <data name="SelectFeatureClass" xml:space="preserve">
+ <value>Select Feature Class</value>
+ </data>
+ <data name="SpecifySecondaryFeatureSource" xml:space="preserve">
+ <value>Please specify the secondary feature source</value>
+ </data>
</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -256,6 +256,7 @@
}
}
+ [XmlIgnore]
IEnumerable<ISpatialContextInfo> IFeatureSource.SupplementalSpatialContextInfo
{
get
@@ -370,6 +371,12 @@
partial class AttributeRelateType : IAttributeRelation
{
+ IRelateProperty IAttributeRelation.CreatePropertyJoin(string primaryProperty, string secondaryProperty)
+ {
+ return new RelatePropertyType() { FeatureClassProperty = primaryProperty, AttributeClassProperty = secondaryProperty };
+ }
+
+ [XmlIgnore]
bool IAttributeRelation.ForceOneToOne
{
get
@@ -388,6 +395,18 @@
this.RelateProperty.Clear();
}
+ [XmlIgnore]
+ RelateTypeEnum IAttributeRelation.RelateType
+ {
+ get { return this.RelateType; }
+ set
+ {
+ this.RelateType = value;
+ this.RelateTypeSpecified = true;
+ }
+ }
+
+ [XmlIgnore]
IEnumerable<IRelateProperty> IAttributeRelation.RelateProperty
{
get
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -163,6 +163,8 @@
IEnumerable<IRelateProperty> RelateProperty { get; }
+ IRelateProperty CreatePropertyJoin(string primaryProperty, string secondaryProperty);
+
void AddRelateProperty(IRelateProperty prop);
void RemoveRelateProperty(IRelateProperty prop);
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs 2010-10-20 13:45:01 UTC (rev 5305)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs 2010-10-20 14:50:30 UTC (rev 5306)
@@ -440,10 +440,13 @@
public static IAttributeRelation CreateAttributeRelation()
{
- return new AttributeRelateType()
+ IAttributeRelation rel = new AttributeRelateType()
{
RelateProperty = new System.ComponentModel.BindingList<RelatePropertyType>(),
};
+ rel.RelateType = RelateTypeEnum.LeftOuter;
+ rel.ForceOneToOne = false;
+ return rel;
}
}
}
More information about the mapguide-commits
mailing list