Esempio n. 1
0
        private string RemoteAddress = Properties.Settings.Default.server_ip; // Define Network Propertys (ServerIP and commandport)

        #endregion Fields

        #region Constructors

        public SynChat()
        {
            InitializeComponent();
            // Clear all indices in chat marker array
            for(int i=0; i < 10; i++)
            {
                freechats[i] = true;
                chatbuddies[i] = "";
            }

            // Marrie the delegates with their events (needed for invokes)
            OnReceiveBuddy += new Buddy(ReceiveBuddy);
            EnableItems += new Enable(Enable_Items);
            OnReceive += new Receive(OpenChat);
            OnStatusChange += new BuddyStatus(StatusChange);
            OnStatusReceived += new RequestedStatusReceived(RequestedStatusReceive);
            OnStatusSend += new StatusSend(SendStatus);

            Client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);   // Create the Socket
            try
            {
                // Try to connect and send the port request command
                Client.Connect(IPAddress.Parse(RemoteAddress), port);
            }
            catch (SocketException)
            {
                // If that fails -> Show a error and close the Application
                MessageBox.Show("Konnte keine Verbindung zum Server herstellen!");
                debugFile.Write("Server unavaliable\r\n");
                this.Close();
            }

            // Create the Thread for the Listener and put it in the background
            Thread lis = new Thread(new ThreadStart(Listener));
            lis.IsBackground = true;
            lis.Start();

            // Remove menu entry for clearing chatlogs if chatlogs are disabled
            if (Properties.Settings.Default.client_log_conversations)
            {
                alleMitschnitteLöschenToolStripMenuItem.Visible = true;
            }
        }
Esempio n. 2
0
 public UserStatusEventArgs(string username, BuddyStatus status)
 {
     this.username = username;
     this.status = status;
 }
Esempio n. 3
0
 private void UpdateBuddyStatus(string name, BuddyStatus status)
 {
     BuddyInfo budd = _buddyList.GetBuddy(name);
     budd.Status = status;
 }
Esempio n. 4
0
 public void SendStatus(string user, BuddyStatus status)
 {
     sw.WriteLine("STATUS {0} {1}", user, status.ToString().ToUpper());
     sw.Flush();
 }
Esempio n. 5
0
 public void SendStatus(string user, BuddyStatus status)
 {
     sw.WriteLine("STATUS {0} {1}", user, status.ToString().ToUpper());
     sw.Flush();
 }
Esempio n. 6
0
        private void UpdateBuddyStatus(string name, BuddyStatus status)
        {
            BuddyInfo budd = _buddyList.GetBuddy(name);

            budd.Status = status;
        }
Esempio n. 7
0
 public UserStatusEventArgs(string username, BuddyStatus status)
 {
     this.username = username;
     this.status   = status;
 }