| | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Yesterday @ 7:31:07 PM Posts: 1,241, Visits: 3,131 |
| OK, I lied, I have another question (in addition to the one in the previous post).
Wouldn't the BeforeSessionLock event be the place to handle special stuff related to locking/logging in? I.e. I could set a flag in the MyApplication class (to continue with your example) to indicate that its session locking, I could save/undo changes to forms as needed etc (likely calling static methods in the MyApplication class). Then the login form would be cleaner and only have to deal with exiting. And would the best place to handle this event be in the MyApplication class? Am I really starting to get this!??!!? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 4:17:19 AM Posts: 4,379, Visits: 4,420 |
| Is using the "End" statement in vb enough? This is the ultimate "SHUT DOWN NOW" command Calling this will shut down the message pumps and logically exit the process. Application.Exit() will not work (properly anyway) because you are running through an SF application. We always create a shared ShutDown method that does everything we need it to. This was we can access from more than one location if need be. Wouldn't the BeforeSessionLock event be the place to handle special stuff related to locking/logging in? If this meets your needs then sure. The way I mentioned earlier would just give you the ability to shut down your application from anywhere if you needed to. Am I really starting to get this!??!!? I believe you are |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Yesterday @ 7:31:07 PM Posts: 1,241, Visits: 3,131 |
| OK, I'm definitely getting it. I added an ExitApp method to my sealed static MyApplication class. I call it from the login form and will be calling it from any other place I need to shut down code (like the unhandled exception handler). I'm using BeforeSessionLock to handle any closing/saving/undoing of forms. AfterSessionLock to clear a flag that indicates that the session is locked (unless this is already available somewhere and I missed it). |
| |
|
|