Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overriding a factory class?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00923516
Message ID:
00925832
Views:
13
>MM question :
>
>MM has a User Manager, it has several distinct AuthenticateUser methods.
>I created a new class based off of the MM class
>my class is as follows :
>
>
>class a4uUserManager : mmUserManager
>
>
>in this class I override the AuthenticateUser item with my Own as follows :
>
>
>public override bool AuthenticateUser(string companyID, string userID, string password)
>{
>	this.DatabaseKey = mmAppBase.AppSettingsMgr.GetSetting("SecurityDatabaseKey");
>	return this.AuthenticateUser(companyID,userID,password,this.DatabaseKey);
>}
>
>
>In there literature it says to override the Factory base class item for the mmUserManager
>So I went in my small app and override's the mmUserManager as follows :
>
>public class Factory : OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
>{
>	public override mmUserManager CreateUserManager()
>	{
>		return new a4uUserManager();
>	}
>
>}
>
>
>After I have done all of this on the button I want to call my AuthenticateUser Method
>MM calls the AuthenticateUser method as follows :
>
>this.Authenticated = mmAppBase.UserMgr.AuthenticateUser(
>	this.txtUserID.Text.Trim(),
>	this.txtPassword.Text.Trim(),
>	databaseKey
>	);
>
>
>when I type mmAppBase.UserMgr. intellisense never picks up my authenticateUser Method
>even though I inherited from mmUserManager and Overrode a method to cal my method which accepts 4 parameters.

The reason you don't see your new custom method in IntelliSense is because mmAppBase.UserMgr is of type mmUserManager. If you want to see your custom method you need to cast the User Manager to your custom class. For example:
a4UserManager UserMgr = (a4UserManager)mmAppBase.UserMgr;
>Why I am trying to do this is that I am going to have one security database and several application databases.
>Once the user logs in I will know what database to connect to.
>
>My users can't connect to a common app database, because they want the data segregated from other users eyes...security ISSUE in the data portion.

If I understand you correctly, you should be able to accomplish this without changing MM .NET by using database sets. Check out the MM .NET Dev Guide topic "Specifying Database Sets in the Config File".

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform