I am trying to create Global.asax in Winform. I could do this in ASP.NET, but I could not find a way for Windows Application. Any help would be appreciated.
I have a singleton class called DataAccessLayer, I need to instantiate it only once, so I can easily call its method / properties anywhere in the application.
You cannot add Global.asaxwinform to the application in the same way you cannot add a page aspx. They are parts of web forms.
Global.asax
aspx
Global.asax - . Main() winform.
Main()
, Global.asax Asp.NET. ? .
, global.asax - . , . , , , .
, Global.cs .
My DataAccessLayer class is set to Singleton (sealed)
It looks like you want to load global variables and then execute and unload when the program ends.Use a static class, such as the mentioned Oded.You can also see the Application.ApplicationExit event for the equivalent of Application_End and Session_End http://msdn.microsoft.com/en-us/library/system.windows.forms.application.applicationexit.aspx
Source: https://habr.com/ru/post/1745853/More articles:Twitter xAuth vs. open source - open-sourceNew Objective C Developer Question - objective-cPHP Checking slave status without timeouts mysql_connect - phpРешение комбинационных проблем с LINQ/.NET4 - performanceActiveRecord attribute override - ruby | fooobar.comHow to highlight available days in a calendar control in WPF? - wpfOpenGLES iPhone Textures - color scheme - iphonehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1745856/how-to-stop-django-from-adding-extra-html-elements-to-rendered-widgets&usg=ALkJrhj3xuaboolqJko2FeKuifznT5dH8AПеремещение по divs в интервале - jQuery - jqueryUsing a variable name in XMLHttpRequest - jqueryAll Articles