Ejemplo n.º 1
0
        //-----------------

        public MyAeSession(string url) : base(url)
        {
            StateChangeCompleted            += new StateChangeEventHandler(HandleStateChangeCompleted);
            PerformStateTransitionCompleted += new PerformStateTransitionEventHandler(HandlePerformObjectStateTransitionCompleted);
            ShutdownRequest          += new ShutdownEventHandler(HandleShutdown);
            GetServerStatusCompleted += new GetStatusEventHandler(HandleGetStatusCompleted);
        }
        static public void Run(ITunesHandler handler, Form mainForm, string[] commandLine)
        {
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            StartupNextInstanceEventHandler startupNextInstanceEventHandler = new StartupNextInstanceEventHandler(app_StartupNextInstance);
            ShutdownEventHandler            shutdownEventHandler            = new ShutdownEventHandler(app_Shutdown);

            SingleInstanceApplication.Run(mainForm, commandLine, startupNextInstanceEventHandler, shutdownEventHandler);
        }
 public static void Run(Form mainForm, string[] commandLine, StartupNextInstanceEventHandler startUpNextInstanceEventHandler, ShutdownEventHandler shutdownEventHandler)
 {
     SingleInstanceApplication app = new SingleInstanceApplication();
     if (startUpNextInstanceEventHandler != null) app.StartupNextInstance += startUpNextInstanceEventHandler;
     if (shutdownEventHandler != null) app.Shutdown += shutdownEventHandler;
     if (mainForm != null) app.MainForm = mainForm;
     app.Run(commandLine);
     app.OnShutdown();
 }
        static public void Run(ITunesHandler handler, Form mainForm, string[] commandLine)
        {
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            StartupNextInstanceEventHandler startupNextInstanceEventHandler = new StartupNextInstanceEventHandler(app_StartupNextInstance);
            ShutdownEventHandler shutdownEventHandler = new ShutdownEventHandler(app_Shutdown);

            SingleInstanceApplication.Run(mainForm, commandLine, startupNextInstanceEventHandler, shutdownEventHandler);
        }
Ejemplo n.º 5
0
        //-----------------

        public MyDaSession(string url) : base(url)
        {
            StateChangeCompleted            += new StateChangeEventHandler(HandleStateChanged);
            PerformStateTransitionCompleted += new PerformStateTransitionEventHandler(HandlePerformStateTransition);
            ShutdownRequest    += new ShutdownEventHandler(HandleServerShutdown);
            ReadCompleted      += new SessionReadEventHandler(HandleSessionReadCompleted);
            WriteCompleted     += new SessionWriteEventHandler(HandleSessionWriteCompleted);
            GetStatusCompleted += new GetStatusEventHandler(HandleGetServerStatus);
        }
        public static void Run(Form mainForm, string[] commandLine, StartupNextInstanceEventHandler startUpNextInstanceEventHandler, ShutdownEventHandler shutdownEventHandler)
        {
            SingleInstanceApplication app = new SingleInstanceApplication();

            if (startUpNextInstanceEventHandler != null)
            {
                app.StartupNextInstance += startUpNextInstanceEventHandler;
            }
            if (shutdownEventHandler != null)
            {
                app.Shutdown += shutdownEventHandler;
            }
            if (mainForm != null)
            {
                app.MainForm = mainForm;
            }
            app.Run(commandLine);
            app.OnShutdown();
        }