コード例 #1
0
 public localFunctionContainer(string name, string desc, string help, delegateCallback callback)
 {
     this.Name     = name;
     this.Usage    = desc;
     this.Help     = help;
     this.Callback = callback;
 }
コード例 #2
0
ファイル: Client.cs プロジェクト: ZhenyaStep/university_trash
        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();
        }
コード例 #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);
 }
コード例 #4
0
 /// <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));
 }