Exemple #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (SHost == null)
     {
         SServ      = new ShopService();
         SServ.mail = tbMail.Text;
         SServ.pass = tbPass.Text;
         SHost      = new ServiceHost(SServ);
         SHost.Open();
         WServ         = new WebService();
         WServ.shopSrv = SServ;
         WHost         = new ServiceHost(WServ);
         WHost.Open();
         label1.Text  = "Serviço Aberto";
         button1.Text = "Fechar Serviço";
     }
     else
     {
         SHost.Close();
         SHost        = null;
         SServ        = null;
         label1.Text  = "Serviço Fechado";
         button1.Text = "Abrir Serviço";
     }
 }
Exemple #2
0
 private void ShopServer_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (SHost != null)
     {
         SHost.Close();
         SHost = null;
         SServ = null;
     }
 }