Deleted unused files
This commit is contained in:
parent
9a056cf6db
commit
4bd148608a
@ -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\<configuration>. 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("")]
|
@ -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 <jluciani@novell.com>
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
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
|
||||
|
@ -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.
|
@ -1,119 +0,0 @@
|
||||
<VisualStudioProject>
|
||||
<CSHARP
|
||||
ProjectType = "Local"
|
||||
ProductVersion = "7.10.3077"
|
||||
SchemaVersion = "2.0"
|
||||
ProjectGuid = "{AFE3BA84-436C-4DD1-BA01-3B8C6B9D125C}"
|
||||
>
|
||||
<Build>
|
||||
<Settings
|
||||
ApplicationIcon = ""
|
||||
AssemblyKeyContainerName = ""
|
||||
AssemblyName = "Novell.Security.ClientPasswordManager.UsernameDialog"
|
||||
AssemblyOriginatorKeyFile = ""
|
||||
DefaultClientScript = "JScript"
|
||||
DefaultHTMLPageLayout = "Grid"
|
||||
DefaultTargetSchema = "IE50"
|
||||
DelaySign = "false"
|
||||
OutputType = "Library"
|
||||
PreBuildEvent = ""
|
||||
PostBuildEvent = ""
|
||||
RootNamespace = "Novell.Security.ClientPasswordManager"
|
||||
RunPostBuildEvent = "OnBuildSuccess"
|
||||
StartupObject = ""
|
||||
>
|
||||
<Config
|
||||
Name = "Debug"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "DEBUG;TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "true"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "false"
|
||||
OutputPath = "bin\Debug\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "false"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "true"
|
||||
OutputPath = "bin\Release\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
</Settings>
|
||||
<References>
|
||||
<Reference
|
||||
Name = "System"
|
||||
AssemblyName = "System"
|
||||
HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Data"
|
||||
AssemblyName = "System.Data"
|
||||
HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.XML"
|
||||
AssemblyName = "System.Xml"
|
||||
HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Drawing"
|
||||
AssemblyName = "System.Drawing"
|
||||
HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Windows.Forms"
|
||||
AssemblyName = "System.Windows.Forms"
|
||||
HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
|
||||
/>
|
||||
</References>
|
||||
</Build>
|
||||
<Files>
|
||||
<Include>
|
||||
<File
|
||||
RelPath = "AssemblyInfo.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "c-sharp-username-dialog.snk"
|
||||
BuildAction = "None"
|
||||
/>
|
||||
<File
|
||||
RelPath = "usernameDialog.cs"
|
||||
SubType = "Form"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "usernameDialog.resx"
|
||||
DependentUpon = "usernameDialog.cs"
|
||||
BuildAction = "EmbeddedResource"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
@ -1,48 +0,0 @@
|
||||
<VisualStudioProject>
|
||||
<CSHARP LastOpenVersion = "7.10.3077" >
|
||||
<Build>
|
||||
<Settings ReferencePath = "" >
|
||||
<Config
|
||||
Name = "Debug"
|
||||
EnableASPDebugging = "false"
|
||||
EnableASPXDebugging = "false"
|
||||
EnableUnmanagedDebugging = "false"
|
||||
EnableSQLServerDebugging = "false"
|
||||
RemoteDebugEnabled = "false"
|
||||
RemoteDebugMachine = ""
|
||||
StartAction = "Project"
|
||||
StartArguments = ""
|
||||
StartPage = ""
|
||||
StartProgram = ""
|
||||
StartURL = ""
|
||||
StartWorkingDirectory = ""
|
||||
StartWithIE = "false"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
EnableASPDebugging = "false"
|
||||
EnableASPXDebugging = "false"
|
||||
EnableUnmanagedDebugging = "false"
|
||||
EnableSQLServerDebugging = "false"
|
||||
RemoteDebugEnabled = "false"
|
||||
RemoteDebugMachine = ""
|
||||
StartAction = "Project"
|
||||
StartArguments = ""
|
||||
StartPage = ""
|
||||
StartProgram = ""
|
||||
StartURL = ""
|
||||
StartWorkingDirectory = ""
|
||||
StartWithIE = "false"
|
||||
/>
|
||||
</Settings>
|
||||
</Build>
|
||||
<OtherProjectSettings
|
||||
CopyProjectDestinationFolder = ""
|
||||
CopyProjectUncPath = ""
|
||||
CopyProjectOption = "0"
|
||||
ProjectView = "ProjectFiles"
|
||||
ProjectTrust = "0"
|
||||
/>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
Binary file not shown.
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Class implements user name dialog leveraging Gtk#.
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Class implements dialog to notify user that it needs to
|
||||
/// input the user name.
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="title">Title to be used with the dialog.</param>
|
||||
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("<span weight=\"bold\" size=\"larger\">"
|
||||
+ m_inputRequiredLabelText
|
||||
+ "</span>");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="title">Title to use for the dialog.</param>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the dialog and gathers the user input.
|
||||
/// </summary>
|
||||
/// <param name="parent">Window owner.</param>
|
||||
/// <returns>True if the user input was gathered, else false.</returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name entered by the user.
|
||||
/// </summary>
|
||||
/// <returns>NetworkCredential object or null if not successful</returns>
|
||||
public System.String userName { get {return m_userNameEntry.Text;}}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class wrapper around the usernameDialog class. This wrapper is utilized
|
||||
/// to hide the use of Gtk# from its users.
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="svcName">Name of service on whose behalf we are acquiring user name.</param>
|
||||
public UsernameDialog(string svcName)
|
||||
{
|
||||
// Instantiate the dialog with the appropriate title
|
||||
m_dialog = new usernameDialog(m_titleStartText + svcName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="svcName">Name of service on whose behalf we are acquiring user name.</param>
|
||||
/// <param name="realm">Name of realm to which the service belongs, can be empty string or null.</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the dialog and gathers the user input.
|
||||
/// </summary>
|
||||
/// <param name="o">Window owner.</param>
|
||||
/// <returns>True if the user input was gathered, else false.</returns>
|
||||
public bool Invoke(System.Object o)
|
||||
{
|
||||
return m_dialog.Invoke((Window) o);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name entered by the user.
|
||||
/// </summary>
|
||||
public System.String userName { get {return m_dialog.userName;}}
|
||||
}
|
||||
}
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a dialog for the acquisition of user names.
|
||||
/// </summary>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="title">Title to use with dialog.</param>
|
||||
public usernameDialog(string title)
|
||||
{
|
||||
// Required for Windows Form Designer support
|
||||
InitializeComponent();
|
||||
|
||||
// Update the form title
|
||||
Text = title;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (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.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
|
||||
|
||||
/// <summary>
|
||||
/// Handler for form activation event.
|
||||
/// </summary>
|
||||
private void usernameDialog_Activated(object sender, System.EventArgs e)
|
||||
{
|
||||
usernameField.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handler for Ok button click event.
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the username entered by the user.
|
||||
/// </summary>
|
||||
public System.String userName { get {return usernameField.Text;}}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class wrapper around the usernameDialog class. This wrapper is utilized
|
||||
/// to hide the use of Gtk# from its users.
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="svcName">Name of service on whose behalf we are acquiring user name.</param>
|
||||
public UsernameDialog(string svcName)
|
||||
{
|
||||
// Setup the title that will be used with the dialog
|
||||
m_dialogTitle = m_titleStartText + svcName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="svcName">Name of service on whose behalf we are acquiring user name.</param>
|
||||
/// <param name="realm">Name of realm to which the service belongs, can be empty string or null.</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the dialog and gathers the user input.
|
||||
/// </summary>
|
||||
/// <param name="o">Window owner.</param>
|
||||
/// <returns>True if the user input was gathered, else false.</returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name entered by the user.
|
||||
/// </summary>
|
||||
public System.String userName { get {return m_userName;}}
|
||||
}
|
||||
}
|
@ -1,166 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
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">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</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 forserialized 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.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:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="usernameField.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="usernameField.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="usernameField.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="okBtn.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="okBtn.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="okBtn.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="cancelBtn.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="cancelBtn.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="cancelBtn.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="$this.Name">
|
||||
<value>usernameDialog</value>
|
||||
</data>
|
||||
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>(Default)</value>
|
||||
</data>
|
||||
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>8, 8</value>
|
||||
</data>
|
||||
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>80</value>
|
||||
</data>
|
||||
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user