From 4bd148608a1fefcbd73e78b6a95d5786d52486a6 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Wed, 26 Oct 2005 18:52:55 +0000 Subject: [PATCH] Deleted unused files --- .../c-sharp-username-dialog/AssemblyInfo.cs | 58 ---- .../c-sharp-username-dialog/Makefile.am | 85 ----- .../c-sharp-username-dialog/README | 28 -- .../c-sharp-username-dialog.csproj | 119 ------- .../c-sharp-username-dialog.csproj.user | 48 --- .../c-sharp-username-dialog.snk | Bin 596 -> 0 bytes .../usernameDialog-gtk.cs | 257 ---------------- .../c-sharp-username-dialog/usernameDialog.cs | 291 ------------------ .../usernameDialog.resx | 166 ---------- 9 files changed, 1052 deletions(-) delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/AssemblyInfo.cs delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/Makefile.am delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/README delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj.user delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.snk delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/usernameDialog-gtk.cs delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/usernameDialog.cs delete mode 100644 ClientPasswordManager/c-sharp-username-dialog/usernameDialog.resx diff --git a/ClientPasswordManager/c-sharp-username-dialog/AssemblyInfo.cs b/ClientPasswordManager/c-sharp-username-dialog/AssemblyInfo.cs deleted file mode 100644 index 49e804e6..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/AssemblyInfo.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("Novell.Security.ClientPasswordManager ")] -[assembly: AssemblyDescription("Implements the usernameDialog class for Novell.Security.ClientPasswordManager")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Novell, Inc.")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Copyright (C) 2004 Novell, Inc.")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("..\\..\\c-sharp-username-dialog.snk")] -[assembly: AssemblyKeyName("")] diff --git a/ClientPasswordManager/c-sharp-username-dialog/Makefile.am b/ClientPasswordManager/c-sharp-username-dialog/Makefile.am deleted file mode 100644 index 7c0cd0ba..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -####################################################################### -# -# Copyright (C) 2004 Novell, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This program 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 -# General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Author: Juan Carlos Luciani -# -####################################################################### - -if DEBUG -TARGET_CFG = Debug -else -TARGET_CFG = Release -endif - -# handle Mono secondary dependencies -export MONO_PATH := $(MONO_PATH) - -if WINDOWS -Module_CSFILES = $(srcdir)/usernameDialog.cs -Module_LIBS = System.dll System.Data.dll $(SYSTEM_XML) Novell.Security.Utilities.dll -Module_PKGS = -else -Module_CSFILES = $(srcdir)/usernameDialog-gtk.cs -Module_LIBS = System.dll System.Data.dll System.Drawing $(SYSTEM_XML) Novell.Security.Utilities.dll -Module_PKGS = -pkg:gtk-sharp -endif - -Module_KEYFILE = $(srcdir)/c-sharp-username-dialog.snk -Module_CSFILES_CSC := $(subst /,$(SEP),$(Module_CSFILES)) -Module_INCLUDES = -Module_RESOURCES = -Module_FLAGS = $(CSC_LIBFLAG) -Module_LIBPATH = ../c-sharp-utilities/bin/$(TARGET_CFG) - -EXTRA_DIST = $(Module_CSFILES) $(Module_KEYFILE) - -CUR_DIR := $(shell pwd) - -all: Novell.Security.ClientPasswordManager.UsernameDialog.dll - -Novell.Security.ClientPasswordManager.UsernameDialog.dll: $(Module_CSFILES) $(Module_RESOURCES) - $(mkinstalldirs) bin/$(TARGET_CFG) -if WINDOWS - $(CSC) /nowarn:1591,1573,1572 /out:bin/$(TARGET_CFG)/$@ $(CSCFLAGS) $(Module_FLAGS) $(Module_PKGS) $(Module_LIBS:%=/r:%) $(Module_LIBPATH:%=/lib:%) $(Module_CSFILES_CSC) /doc:Novell.Security.ClientPasswordManager.UsernameDialog.doc.xml -else - $(CSC) /nowarn:1591,1573,1572 /out:bin/$(TARGET_CFG)/$@ $(CSCFLAGS) $(Module_FLAGS) /keyfile:$(Module_KEYFILE) $(Module_PKGS) $(Module_LIBS:%=/r:%) $(Module_LIBPATH:%=/lib:%) $(Module_CSFILES_CSC) /doc:Novell.Security.ClientPasswordManager.UsernameDialog.doc.xml -endif - -install-exec-local: Novell.Security.ClientPasswordManager.UsernameDialog.dll - $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL_PROGRAM) bin/$(TARGET_CFG)/Novell.Security.ClientPasswordManager.UsernameDialog.dll $(DESTDIR)$(libdir)/ - -uninstall-local: - cd $(DESTDIR)$(libdir); rm -f Novell.Security.ClientPasswordManager.UsernameDialog.dll - rmdir $(DESTDIR)$(libdir) - -#installcheck-local: install -# $(mkinstalldirs) $(DESTDIR)$(libdir) -# $(INSTALL_PROGRAM) $(DESTDIR)$(libdir) -# cd $(DESTDIR)$(libdir); $(MONO) - -CLEAN_FILES = bin/$(TARGET_CFG)/Novell.Security.ClientPasswordManager.UsernameDialog.dll /doc:Novell.Security.ClientPasswordManager.UsernameDialog.doc.xml - -clean-local: - rm -rf *.dbg *.exe *.dll $(CLEAN_FILES) - -distclean-local: - -maintainer-clean-local: - rm -f Makefile.in - diff --git a/ClientPasswordManager/c-sharp-username-dialog/README b/ClientPasswordManager/c-sharp-username-dialog/README deleted file mode 100644 index 136fb712..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/README +++ /dev/null @@ -1,28 +0,0 @@ -/*********************************************************************** - * File: README - * - * Copyright (C) 2004 Novell, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ***********************************************************************/ - -INTRODUCTION - -The c-sharp-username-dialog provides a class (UsernameDialog) that can be used -by .NET applications to query users for their user name. - -FEATURES - -The UsernameDialog Class utilizes Windows Forms under Win32 and GTK# under Linux. diff --git a/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj b/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj deleted file mode 100644 index f54163c4..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj.user b/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj.user deleted file mode 100644 index 0e89b7e9..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.csproj.user +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - diff --git a/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.snk b/ClientPasswordManager/c-sharp-username-dialog/c-sharp-username-dialog.snk deleted file mode 100644 index 04140d40e2366c7bf5d6545c5e0c75e15ce268a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098uvSHUyd1J=moOqut3k*5(|8O8pnAur_ph$0eg`=ys1^kLD40Jzd z(?%s?s$>5yi+(5D6$uJhA|R2D!f%PFgV5+_ZC0AP6|_W)4={_v-pd0eBZT1!V$;%PdAVY-w@tOoPQ+Ir>JfJ#92jYeSkNOA`N zSI9T5*)ETms>@R3|4qQY#5#iR^+O5@JXtfvf4^NeaNsrG)h-o1= zYEE~)euamTQ)^YP45b%zxSF?Z_*PDtE>TA8eQ4C!ajqUw+0`_ai-#?>h{E1O1AbG3 zj(QdSCs#kXH9%Q!%Y6$)&jV#e8-YYtNdN$u5~VCyugM#dMq>gfI_L>nv3ji~n_6?3 ihtVcREwggq*;!ad3i|Rt2`32!9WxFT9qQ*>{*`6LBN&PR diff --git a/ClientPasswordManager/c-sharp-username-dialog/usernameDialog-gtk.cs b/ClientPasswordManager/c-sharp-username-dialog/usernameDialog-gtk.cs deleted file mode 100644 index ec23da2a..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/usernameDialog-gtk.cs +++ /dev/null @@ -1,257 +0,0 @@ -/*********************************************************************** - * File: usernameDialog-gtk.cs - * Author: Juan Carlos Luciani (jluciani@novell.com) - * - * Namespace: Novell.Security.ClientPasswordManager - * - * Classes implemented: UsernameDialog. - * - * Copyright (C) 2004 Novell, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ***********************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Text.RegularExpressions; -using Gtk; - -namespace Novell.Security.ClientPasswordManager -{ - /// - /// Class implements user name dialog leveraging Gtk#. - /// - sealed public class usernameDialog : Dialog - { - #region Class Members and Defines - - private Entry m_userNameEntry; - private Button m_okButton; - private Button m_cancelButton; - - // The following strings need to be localized - private static string m_userNameLabelText = "User name:"; - - #endregion - - /// - /// Class implements dialog to notify user that it needs to - /// input the user name. - /// - private class inputRequiredDialog: Dialog - { - #region Class Members and Defines - - // The following strings need to be localized - private static string m_inputRequiredLabelText = "User name required"; - - #endregion - - /// - /// Constructor. - /// - /// Title to be used with the dialog. - public inputRequiredDialog(string title) : base() - { - this.Title = title; - this.HasSeparator = false; - this.Resizable = false; - this.Modal = true; - this.DefaultResponse = ResponseType.Ok; - - HBox h = new HBox(); - h.BorderWidth = 12; - h.Spacing = 6; - - Gtk.Image i = new Gtk.Image(); - i.SetFromStock(Stock.DialogError, IconSize.Dialog); - i.SetAlignment(0.5F, 0); - h.PackStart(i, false, false, 0); - - Label l = new Label("" - + m_inputRequiredLabelText - + ""); - l.LineWrap = true; - l.UseMarkup = true; - l.Selectable = false; - l.Xalign = 0; - l.Yalign = 0; - h.PackStart(l, false, false, 0); - - h.ShowAll(); - this.VBox.Add(h); - - this.AddButton(Stock.Ok, ResponseType.Ok); - } - } - - /// - /// Constructor. - /// - /// Title to use for the dialog. - public usernameDialog(string title) : base() - { - this.Title = title; - this.HasSeparator = false; - this.Resizable = false; - this.Modal = true; - - HBox h = new HBox(); - h.BorderWidth = 12; - h.Spacing = 6; - - Label l = new Label(m_userNameLabelText); - l.Xalign = 0; - h.PackStart(l, false, false, 0); - - m_userNameEntry = new Entry(); - m_userNameEntry.ActivatesDefault = true; - h.PackStart(m_userNameEntry, true, true, 0); - - h.ShowAll(); - this.VBox.Add(h); - - m_okButton = new Button(Stock.Ok); - m_okButton.CanDefault = true; - this.AddActionWidget(m_okButton, ResponseType.Ok); - - m_cancelButton = new Button(Stock.Cancel); - this.AddActionWidget(m_cancelButton, ResponseType.Cancel); - - this.DefaultResponse = ResponseType.Ok; - this.ShowAll(); - } - - /// - /// Shows the dialog and gathers the user input. - /// - /// Window owner. - /// True if the user input was gathered, else false. - public bool Invoke(Window parent) - { - bool retVal; - - while (true) - { - // Set focus on the entry widget, display the dialog, and - // hide it once it is answered. - this.Focus = m_userNameEntry; - this.TransientFor = parent; - ResponseType resp = (ResponseType) this.Run(); - this.Hide(); - - // Proceed based on the dialog response value - if (resp == ResponseType.Ok) - { - // Verify that the user entered the desired information - if (m_userNameEntry.Text.Length != 0) - { - // The user name was entered, indicate success and - // get ready to exit. - retVal = true; - break; - } - else - { - // Inform the user that it must enter a name - inputRequiredDialog errorDialog = new inputRequiredDialog(Title); - errorDialog.Run(); - errorDialog.Hide(); - - // Show the user name dialog again - continue; - } - } - else - { - // The user either hit the cancel button or closed - // the window. - retVal = false; - break; - } - } - - return retVal; - } - - /// - /// Gets the name entered by the user. - /// - /// NetworkCredential object or null if not successful - public System.String userName { get {return m_userNameEntry.Text;}} - } - - /// - /// Class wrapper around the usernameDialog class. This wrapper is utilized - /// to hide the use of Gtk# from its users. - /// - public class UsernameDialog - { - #region Class Members and Defines - - usernameDialog m_dialog; - - // The following strings need to be localized - private static string m_titleStartText = "Login to "; - private static string m_titleRealmText = ", Realm: "; - - #endregion - - /// - /// Constructor. - /// - /// Name of service on whose behalf we are acquiring user name. - public UsernameDialog(string svcName) - { - // Instantiate the dialog with the appropriate title - m_dialog = new usernameDialog(m_titleStartText + svcName); - } - - /// - /// Constructor. - /// - /// Name of service on whose behalf we are acquiring user name. - /// Name of realm to which the service belongs, can be empty string or null. - public UsernameDialog(string svcName, string realm) - { - // Instantiate the dialog with the appropriate title - if (realm != null && realm.Length != 0) - { - m_dialog = new usernameDialog(m_titleStartText + svcName + m_titleRealmText + realm); - } - else - { - m_dialog = new usernameDialog(m_titleStartText + svcName); - } - } - - /// - /// Shows the dialog and gathers the user input. - /// - /// Window owner. - /// True if the user input was gathered, else false. - public bool Invoke(System.Object o) - { - return m_dialog.Invoke((Window) o); - } - - /// - /// Gets the name entered by the user. - /// - public System.String userName { get {return m_dialog.userName;}} - } -} diff --git a/ClientPasswordManager/c-sharp-username-dialog/usernameDialog.cs b/ClientPasswordManager/c-sharp-username-dialog/usernameDialog.cs deleted file mode 100644 index d0466fff..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/usernameDialog.cs +++ /dev/null @@ -1,291 +0,0 @@ -/*********************************************************************** - * File: usernameDialog.cs - * Author: Juan Carlos Luciani (jluciani@novell.com) - * - * Namespace: Novell.Security.ClientPasswordManager - * - * Classes implemented: UsernameDialog. - * - * Copyright (C) 2004 Novell, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ***********************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Text.RegularExpressions; - -namespace Novell.Security.ClientPasswordManager -{ - /// - /// Provides a dialog for the acquisition of user names. - /// - sealed public class usernameDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.TextBox usernameField; - private System.Windows.Forms.Button okBtn; - private System.Windows.Forms.Button cancelBtn; - private System.Windows.Forms.Label label1; - - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - /// - /// Constructor. - /// - /// Title to use with dialog. - public usernameDialog(string title) - { - // Required for Windows Form Designer support - InitializeComponent(); - - // Update the form title - Text = title; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.usernameField = new System.Windows.Forms.TextBox(); - this.okBtn = new System.Windows.Forms.Button(); - this.cancelBtn = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // usernameField - // - this.usernameField.AcceptsReturn = true; - this.usernameField.Location = new System.Drawing.Point(96, 24); - this.usernameField.MaxLength = 64; - this.usernameField.Name = "usernameField"; - this.usernameField.Size = new System.Drawing.Size(224, 20); - this.usernameField.TabIndex = 5; - this.usernameField.Text = ""; - // - // okBtn - // - this.okBtn.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.okBtn.Location = new System.Drawing.Point(152, 64); - this.okBtn.Name = "okBtn"; - this.okBtn.TabIndex = 7; - this.okBtn.Text = "Ok"; - this.okBtn.Click += new System.EventHandler(this.okBtn_Click); - // - // cancelBtn - // - this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.cancelBtn.Location = new System.Drawing.Point(240, 64); - this.cancelBtn.Name = "cancelBtn"; - this.cancelBtn.TabIndex = 8; - this.cancelBtn.Text = "Cancel"; - // - // label1 - // - this.label1.Location = new System.Drawing.Point(8, 24); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(72, 16); - this.label1.TabIndex = 9; - this.label1.Text = "User name:"; - // - // usernameDialog - // - this.AcceptButton = this.okBtn; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.CancelButton = this.cancelBtn; - this.ClientSize = new System.Drawing.Size(338, 96); - this.Controls.Add(this.label1); - this.Controls.Add(this.cancelBtn); - this.Controls.Add(this.okBtn); - this.Controls.Add(this.usernameField); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "usernameDialog"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Load += new System.EventHandler(this.usernameDialog_Load); - this.Activated += new System.EventHandler(this.usernameDialog_Activated); - this.ResumeLayout(false); - - } - #endregion - - /// - /// Handler for form activation event. - /// - private void usernameDialog_Activated(object sender, System.EventArgs e) - { - usernameField.Focus(); - } - - /// - /// Handler for Ok button click event. - /// - private void okBtn_Click(object sender, System.EventArgs e) - { - // Dispose of the dialog and set DialogResult to OK - DialogResult = DialogResult.OK; - Close(); - } - - private void usernameDialog_Load(object sender, System.EventArgs e) - { - - } - - /// - /// Returns the username entered by the user. - /// - public System.String userName { get {return usernameField.Text;}} - } - - /// - /// Class wrapper around the usernameDialog class. This wrapper is utilized - /// to hide the use of Gtk# from its users. - /// - public class UsernameDialog - { - #region Class Members and Defines - - // The following strings need to be localized - private static string m_titleStartText = "Login to "; - private static string m_titleRealmText = ", Realm: "; - private static string m_inputRequiredLabelText = "User name required"; - - // Title that will be used with the dialog - private string m_dialogTitle; - - // Input gathered from the user - private string m_userName; - - #endregion - - /// - /// Constructor. - /// - /// Name of service on whose behalf we are acquiring user name. - public UsernameDialog(string svcName) - { - // Setup the title that will be used with the dialog - m_dialogTitle = m_titleStartText + svcName; - } - - /// - /// Constructor. - /// - /// Name of service on whose behalf we are acquiring user name. - /// Name of realm to which the service belongs, can be empty string or null. - public UsernameDialog(string svcName, string realm) - { - // Setup the appropriate title that will be used with the dialog - if (realm != null && realm.Length != 0) - { - m_dialogTitle = m_titleStartText + svcName + m_titleRealmText + realm; - } - else - { - m_dialogTitle = m_titleStartText + svcName; - } - } - - /// - /// Shows the dialog and gathers the user input. - /// - /// Window owner. - /// True if the user input was gathered, else false. - public bool Invoke(System.Object o) - { - bool retVal; - - while (true) - { - // Instantiate and show usernameDialog - usernameDialog dialog = new usernameDialog(m_dialogTitle); - if (dialog.ShowDialog((IWin32Window) o) == DialogResult.OK) - { - // Save the user name entered - m_userName = dialog.userName; - - // Verify that the user entered the desired information - if (m_userName.Length != 0) - { - // The user name was entered, indicate success and - // get ready to exit. - retVal = true; - - // Dispose of the dialog and exit the loop - dialog.Dispose(); - break; - } - else - { - // Inform the user that it must enter a name - MessageBox.Show((IWin32Window) o, - m_inputRequiredLabelText, - "", - MessageBoxButtons.OK, - MessageBoxIcon.Error); - - // Dispose of the dialog and continue to prompt the user - dialog.Dispose(); - continue; - } - } - else - { - // The user either hit the cancel button or closed - // the window. - retVal = false; - - // Dispose of the dialog and exit the loop - dialog.Dispose(); - break; - } - } - - return retVal; - } - - /// - /// Gets the name entered by the user. - /// - public System.String userName { get {return m_userName;}} - } -} diff --git a/ClientPasswordManager/c-sharp-username-dialog/usernameDialog.resx b/ClientPasswordManager/c-sharp-username-dialog/usernameDialog.resx deleted file mode 100644 index 73b2c66b..00000000 --- a/ClientPasswordManager/c-sharp-username-dialog/usernameDialog.resx +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - usernameDialog - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - \ No newline at end of file