[mapguide-commits] r7177 - in trunk/Tools/Maestro: Maestro.Login OSGeo.MapGuide.MaestroAPI
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Oct 31 06:26:17 PDT 2012
Author: jng
Date: 2012-10-31 06:26:16 -0700 (Wed, 31 Oct 2012)
New Revision: 7177
Added:
trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.cs
trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.resx
trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.cs
trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.resx
Modified:
trunk/Tools/Maestro/Maestro.Login/LocalLoginCtrl.cs
trunk/Tools/Maestro/Maestro.Login/LocalNativeLoginCtrl.cs
trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs
Log:
#2151: Add some safeguards in the login dialog to show a modified UI when making a subsequent Local or LocalNative connection as it is not possible in the current design to create a new connection initialized from a different ini file.
Modified: trunk/Tools/Maestro/Maestro.Login/LocalLoginCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalLoginCtrl.cs 2012-10-31 12:37:34 UTC (rev 7176)
+++ trunk/Tools/Maestro/Maestro.Login/LocalLoginCtrl.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -42,6 +42,8 @@
InitializeComponent();
}
+ internal static string LastIniPath { get; set; }
+
private void btnBrowse_Click(object sender, EventArgs e)
{
using (var open = DialogFactory.OpenFile())
@@ -51,7 +53,7 @@
open.Filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickIni, "ini"); //NOXLATE
if (open.ShowDialog() == DialogResult.OK)
{
- txtPlatformConfig.Text = open.FileName;
+ LastIniPath = txtPlatformConfig.Text = open.FileName;
UpdateLoginStatus();
}
}
Modified: trunk/Tools/Maestro/Maestro.Login/LocalNativeLoginCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalNativeLoginCtrl.cs 2012-10-31 12:37:34 UTC (rev 7176)
+++ trunk/Tools/Maestro/Maestro.Login/LocalNativeLoginCtrl.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -42,6 +42,8 @@
DisabledOk(this, EventArgs.Empty);
}
+ internal static string LastIniPath { get; set; }
+
#region ILoginCtrl Members
public string Username
@@ -91,7 +93,7 @@
dlg.Filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickIni, "ini"); //NOXLATE
if (dlg.ShowDialog() == DialogResult.OK)
{
- txtWebConfig.Text = dlg.FileName;
+ LastIniPath = txtWebConfig.Text = dlg.FileName;
}
}
}
Added: trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.Designer.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -0,0 +1,126 @@
+namespace Maestro.Login
+{
+ partial class LocalNativeStubCtrl
+ {
+ /// <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.lblIniPath = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.txtUsername = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // lblIniPath
+ //
+ this.lblIniPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblIniPath.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.lblIniPath.Location = new System.Drawing.Point(12, 40);
+ this.lblIniPath.Name = "lblIniPath";
+ this.lblIniPath.Size = new System.Drawing.Size(329, 37);
+ this.lblIniPath.TabIndex = 3;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.label1.Location = new System.Drawing.Point(12, 12);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(154, 13);
+ this.label1.TabIndex = 2;
+ this.label1.Text = "Connect using previous path of";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtPassword.Location = new System.Drawing.Point(95, 116);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.PasswordChar = '*';
+ this.txtPassword.Size = new System.Drawing.Size(246, 20);
+ this.txtPassword.TabIndex = 29;
+ this.txtPassword.Text = "admin";
+ //
+ // txtUsername
+ //
+ this.txtUsername.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtUsername.Location = new System.Drawing.Point(95, 90);
+ this.txtUsername.Name = "txtUsername";
+ this.txtUsername.Size = new System.Drawing.Size(246, 20);
+ this.txtUsername.TabIndex = 28;
+ this.txtUsername.Text = "Administrator";
+ //
+ // label4
+ //
+ this.label4.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.label4.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.label4.Location = new System.Drawing.Point(15, 119);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(74, 16);
+ this.label4.TabIndex = 27;
+ this.label4.Text = "Password";
+ //
+ // label3
+ //
+ this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.label3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.label3.Location = new System.Drawing.Point(15, 93);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(74, 16);
+ this.label3.TabIndex = 26;
+ this.label3.Text = "Username";
+ //
+ // LocalNativeStubCtrl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.txtPassword);
+ this.Controls.Add(this.txtUsername);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.lblIniPath);
+ this.Controls.Add(this.label1);
+ this.Name = "LocalNativeStubCtrl";
+ this.Size = new System.Drawing.Size(357, 164);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblIniPath;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.TextBox txtUsername;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label3;
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -0,0 +1,75 @@
+#region Disclaimer / License
+// Copyright (C) 2012, 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.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Maestro.Login
+{
+ public partial class LocalNativeStubCtrl : UserControl, ILoginCtrl
+ {
+ public LocalNativeStubCtrl()
+ {
+ InitializeComponent();
+ }
+
+ public void SetLastIniPath(string path)
+ {
+ lblIniPath.Text = path;
+ }
+
+ public string Username
+ {
+ get { return txtUsername.Text; }
+ }
+
+ public string Password
+ {
+ get { return txtPassword.Text; }
+ }
+
+ public void UpdateLoginStatus()
+ {
+ if (!string.IsNullOrEmpty(this.Username) && !string.IsNullOrEmpty(this.Password))
+ {
+ var h = EnableOk;
+ if (h != null)
+ h(this, EventArgs.Empty);
+ }
+ else
+ {
+ var h = DisabledOk;
+ if (h != null)
+ h(this, EventArgs.Empty);
+ }
+ }
+
+ public event EventHandler EnableOk;
+
+ public event EventHandler DisabledOk;
+
+ public event EventHandler CheckSavedPassword;
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.Login/LocalNativeStubCtrl.resx 2012-10-31 13:26:16 UTC (rev 7177)
@@ -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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
Added: trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.Designer.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -0,0 +1,71 @@
+namespace Maestro.Login
+{
+ partial class LocalStubCtrl
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LocalStubCtrl));
+ this.label1 = new System.Windows.Forms.Label();
+ this.lblIniPath = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ resources.ApplyResources(this.label1, "label1");
+ this.label1.Name = "label1";
+ //
+ // lblIniPath
+ //
+ resources.ApplyResources(this.lblIniPath, "lblIniPath");
+ this.lblIniPath.Name = "lblIniPath";
+ //
+ // label2
+ //
+ resources.ApplyResources(this.label2, "label2");
+ this.label2.Name = "label2";
+ //
+ // LocalStubCtrl
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.lblIniPath);
+ this.Controls.Add(this.label1);
+ this.Name = "LocalStubCtrl";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label lblIniPath;
+ private System.Windows.Forms.Label label2;
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -0,0 +1,68 @@
+#region Disclaimer / License
+// Copyright (C) 2012, 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.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Maestro.Login
+{
+ public partial class LocalStubCtrl : UserControl, ILoginCtrl
+ {
+ public LocalStubCtrl()
+ {
+ InitializeComponent();
+ }
+
+ public void SetLastIniPath(string path)
+ {
+ lblIniPath.Text = path;
+ }
+
+ public string Username
+ {
+ get;
+ set;
+ }
+
+ public string Password
+ {
+ get;
+ set;
+ }
+
+ public void UpdateLoginStatus()
+ {
+ var h = EnableOk;
+ if (h != null)
+ h(this, EventArgs.Empty);
+ }
+
+ public event EventHandler EnableOk;
+
+ public event EventHandler DisabledOk;
+
+ public event EventHandler CheckSavedPassword;
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.Login/LocalStubCtrl.resx 2012-10-31 13:26:16 UTC (rev 7177)
@@ -0,0 +1,219 @@
+<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="label1.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>20, 19</value>
+ </data>
+ <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>154, 13</value>
+ </data>
+ <data name="label1.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="label1.Text" xml:space="preserve">
+ <value>Connect using previous path of</value>
+ </data>
+ <data name=">>label1.Name" xml:space="preserve">
+ <value>label1</value>
+ </data>
+ <data name=">>label1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label1.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label1.ZOrder" xml:space="preserve">
+ <value>2</value>
+ </data>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="lblIniPath.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Left, Right</value>
+ </data>
+ <data name="lblIniPath.Location" type="System.Drawing.Point, System.Drawing">
+ <value>20, 47</value>
+ </data>
+ <data name="lblIniPath.Size" type="System.Drawing.Size, System.Drawing">
+ <value>281, 68</value>
+ </data>
+ <data name="lblIniPath.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name=">>lblIniPath.Name" xml:space="preserve">
+ <value>lblIniPath</value>
+ </data>
+ <data name=">>lblIniPath.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>lblIniPath.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>lblIniPath.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="label2.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="label2.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+ <value>NoControl</value>
+ </data>
+ <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
+ <value>20, 132</value>
+ </data>
+ <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
+ <value>274, 13</value>
+ </data>
+ <data name="label2.TabIndex" type="System.Int32, mscorlib">
+ <value>2</value>
+ </data>
+ <data name="label2.Text" xml:space="preserve">
+ <value>Restart the application to connect using a different ini file</value>
+ </data>
+ <data name=">>label2.Name" xml:space="preserve">
+ <value>label2</value>
+ </data>
+ <data name=">>label2.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label2.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label2.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
+ <value>6, 13</value>
+ </data>
+ <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
+ <value>322, 166</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>LocalStubCtrl</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2012-10-31 12:37:34 UTC (rev 7176)
+++ trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -45,7 +45,8 @@
private HttpLoginCtrl _http;
private LocalNativeLoginCtrl _localNative;
private LocalLoginCtrl _local;
-
+ private LocalNativeStubCtrl _localNativeStub;
+ private LocalStubCtrl _localStub;
/// <summary>
/// Initializes a new instance of the <see cref="LoginDialog"/> class.
@@ -56,21 +57,31 @@
_http = new HttpLoginCtrl() { Dock = DockStyle.Fill };
_localNative = new LocalNativeLoginCtrl() { Dock = DockStyle.Fill };
_local = new LocalLoginCtrl() { Dock = DockStyle.Fill };
+ _localNativeStub = new LocalNativeStubCtrl() { Dock = DockStyle.Fill };
+ _localStub = new LocalStubCtrl() { Dock = DockStyle.Fill };
_controls = new ILoginCtrl[]
{
_http,
_localNative,
- _local
+ _local,
+ _localNativeStub,
+ _localStub
};
_controls[0].EnableOk += OnEnableOk;
_controls[1].EnableOk += OnEnableOk;
_controls[2].EnableOk += OnEnableOk;
+ _controls[3].EnableOk += OnEnableOk;
+ _controls[4].EnableOk += OnEnableOk;
_controls[0].CheckSavedPassword += (sender, e) => { chkSavePassword.Checked = true; };
_controls[1].CheckSavedPassword += (sender, e) => { chkSavePassword.Checked = true; };
_controls[2].CheckSavedPassword += (sender, e) => { chkSavePassword.Checked = true; };
+ _controls[3].CheckSavedPassword += (sender, e) => { chkSavePassword.Checked = true; };
+ _controls[4].CheckSavedPassword += (sender, e) => { chkSavePassword.Checked = true; };
_controls[0].DisabledOk += OnDisableOk;
_controls[1].DisabledOk += OnDisableOk;
_controls[2].DisabledOk += OnDisableOk;
+ _controls[3].DisabledOk += OnDisableOk;
+ _controls[4].DisabledOk += OnDisableOk;
}
/// <summary>
@@ -278,7 +289,7 @@
else if (_selectedIndex == 1) //Native
{
System.Data.Common.DbConnectionStringBuilder builder = new System.Data.Common.DbConnectionStringBuilder();
- builder["ConfigFile"] = _localNative.WebConfigPath; //NOXLATE
+ builder["ConfigFile"] = LocalNativeLoginCtrl.LastIniPath; //NOXLATE
builder["Username"] = _localNative.Username; //NOXLATE
builder["Password"] = _localNative.Password; //NOXLATE
builder["Locale"] = System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName; //NOXLATE
@@ -287,7 +298,7 @@
else //Local
{
NameValueCollection param = new NameValueCollection();
- param["ConfigFile"] = _local.PlatformConfigPath; //NOXLATE
+ param["ConfigFile"] = LocalLoginCtrl.LastIniPath; //NOXLATE
_conn = ConnectionProviderRegistry.CreateConnection("Maestro.Local", param); //NOXLATE
}
@@ -316,14 +327,40 @@
private void UpdateLoginControl()
{
if (rdHttp.Checked)
+ {
_selectedIndex = 0;
+ SetLoginControl((Control)_controls[_selectedIndex]);
+ _controls[_selectedIndex].UpdateLoginStatus();
+ }
else if (rdTcpIp.Checked)
- _selectedIndex = 1;
+ {
+ if (ConnectionProviderRegistry.GetInvocationCount("Maestro.LocalNative") == 0)
+ {
+ _selectedIndex = 1;
+ }
+ else
+ {
+ _selectedIndex = 3;
+ _localNativeStub.SetLastIniPath(LocalNativeLoginCtrl.LastIniPath);
+ }
+ SetLoginControl((Control)_controls[_selectedIndex]);
+ _controls[_selectedIndex].UpdateLoginStatus();
+ }
else
+ {
_selectedIndex = 2;
-
- SetLoginControl((Control)_controls[_selectedIndex]);
- _controls[_selectedIndex].UpdateLoginStatus();
+ if (ConnectionProviderRegistry.GetInvocationCount("Maestro.Local") == 0)
+ {
+ _selectedIndex = 2;
+ }
+ else
+ {
+ _selectedIndex = 4;
+ _localStub.SetLastIniPath(LocalLoginCtrl.LastIniPath);
+ }
+ SetLoginControl((Control)_controls[_selectedIndex]);
+ _controls[_selectedIndex].UpdateLoginStatus();
+ }
}
}
}
Modified: trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj 2012-10-31 12:37:34 UTC (rev 7176)
+++ trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj 2012-10-31 13:26:16 UTC (rev 7177)
@@ -72,6 +72,18 @@
<Compile Include="LocalLoginCtrl.Designer.cs">
<DependentUpon>LocalLoginCtrl.cs</DependentUpon>
</Compile>
+ <Compile Include="LocalNativeStubCtrl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="LocalNativeStubCtrl.Designer.cs">
+ <DependentUpon>LocalNativeStubCtrl.cs</DependentUpon>
+ </Compile>
+ <Compile Include="LocalStubCtrl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="LocalStubCtrl.Designer.cs">
+ <DependentUpon>LocalStubCtrl.cs</DependentUpon>
+ </Compile>
<Compile Include="LoginDialog.cs">
<SubType>Form</SubType>
</Compile>
@@ -106,6 +118,12 @@
<EmbeddedResource Include="LocalLoginCtrl.resx">
<DependentUpon>LocalLoginCtrl.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="LocalNativeStubCtrl.resx">
+ <DependentUpon>LocalNativeStubCtrl.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="LocalStubCtrl.resx">
+ <DependentUpon>LocalStubCtrl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="LoginDialog.resx">
<DependentUpon>LoginDialog.cs</DependentUpon>
<SubType>Designer</SubType>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs 2012-10-31 12:37:34 UTC (rev 7176)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ConnectionProviderRegistry.cs 2012-10-31 13:26:16 UTC (rev 7177)
@@ -227,8 +227,8 @@
/// <returns>The invocation count for the given provider. -1 if the provider is not registered or does not exist</returns>
public static int GetInvocationCount(string provider)
{
- if (_callCount.ContainsKey(provider))
- return _callCount[provider];
+ if (_callCount.ContainsKey(provider.ToUpper()))
+ return _callCount[provider.ToUpper()];
return -1;
}
More information about the mapguide-commits
mailing list