示例#1
0
 /// <summary>The Close Session button click event handler</summary>
 /// <param name="sender">Sender object</param>
 /// <param name="e">Event arguments</param>
 private void closeSessionButton_Click(object sender, EventArgs e)
 {
     //call the web service
     using (XmlNetworkFloatingService webservice = new XmlNetworkFloatingService())
     {
         webservice.Url = ConfigurationManager.AppSettings["NetworkFloatingServiceEndpointUrl"];
         if (!m_NetworkSession.CloseSession(webservice))
         {
             MessageBox.Show(this, "The session could not be closed. " + m_NetworkSession.LastError.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
         }
     }
     this.m_NetworkSession.ClearSession();
     this.RefreshSessionInformation();
 }