public localFunctionContainer(string name, string desc, string help, delegateCallback callback)
 {
     this.Name     = name;
     this.Usage    = desc;
     this.Help     = help;
     this.Callback = callback;
 }
Beispiel #2
0
        public Client(ref RichTextBox textbox, ref ComboBox combobox, IPEndPoint ServerEP,
                      delegateCallback delegateCallback, delegateAddUsers addUserCallback)
        {
            this.delegateCallback = delegateCallback;
            this.addUserCallback  = addUserCallback;
            this.textbox          = textbox;
            this.combobox         = combobox;
            this.ClientsInfo      = new List <ClientInfo>();
            this.ServerCipher     = new Cipher(123);
            this.TcpClient        = new TcpClient();
            this.Cipher           = new Cipher(345);
            this.ClientsInfo      = new List <ClientInfo>();
            this.TcpClient.Connect(ServerEP.Address, ServerEP.Port);
            this.methods = new Dictionary <int, methodDelegate>()
            {
                { Const.AUDIO_MESSAGE, this.RecieveAudio },
                { Const.BROADCASTING_MESSAGE, this.RecieveBroadcasting },
                { Const.CLIENT_SHUTDOWN, this.RecieveClientShutDown },
                { Const.NEW_USER_INFO, this.RecieveNewClient },
                { Const.PRIVATE_MESSAGE, this.RecievePrivate },
                { Const.SERVER_MESSAGE, this.RecieveServerMessage }
            };
            this.stream = this.TcpClient.GetStream();
            Thread ListenThread = new Thread(new ThreadStart(this.Listen));

            ListenThread.Start();
        }
Beispiel #3
0
 /// <summary>
 /// add a cutom function for the remote comandline
 /// </summary>
 /// <param name="name">Name of the comand</param>
 /// <param name="usage">example usage </param>
 /// <param name="help">hext to be displayed by the Help command</param>
 /// <param name="callback">function to be called on execution with string array as parameter</param>
 public static void registerComand(string name, string usage, string help, delegateCallback callback)
 {
     FUNCTIONS.registerComand(name, usage, help, callback);
 }
 /// <summary>
 /// Register a ftion fpr the remote Console
 /// </summary>
 /// <param name="name"></param>
 /// <param name="usage"></param>
 /// <param name="help"></param>
 /// <param name="callback"></param>
 public void registerComand(string name, string usage, string help, delegateCallback callback)
 {
     functions.Add(name, new localFunctionContainer(name, usage, help, callback));
 }