WINDOWSSERVICEWRAPPER/Program.cs
/// <summary>
/// The main entry point for the application.
/// A simple wrapper app which allows the developer to see the current status of a Windows Service
/// without using Control Panel>Services.
/// The application uses a timer to refresh the "status" of a Windows Service. Obviously
/// the status can be changed manually through Control Panel>Services, but you can also use
/// this app to change the status also.
/// Nothing complicated, just a simple "right-click" context menu which allows you to start
/// and stop the service.
/// Note that the service name ( SERVICE_NAME ) is read from the App.Config, you must ensure
/// that the Windows Service itself has it's "DISPLAYNAME" property equal to the App.Config
/// setting, or else this app will not be able to find the service in the registry and conseqently
/// fire it up!!!
/// </summary>
The main entry point for the application.
A simple wrapper app which allows the developer to see the current status of a Windows Service
without using Control Panel>Services.
The application uses a timer to refresh the "status" of a Windows Service. Obviously
the status can be changed manually through Control Panel>Services, but you can also use
this app to change the status also.
Nothing complicated, just a simple "right-click" context menu which allows you to start
and stop the service.
Note that the service name ( SERVICE_NAME ) is read from the App.Config, you must ensure
that the Windows Service itself has it's "DISPLAYNAME" property equal to the App.Config
setting, or else this app will not be able to find the service in the registry and conseqently
fire it up
The main entry point for the application . A simple wrapper app which allows the developer to see the current status of a Windows Service without using Control Panel > Services . The application uses a timer to refresh the " status " of a Windows Service . Obviously the status can be changed manually through Control Panel > Services but you can also use this app to change the status also . Nothing complicated just a simple " right - click " context menu which allows you to start and stop the service . Note that the service name ( SERVICE_NAME ) is read from the App . Config you must ensure that the Windows Service itself has it ' s " DISPLAYNAME " property equal to the App . Config setting or else this app will not be able to find the service in the registry and conseqently fire it up
[STAThread]
        static void Main()
        {
            System.Diagnostics.EventLog el;
            el = new System.Diagnostics.EventLog("CC_EMAIL");
            if (!System.Diagnostics.EventLog.SourceExists("CC_EMAIL"))
            {
                System.Diagnostics.EventLog.CreateEventSource("CC_EMAIL", "CC_EMAIL");
            }
            el.Source = "CC_EMAIL";
            MailApplicationRequestsService ms = new MailApplicationRequestsService();
            ms.ServiceSendToColleague();
            return;
            System.Threading.Mutex appSingleTon = new Mutex(false, "Service Monitor");
            if (appSingleTon.WaitOne(0, false))
            {
                Application.EnableVisualStyles();
                Program.IntializeIcon();
                Microsoft.Win32.SystemEvents.SessionEnded += new
                        Microsoft.Win32.SessionEndedEventHandler(SystemEvent_SessionEnded);
                timer = new System.Timers.Timer(10000);
                timer.Elapsed += new System.Timers.ElapsedEventHandler(ServiceChecker);
                timer.Enabled = true;
                sc = new ServiceController(SERVICE_NAME);
                Application.Run();
            }
            appSingleTon.Close();
        }
[ STAThread ] static void Main ( ) { System . Diagnostics . EventLog el ; el = new System . Diagnostics . EventLog ( " " ) ; if ( ! System . Diagnostics . EventLog . SourceExists ( " " ) ) { System . Diagnostics . EventLog . CreateEventSource ( " " , " " ) ; } el . Source = " " ; MailApplicationRequestsService ms = new MailApplicationRequestsService ( ) ; ms . ServiceSendToColleague ( ) ; return ; System . Threading . Mutex appSingleTon = new Mutex ( false , " " ) ; if ( appSingleTon . WaitOne ( 0 , false ) ) { Application . EnableVisualStyles ( ) ; Program . IntializeIcon ( ) ; Microsoft . Win32 . SystemEvents . SessionEnded += new Microsoft . Win32 . SessionEndedEventHandler ( SystemEvent_SessionEnded ) ; timer = new System . Timers . Timer ( 10000 ) ; timer . Elapsed += new System . Timers . ElapsedEventHandler ( ServiceChecker ) ; timer . Enabled = true ; sc = new ServiceController ( SERVICE_NAME ) ; Application . Run ( ) ; } appSingleTon . Close ( ) ; }
The main entry point for the application.
The main entry point for the application .
//,"DEV",); //el.WriteEntry("Starting timer"); //TestMailPDF m = new TestMailPDF(); //m.WithWebClient(); //COMMENT WHEN BUILDING THE SERVICE!! //MAIL PDF //NewMailPDF m = new NewMailPDF(); //m.ServiceMail(); ////m.WithIntegrationFramework(); //return; //MAIL SUPPORT //MailSupport ms = new MailSupport(); //ms.ServiceMail(); //return; //MAIL TRY/BUY //MailTryBuy ms = new MailTryBuy(); //ms.ServiceMail(); //MAIL PARTNER PROGRAMME //MailApplicationRequestsService ms = new MailApplicationRequestsService(); //ms.ServicePartnerProgramme(); //MAIL SEND TO COLLEAGUE