Exemple #1
0
        // internal static void DestroyMutex(Mutex m, bool bReleaseFirst)
        // {
        //	if(m == null) return;
        //	if(bReleaseFirst)
        //	{
        //		try { m.ReleaseMutex(); }
        //		catch(Exception) { Debug.Assert(false); }
        //	}
        //	try { m.Close(); }
        //	catch(Exception) { Debug.Assert(false); }
        // }

        private static void ActivatePreviousInstance(string[] args)
        {
            if ((m_nAppMessage == 0) && !NativeLib.IsUnix())
            {
                Debug.Assert(false);
                return;
            }

            try
            {
                if (string.IsNullOrEmpty(m_cmdLineArgs.FileName))
                {
                    // NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST,
                    //	m_nAppMessage, (IntPtr)AppMessage.RestoreWindow, IntPtr.Zero);
                    IpcBroadcast.Send(AppMessage.RestoreWindow, 0, false);
                }
                else
                {
                    string[] vFlt = KeyUtil.MakeCtxIndependent(args);

                    IpcParamEx ipcMsg = new IpcParamEx(IpcUtilEx.CmdOpenDatabase,
                                                       CommandLineArgs.SafeSerialize(vFlt), null, null, null, null);

                    IpcUtilEx.SendGlobalMessage(ipcMsg);
                }
            }
            catch (Exception) { Debug.Assert(false); }
        }
Exemple #2
0
        private static void MainCleanUp()
        {
            IpcBroadcast.StopServer();

            EntryMenu.Destroy();

            GlobalMutexPool.ReleaseAll();

            CommonTerminate();
        }
Exemple #3
0
        private static void BroadcastAppMessageAndCleanUp(AppMessage msg)
        {
            try
            {
                // NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST,
                //	m_nAppMessage, (IntPtr)msg, IntPtr.Zero);
                IpcBroadcast.Send(msg, 0, false);
            }
            catch (Exception) { Debug.Assert(false); }

            MainCleanUp();
        }
Exemple #4
0
        private static void MainCleanUp()
        {
            IpcBroadcast.StopServer();

            if (m_tempFilesPool != null)
            {
                m_tempFilesPool.Clear();
            }

            EntryMenu.Destroy();

            AppLogEx.Close();
        }
Exemple #5
0
        private static void MainCleanUp()
        {
            IpcBroadcast.StopServer();

            if (m_tempFilesPool != null)
            {
                m_tempFilesPool.Clear();
            }

            EntryMenu.Destroy();

            GlobalMutexPool.ReleaseAll();

            CommonTerminate();
        }