Modal dialog before shell view loads

Topics: CAB & Smart Client Software Factory
Aug 19, 2006 at 2:11 AM
originally posted by: mansica

I want to show a login dialog when my app starts. If correct credentials the shell view should load. If the user press cancel the application shoul unload. How do I accomplish this? Where should the login form reside?
Aug 19, 2006 at 2:22 AM
originally posted by: DapinderSingh

The login dialog should be in the application.cs file as shown below

STAThread
public static void Main()
{
LoginDialog dlg = new LoginDialog();
DialogResult dlgRes = dlg.ShowDialog();
if dlgRes == DialogResult.Cancel
return;

new application().Run();
}
Aug 19, 2006 at 5:33 AM
originally posted by: MiniMe

An alternate is to create an implementation of the IAuthenticationService, and register your implementation after removing the default implementation of IAuthenticationService. You can do that add/remove service in SmartClientApplication.cs. There is an example of how to do this in one of the reference implementations, i think the BankTeller app has an example of this.
Aug 20, 2006 at 1:36 PM
originally posted by: PauloMorgado

Or you can use the services element in the App.config file. This way, you can change authentication services without changing the application.
Sep 26, 2006 at 12:41 AM
originally posted by: mansica

I chose to implement a service and got it working. This service returns a user transport when sucessfull. How do I make this transport available allover the framework.
I.e. I want to be able to access currently logged in user from any view, module, service whatever.