Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using the Generic Factory
Message
 
To
02/05/2007 11:56:12
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01221251
Message ID:
01222610
Views:
17
Tim,

>in App.cs I create a reference to the factory so it is created
>Factory factory = mmAppBase.Factory;

Actually, the factory is automatically instantiated for you at the MM .NET level in mmAppBase when the application object is first instantiated.

>I add a property to the app.cs file
>public RfidReaderBase Rfid
>{
> get
> {
> if (rfid == null)
> {
> rfid = factory.CreateRfidReader();
> rfid.Initialize();
> }
> return rfid;
> }
>}
>private RfidReaderBase rfid;

That'll do it!

Best 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