[mapguide-commits] r8457 - in trunk/Tools/Maestro: . Maestro Maestro.Login
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Nov 28 06:09:16 PST 2014
Author: jng
Date: 2014-11-28 06:09:16 -0800 (Fri, 28 Nov 2014)
New Revision: 8457
Removed:
trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.cs
trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.resx
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Rest/
Modified:
trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
trunk/Tools/Maestro/Maestro.Login/LoginDialog.designer.cs
trunk/Tools/Maestro/Maestro.Login/LoginDialog.resx
trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj
trunk/Tools/Maestro/Maestro/Maestro.csproj
trunk/Tools/Maestro/Maestro/Maestro_All.sln
Log:
#2506: Back to the drawing board. Roll back most of our work on this feature. We were a bit *too* ambitious with how to approach adding mapguide-rest support to Maestro. A separate connection provider is overkill. Augmenting the HTTP connection provider is a more feasible approach.
Modified: trunk/Tools/Maestro/Maestro/Maestro.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro/Maestro.csproj 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro/Maestro.csproj 2014-11-28 14:09:16 UTC (rev 8457)
@@ -472,10 +472,6 @@
<Project>{F4420153-9DF3-4407-AD65-E8ABED2B6E25}</Project>
<Name>OSGeo.MapGuide.MaestroAPI.Native32-2.2.0</Name>
</ProjectReference>
- <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI.Rest\OSGeo.MapGuide.MaestroAPI.Rest.csproj">
- <Project>{f112d03d-797b-4e31-ace5-ebb412eb08bd}</Project>
- <Name>OSGeo.MapGuide.MaestroAPI.Rest</Name>
- </ProjectReference>
<ProjectReference Include="..\Thirdparty\SharpDevelop\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj">
<Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project>
<Name>ICSharpCode.Core.WinForms</Name>
Modified: trunk/Tools/Maestro/Maestro/Maestro_All.sln
===================================================================
--- trunk/Tools/Maestro/Maestro/Maestro_All.sln 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro/Maestro_All.sln 2014-11-28 14:09:16 UTC (rev 8457)
@@ -162,8 +162,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MpuCalc", "..\MpuCalc\MpuCalc.csproj", "{43B01C27-E0D2-439B-83ED-8C814ED1526A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSGeo.MapGuide.MaestroAPI.Rest", "..\OSGeo.MapGuide.MaestroAPI.Rest\OSGeo.MapGuide.MaestroAPI.Rest.csproj", "{F112D03D-797B-4E31-ACE5-EBB412EB08BD}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -362,10 +360,6 @@
{43B01C27-E0D2-439B-83ED-8C814ED1526A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43B01C27-E0D2-439B-83ED-8C814ED1526A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43B01C27-E0D2-439B-83ED-8C814ED1526A}.Release|Any CPU.Build.0 = Release|Any CPU
- {F112D03D-797B-4E31-ACE5-EBB412EB08BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F112D03D-797B-4E31-ACE5-EBB412EB08BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F112D03D-797B-4E31-ACE5-EBB412EB08BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F112D03D-797B-4E31-ACE5-EBB412EB08BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2014-11-28 14:09:16 UTC (rev 8457)
@@ -47,7 +47,6 @@
private LocalLoginCtrl _local;
private LocalNativeStubCtrl _localNativeStub;
private LocalStubCtrl _localStub;
- private RestLoginCtrl _rest;
/// <summary>
/// Initializes a new instance of the <see cref="LoginDialog"/> class.
@@ -60,34 +59,29 @@
_local = new LocalLoginCtrl() { Dock = DockStyle.Fill };
_localNativeStub = new LocalNativeStubCtrl() { Dock = DockStyle.Fill };
_localStub = new LocalStubCtrl() { Dock = DockStyle.Fill };
- _rest = new RestLoginCtrl() { Dock = DockStyle.Fill };
_controls = new ILoginCtrl[]
{
_http,
_localNative,
_local,
_localNativeStub,
- _localStub,
- _rest
+ _localStub
};
_controls[0].EnableOk += OnEnableOk;
_controls[1].EnableOk += OnEnableOk;
_controls[2].EnableOk += OnEnableOk;
_controls[3].EnableOk += OnEnableOk;
_controls[4].EnableOk += OnEnableOk;
- _controls[5].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[5].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;
- _controls[5].DisabledOk += OnDisableOk;
}
/// <summary>
@@ -306,15 +300,6 @@
builder["Locale"] = System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName; //NOXLATE
_conn = ConnectionProviderRegistry.CreateConnection("Maestro.LocalNative", builder.ToString()); //NOXLATE
}
- else if (_selectedIndex == 5) //REST
- {
- System.Data.Common.DbConnectionStringBuilder builder = new System.Data.Common.DbConnectionStringBuilder();
- builder["Url"] = _rest.Endpoint;
- builder["Username"] = _rest.Username; //NOXLATE
- builder["Password"] = _rest.Password; //NOXLATE
- builder["Locale"] = System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName; //NOXLATE
- _conn = ConnectionProviderRegistry.CreateConnection("Maestro.Rest", builder.ToString()); //NOXLATE
- }
else //Local
{
NameValueCollection param = new NameValueCollection();
@@ -352,12 +337,6 @@
SetLoginControl((Control)_controls[_selectedIndex]);
_controls[_selectedIndex].UpdateLoginStatus();
}
- else if (rdRest.Checked)
- {
- _selectedIndex = 5;
- SetLoginControl((Control)_controls[_selectedIndex]);
- _controls[_selectedIndex].UpdateLoginStatus();
- }
else if (rdTcpIp.Checked)
{
if (ConnectionProviderRegistry.GetInvocationCount("Maestro.LocalNative") == 0)
Modified: trunk/Tools/Maestro/Maestro.Login/LoginDialog.designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LoginDialog.designer.cs 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/LoginDialog.designer.cs 2014-11-28 14:09:16 UTC (rev 8457)
@@ -36,7 +36,6 @@
this.rdTcpIp = new System.Windows.Forms.RadioButton();
this.loginPanel = new System.Windows.Forms.Panel();
this.rdLocal = new System.Windows.Forms.RadioButton();
- this.rdRest = new System.Windows.Forms.RadioButton();
this.SuspendLayout();
//
// chkSavePassword
@@ -86,19 +85,10 @@
this.rdLocal.UseVisualStyleBackColor = true;
this.rdLocal.CheckedChanged += new System.EventHandler(this.rdLocal_CheckedChanged);
//
- // rdRest
- //
- resources.ApplyResources(this.rdRest, "rdRest");
- this.rdRest.Name = "rdRest";
- this.rdRest.TabStop = true;
- this.rdRest.UseVisualStyleBackColor = true;
- this.rdRest.CheckedChanged += new System.EventHandler(this.rdRest_CheckedChanged);
- //
// LoginDialog
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
resources.ApplyResources(this, "$this");
- this.Controls.Add(this.rdRest);
this.Controls.Add(this.rdLocal);
this.Controls.Add(this.loginPanel);
this.Controls.Add(this.rdTcpIp);
@@ -124,6 +114,5 @@
private System.Windows.Forms.RadioButton rdTcpIp;
private System.Windows.Forms.Panel loginPanel;
private System.Windows.Forms.RadioButton rdLocal;
- private System.Windows.Forms.RadioButton rdRest;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Login/LoginDialog.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LoginDialog.resx 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/LoginDialog.resx 2014-11-28 14:09:16 UTC (rev 8457)
@@ -148,7 +148,7 @@
<value>$this</value>
</data>
<data name=">>chkSavePassword.ZOrder" xml:space="preserve">
- <value>5</value>
+ <value>4</value>
</data>
<data name="btnCancel.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
<value>System</value>
@@ -178,7 +178,7 @@
<value>$this</value>
</data>
<data name=">>btnCancel.ZOrder" xml:space="preserve">
- <value>6</value>
+ <value>5</value>
</data>
<data name="btnOK.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
@@ -211,7 +211,7 @@
<value>$this</value>
</data>
<data name=">>btnOK.ZOrder" xml:space="preserve">
- <value>7</value>
+ <value>6</value>
</data>
<data name="rdHttp.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -238,13 +238,13 @@
<value>$this</value>
</data>
<data name=">>rdHttp.ZOrder" xml:space="preserve">
- <value>4</value>
+ <value>3</value>
</data>
<data name="rdTcpIp.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="rdTcpIp.Location" type="System.Drawing.Point, System.Drawing">
- <value>158, 202</value>
+ <value>61, 202</value>
</data>
<data name="rdTcpIp.Size" type="System.Drawing.Size, System.Drawing">
<value>121, 17</value>
@@ -265,7 +265,7 @@
<value>$this</value>
</data>
<data name=">>rdTcpIp.ZOrder" xml:space="preserve">
- <value>3</value>
+ <value>2</value>
</data>
<data name="loginPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 12</value>
@@ -286,13 +286,13 @@
<value>$this</value>
</data>
<data name=">>loginPanel.ZOrder" xml:space="preserve">
- <value>2</value>
+ <value>1</value>
</data>
<data name="rdLocal.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="rdLocal.Location" type="System.Drawing.Point, System.Drawing">
- <value>285, 202</value>
+ <value>206, 202</value>
</data>
<data name="rdLocal.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 17</value>
@@ -313,36 +313,6 @@
<value>$this</value>
</data>
<data name=">>rdLocal.ZOrder" xml:space="preserve">
- <value>1</value>
- </data>
- <data name="rdRest.AutoSize" type="System.Boolean, mscorlib">
- <value>True</value>
- </data>
- <data name="rdRest.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
- <value>NoControl</value>
- </data>
- <data name="rdRest.Location" type="System.Drawing.Point, System.Drawing">
- <value>12, 202</value>
- </data>
- <data name="rdRest.Size" type="System.Drawing.Size, System.Drawing">
- <value>134, 17</value>
- </data>
- <data name="rdRest.TabIndex" type="System.Int32, mscorlib">
- <value>20</value>
- </data>
- <data name="rdRest.Text" xml:space="preserve">
- <value>Connect via REST API</value>
- </data>
- <data name=">>rdRest.Name" xml:space="preserve">
- <value>rdRest</value>
- </data>
- <data name=">>rdRest.Type" xml:space="preserve">
- <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </data>
- <data name=">>rdRest.Parent" xml:space="preserve">
- <value>$this</value>
- </data>
- <data name=">>rdRest.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">
Modified: trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/Maestro.Login.csproj 2014-11-28 14:09:16 UTC (rev 8457)
@@ -106,12 +106,6 @@
<Compile Include="NsDoc.cs" />
<Compile Include="PreferedSite.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="RestLoginCtrl.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="RestLoginCtrl.Designer.cs">
- <DependentUpon>RestLoginCtrl.cs</DependentUpon>
- </Compile>
<Compile Include="Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -142,9 +136,6 @@
<DependentUpon>LocalNativeLoginCtrl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="RestLoginCtrl.resx">
- <DependentUpon>RestLoginCtrl.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
Deleted: trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.Designer.cs 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.Designer.cs 2014-11-28 14:09:16 UTC (rev 8457)
@@ -1,153 +0,0 @@
-namespace Maestro.Login
-{
- partial class RestLoginCtrl
- {
- /// <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.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.label2 = new System.Windows.Forms.Label();
- this.txtEndpoint = new System.Windows.Forms.TextBox();
- this.cmbLanguage = new System.Windows.Forms.ComboBox();
- this.label5 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // 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(83, 55);
- this.txtPassword.Name = "txtPassword";
- this.txtPassword.PasswordChar = '*';
- this.txtPassword.Size = new System.Drawing.Size(229, 20);
- this.txtPassword.TabIndex = 2;
- this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged);
- //
- // 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(83, 29);
- this.txtUsername.Name = "txtUsername";
- this.txtUsername.Size = new System.Drawing.Size(229, 20);
- this.txtUsername.TabIndex = 1;
- this.txtUsername.TextChanged += new System.EventHandler(this.txtUsername_TextChanged);
- //
- // label4
- //
- this.label4.FlatStyle = System.Windows.Forms.FlatStyle.System;
- this.label4.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label4.Location = new System.Drawing.Point(3, 55);
- 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(3, 29);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(74, 16);
- this.label3.TabIndex = 26;
- this.label3.Text = "Username";
- //
- // label2
- //
- this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
- this.label2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label2.Location = new System.Drawing.Point(3, 3);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(74, 16);
- this.label2.TabIndex = 24;
- this.label2.Text = "Endpoint";
- //
- // txtEndpoint
- //
- this.txtEndpoint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.txtEndpoint.Location = new System.Drawing.Point(83, 3);
- this.txtEndpoint.Name = "txtEndpoint";
- this.txtEndpoint.Size = new System.Drawing.Size(229, 20);
- this.txtEndpoint.TabIndex = 0;
- this.txtEndpoint.Text = "http://localhost/mapguide/rest/v1";
- this.txtEndpoint.TextChanged += new System.EventHandler(this.txtEndpoint_TextChanged);
- //
- // cmbLanguage
- //
- this.cmbLanguage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.cmbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbLanguage.Location = new System.Drawing.Point(83, 81);
- this.cmbLanguage.Name = "cmbLanguage";
- this.cmbLanguage.Size = new System.Drawing.Size(229, 21);
- this.cmbLanguage.TabIndex = 3;
- //
- // label5
- //
- this.label5.FlatStyle = System.Windows.Forms.FlatStyle.System;
- this.label5.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label5.Location = new System.Drawing.Point(3, 81);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(74, 16);
- this.label5.TabIndex = 30;
- this.label5.Text = "Language";
- //
- // RestLoginCtrl
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.cmbLanguage);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.txtPassword);
- this.Controls.Add(this.txtUsername);
- this.Controls.Add(this.txtEndpoint);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Name = "RestLoginCtrl";
- this.Size = new System.Drawing.Size(315, 106);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.TextBox txtPassword;
- private System.Windows.Forms.TextBox txtUsername;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox txtEndpoint;
- private System.Windows.Forms.ComboBox cmbLanguage;
- private System.Windows.Forms.Label label5;
- }
-}
Deleted: trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.cs 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.cs 2014-11-28 14:09:16 UTC (rev 8457)
@@ -1,145 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2014, 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;
-using System.Globalization;
-
-namespace Maestro.Login
-{
- public partial class RestLoginCtrl : UserControl, ILoginCtrl
- {
- private bool _loading = true;
-
- public RestLoginCtrl()
- {
- InitializeComponent();
- }
-
- public string Username
- {
- get { return txtUsername.Text; }
- }
-
- public string Password
- {
- get { return txtPassword.Text; }
- }
-
- public string Endpoint
- {
- get { return txtEndpoint.Text; }
- }
-
- public string Language
- {
- get
- {
- var ci = cmbLanguage.SelectedItem as CultureInfo;
- if (ci != null)
- {
- return ci.TwoLetterISOLanguageName;
- }
- return null;
- }
- }
-
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
- List<CultureInfo> supported = new List<CultureInfo>();
- supported.Add(CultureInfo.GetCultureInfo("en-US")); //NOXLATE
-
- //Probe for language bundles and add them as well
- System.Text.RegularExpressions.Regex cix = new System.Text.RegularExpressions.Regex("[A-z][A-z](\\-[A-z][A-z])?"); //NOXLATE
- foreach (string f in System.IO.Directory.GetDirectories(Application.StartupPath))
- {
- if (cix.Match(System.IO.Path.GetFileName(f)).Length == System.IO.Path.GetFileName(f).Length)
- {
- try
- {
- supported.Add(System.Globalization.CultureInfo.GetCultureInfo(System.IO.Path.GetFileName(f)));
- }
- catch { }
- }
- }
-
- cmbLanguage.DisplayMember = "DisplayName"; //NOXLATE
- cmbLanguage.ValueMember = "Name"; //NOXLATE
-
- //Set default language based on current thread culture
- int selected = -1;
- foreach (var ci in supported)
- {
- int index = cmbLanguage.Items.Add(ci);
- if (string.Compare(ci.Name, System.Threading.Thread.CurrentThread.CurrentUICulture.Name, true) == 0)
- {
- selected = index;
- }
- }
-
- if (selected >= 0)
- cmbLanguage.SelectedIndex = selected;
-
- _loading = false;
- UpdateLoginStatus();
- }
-
- public CultureInfo SelectedCulture
- {
- get { return cmbLanguage.SelectedItem as CultureInfo; }
- }
-
- public void UpdateLoginStatus()
- {
- if (this.Username.Trim().Length > 0 && this.Endpoint.Trim().Length > 0)
- EnableOk(this, EventArgs.Empty);
- else
- DisabledOk(this, EventArgs.Empty);
- }
-
- public event EventHandler EnableOk;
-
- public event EventHandler DisabledOk;
-
- public event EventHandler CheckSavedPassword;
-
- private void txtUsername_TextChanged(object sender, EventArgs e)
- {
- UpdateLoginStatus();
- }
-
- private void txtEndpoint_TextChanged(object sender, EventArgs e)
- {
- UpdateLoginStatus();
- }
-
- private void txtPassword_TextChanged(object sender, EventArgs e)
- {
- UpdateLoginStatus();
- }
- }
-}
Deleted: trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.resx 2014-11-21 02:27:41 UTC (rev 8456)
+++ trunk/Tools/Maestro/Maestro.Login/RestLoginCtrl.resx 2014-11-28 14:09:16 UTC (rev 8457)
@@ -1,120 +0,0 @@
-<?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
More information about the mapguide-commits
mailing list