コード例 #1
0
 private static void CloseThisApplication()
 {
     SendCloseAppplicationMessage();
     new System.Threading.Thread(() =>
                                 Application.Current.Dispatcher.Invoke(DispatcherPriority.ApplicationIdle, new Action(() =>
     {
         if (GNetPipeHelper != null)
         {
             GNetPipeHelper.Stop(); GNetPipeHelper = null;
         }
     }))).Start();
 }
コード例 #2
0
 protected override void OnExit(ExitEventArgs e)
 {
     try
     {
         SendCloseAppplicationMessage();
         if (GNetPipeHelper != null)
         {
             GNetPipeHelper.Stop(); GNetPipeHelper = null;
         }
         base.OnExit(e);
     }
     catch { }
 }
コード例 #3
0
 public static void CreateNetPipeService()
 {
     NetPipeHelper = new NetPipeHelper(true, AppName);
     NetPipeHelper.DealMessageFunc += mNetPipeHelper_DealMessageFunc;
     try
     {
         NetPipeHelper.Start();
         //ShowInfoMessage(string.Format("Service started."));
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(string.Format("Start service fail.\t{0}", ex.Message));
     }
 }
コード例 #4
0
 void LoginPage_Loaded(object sender, RoutedEventArgs e)
 {
     mNetPipeHelper = new NetPipeHelper(true, string.Empty);
     mNetPipeHelper.DealMessageFunc += mNetPipeHelper_DealMessageFunc;
     try
     {
         mNetPipeHelper.Start();
         OnShowMessage(string.Format("Service started."));
     }
     catch (Exception ex)
     {
         OnShowMessage(string.Format("Start service fail.\t{0}", ex.Message));
     }
 }
コード例 #5
0
 private static void CreateNetPipeService()
 {
     NetPipeHelper = new NetPipeHelper(true, Session.SessionID);
     NetPipeHelper.DealMessageFunc += mNetPipeHelper_DealMessageFunc;
     try
     {
         NetPipeHelper.Start();
         WriteLog("NetPipe", string.Format("NetPipe service created.\t{0}", Session.SessionID));
     }
     catch (Exception ex)
     {
         WriteLog("NetPipe", string.Format("Start service fail.\t{0}", ex.Message));
     }
 }
コード例 #6
0
ファイル: IndexPage.xaml.cs プロジェクト: chenmj201601/UMP
 private void CreateNetPipeService()
 {
     mNetPipeHelper = new NetPipeHelper(true, string.Empty);
     mNetPipeHelper.DealMessageFunc += mNetPipeHelper_DealMessageFunc;
     try
     {
         mNetPipeHelper.Start();
         OnShowMessage(string.Format("Service started."));
     }
     catch (Exception ex)
     {
         OnShowMessage(string.Format("Start service fail.\t{0}", ex.Message));
     }
 }
コード例 #7
0
 public virtual void Exit()
 {
     RemoveView();
     if (NetPipeHelper != null)
     {
         NetPipeHelper.Stop();
         NetPipeHelper = null;
     }
     WriteLog("AppExit", string.Format("App ended."));
     if (mLogOperator != null)
     {
         mLogOperator.Stop();
         mLogOperator = null;
     }
 }
コード例 #8
0
 private static void CreateNetPipeClient()
 {
     try
     {
         GNetPipeHelper = new NetPipeHelper(false, GClassSessionInfo.SessionID);
         GNetPipeHelper.DealMessageFunc += GNetPipeHelper_DealMessageFunc;
         GNetPipeHelper.Start();
     }
     catch (Exception ex)
     {
         if (GNetPipeHelper != null)
         {
             GNetPipeHelper.Stop();
         }
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #9
0
ファイル: MainPage.xaml.cs プロジェクト: chenmj201601/UMP
        private void CreateNetPipeService()
        {
            if (mNetPipeHelper != null)
            {
                mNetPipeHelper.Stop();
            }
            mNetPipeHelper = new NetPipeHelper(false, mClientID);
            mNetPipeHelper.DealMessageFunc += mNetPipeHelper_DealMessageFunc;
            var result = mNetPipeHelper.Start();

            if (result)
            {
                OnShowMessage(string.Format("NetPipe service created."));
            }
            else
            {
                OnShowMessage(string.Format("Create NetPipe service fail."));
            }
        }
コード例 #10
0
 protected override void OnExit(ExitEventArgs e)
 {
     StopGCCollectThread();
     if (mBoot != null)
     {
         mBoot.Close();
     }
     if (NetPipeHelper != null)
     {
         NetPipeHelper.Stop();
         NetPipeHelper = null;
     }
     TempDataRecylce();      //程序退出的时候回删临时文件
     WriteLog("AppExit", string.Format("App ended."));
     if (mLogOperator != null)
     {
         mLogOperator.Stop();
         mLogOperator = null;
     }
     base.OnExit(e);
 }