Exemplo n.º 1
0
    public void Leave()
    {
        Timer1.StopTimer();

        if (Session["userName"] != null)
        {
            string name = (string)Session["userName"];
            xmll.Leave(name, DateTime.Now);

            LabelError.Text = "Offline";
        }
    }
Exemplo n.º 2
0
    void Timer1_Tick(object sender, EventArgs e)
    {
        if (Session["userName"] != null)
        {
            IAsyncResult resultN = callerNames.BeginInvoke(null, null);
            if (!resultN.IsCompleted)
            {
                callerNames.EndInvoke(resultN);
            }

            IAsyncResult resultM = callerMessages.BeginInvoke(null, null);
            if (!resultM.IsCompleted)
            {
                callerMessages.EndInvoke(resultM);
            }
            TextBoxType2.Focus();
        }
        else
        {
            Timer1.StopTimer();
            TextBoxType2.Text = "You have to join with a name first..";
        }
    }