Beispiel #1
0
        public MainWindow()
        {
            try
            {
                int minWorkerThread, minCompletionPortThread;
                ThreadPool.GetMinThreads(out minWorkerThread, out minCompletionPortThread);
                ThreadPool.SetMinThreads(1000, minCompletionPortThread);



                #region window initialize
                this.Title = "CentralInterProcessCommunicationServer";
                this.MouseLeftButtonDown += (sender, e) => this.DragMove();

                this.Closing += MainWindow_Closing;
                #endregion

                #region DispatcherTimer

                dispatchertimer          = new DispatcherTimer(DispatcherPriority.Normal);
                dispatchertimer.Interval = new TimeSpan(0, 0, 1);
                dispatchertimer.Tick    += dispatchertimer_Tick;
                dispatchertimer.Start();

                #endregion DispatcherTimer

                try
                {
                    #region Minimizedwindow and debugwindow
                    this.debugwindow                = new DebugWindow();
                    this.minimizedwindow            = new MinimizedWindow();
                    this.minimizedwindow.mainwindow = this;
                    #endregion
                    #region RemoteHostServer
                    this.rhServer             = new RemoteHostServer();
                    this.rhServer.debugwindow = this.debugwindow;
                    #endregion
                    #region DataConnectionServer
                    this.DCS             = new DATA_CONNECTION.DataConnectionServer();
                    this.DCS.debugwindow = this.debugwindow;
                    #endregion
                    #region TerminalConnection
                    this.TC             = new TerminalConnection.TerminalConnection();
                    this.TC.debugwindow = this.debugwindow;
                    this.TC.RHS         = this.rhServer;
                    this.TC.DCS         = this.DCS;
                    this.TC.mainwindow  = this;
                    this.AddTCFunction();

                    this.rhServer.terminalconnection = this.TC;
                    #endregion
                    #region ProcessList
                    this.List_Processes = new List <System.Diagnostics.Process>();
                    #endregion

                    InitializeComponent();
                    debugwindow.DebugLog = "[CIPCServer]CIPCServerを開始します.";
                }
                catch (Exception ex)
                {
                    while (true)
                    {
                        myDialog dialog = new myDialog(ex.Message);
                        if (dialog.ShowDialog() == true)
                        {
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                while (true)
                {
                    myDialog dialog = new myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
        }
        public MainWindow()
        {
            try
            {
                int minWorkerThread, minCompletionPortThread;
                ThreadPool.GetMinThreads(out minWorkerThread, out minCompletionPortThread);
                ThreadPool.SetMinThreads(1000, minCompletionPortThread);

                #region window initialize
                this.Title = "CentralInterProcessCommunicationServer";
                this.MouseLeftButtonDown += (sender, e) => this.DragMove();

                this.Closing += MainWindow_Closing;
                #endregion

                #region DispatcherTimer

                dispatchertimer = new DispatcherTimer(DispatcherPriority.Normal);
                dispatchertimer.Interval = new TimeSpan(0, 0, 1);
                dispatchertimer.Tick += dispatchertimer_Tick;
                dispatchertimer.Start();

                #endregion DispatcherTimer

                try
                {
                    #region Minimizedwindow and debugwindow
                    this.debugwindow = new DebugWindow();
                    this.minimizedwindow = new MinimizedWindow();
                    this.minimizedwindow.mainwindow = this;
                    #endregion
                    #region RemoteHostServer
                    this.rhServer = new RemoteHostServer();
                    this.rhServer.debugwindow = this.debugwindow;
                    #endregion
                    #region DataConnectionServer
                    this.DCS = new DATA_CONNECTION.DataConnectionServer();
                    this.DCS.debugwindow = this.debugwindow;
                    #endregion
                    #region TerminalConnection
                    //this.TC = new TerminalConnection.TerminalConnection();
                    //this.TC.debugwindow = this.debugwindow;
                    //this.TC.RHS = this.rhServer;
                    //this.TC.DCS = this.DCS;
                    //this.TC.mainwindow = this;
                    //this.AddTCFunction();
                    this.AddRemoteOperateFunction();

                    //this.rhServer.terminalconnection = this.TC;
                    #endregion
                    #region ProcessList
                    this.List_Processes = new List<System.Diagnostics.Process>();
                    #endregion
                    this.rhServer.parent = this;
                    InitializeComponent();
                    debugwindow.DebugLog = "[CIPCServer]CIPCServerを開始します.";
                }
                catch (Exception ex)
                {
                    while (true)
                    {
                        myDialog dialog = new myDialog(ex.Message);
                        if (dialog.ShowDialog() == true)
                        {
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                while (true)
                {
                    myDialog dialog = new myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
        }