Пример #1
0
        void vm_CompletedConfig(object sender, EventArgs e)
        {
            if (this.startDelegate == null)
            {
                this.startDelegate = () =>
                {
                    //获取
                    var vm = sender as ViewModleMessage;
                    if (this.businessServiceHost != null)
                    {
                        this.businessServiceHost.Opened -= this.businessServiceHost_Opened;
                        this.businessServiceHost.Close();
                    }
                    if (this.crossDomainServiceHost != null)
                    {
                        this.crossDomainServiceHost.Close();
                        this.crossDomainServiceHost.Opened -= this.crossDomainServiceHost_Opened;
                    }

                    this.crossDomainServiceHost         = new ServiceHost(typeof(MDF.Service.CrossDomainService));
                    this.businessServiceHost            = new ServiceHost(typeof(MDF.Service.BusinessService));
                    this.crossDomainServiceHost.Opened += crossDomainServiceHost_Opened;
                    this.businessServiceHost.Opened    += businessServiceHost_Opened;
                    vm.DataSource[4].Message            = "正在启动跨域访问服务....";
                    vm.DataSource[4].State              = EMessageState.Run;
                    vm.DataSource[4].StartTime          = DateTime.Now;
                    this.crossDomainServiceHost.Open();
                    vm.DataSource[5].Message   = "正在启动业务服务....";
                    vm.DataSource[5].StartTime = DateTime.Now;
                    this.businessServiceHost.Open();
                    vm.DataSource[5].State = EMessageState.Run;

                    vm.DataSource[6].Message   = "正在启动远程访问服务...";
                    vm.DataSource[6].State     = EMessageState.Run;
                    vm.DataSource[6].StartTime = DateTime.Now;
                    rmtserver = new RmtServer();
                    rmtserver.Start();
                    vm.DataSource[6].State   = EMessageState.Finish;
                    vm.DataSource[6].Message = "远程服务启动完成[tcp://127.0.0.1:" + rmtserver.Port + "/" + rmtserver.SericeName + "]";
                }
            }
            ;
            this.Dispatcher.BeginInvoke(this.startDelegate);
        }

        void host_Opened(object sender, EventArgs e)
        {
        }
Пример #2
0
        void vm_CompletedConfig(object sender, EventArgs e)
        {
            if (this.startDelegate == null)
            {
                this.startDelegate = () =>
                {
                    //获取
                    var vm = sender as ViewModleMessage;
                    if (this.businessServiceHost != null)
                    {
                        this.businessServiceHost.Opened -= this.businessServiceHost_Opened;
                        this.businessServiceHost.Close();
                    }
                    if (this.crossDomainServiceHost != null)
                    {
                        this.crossDomainServiceHost.Close();
                        this.crossDomainServiceHost.Opened -= this.crossDomainServiceHost_Opened;
                    }

                    this.crossDomainServiceHost         = new ServiceHost(typeof(MDF.Service.CrossDomainService));
                    this.businessServiceHost            = new ServiceHost(typeof(MDF.Service.BusinessService));
                    this.crossDomainServiceHost.Opened += crossDomainServiceHost_Opened;
                    this.businessServiceHost.Opened    += businessServiceHost_Opened;
                    vm.DataSource[4].Message            = "正在启动跨域访问服务....";
                    vm.DataSource[4].State              = EMessageState.Run;
                    vm.DataSource[4].StartTime          = DateTime.Now;
                    this.crossDomainServiceHost.Open();
                    vm.DataSource[5].Message   = "正在启动业务服务....";
                    vm.DataSource[5].StartTime = DateTime.Now;
                    this.businessServiceHost.Open();
                    vm.DataSource[5].State = EMessageState.Run;
                }
            }
            ;
            this.Dispatcher.BeginInvoke(this.startDelegate);
        }

        void host_Opened(object sender, EventArgs e)
        {
        }