Ejemplo n.º 1
0
        public void run()
        {
            stream = client.GetStream();
            reader = new StreamReader(stream);
            writer = new StreamWriter(stream);

            sendMessage("1");

            String[] parts;
            while (true)
            {
                String str = reader.ReadLine();
                if (str != null)
                {
                    parts = str.Split(new char[] { (char)29 });

                    if(parts.Length == 1)
                    {
                        int value = int.Parse(parts[0]);
                        DataEventArgs args = new DataEventArgs();
                        args.setDataType("fox");
                        args.setDivision(value-1);
                        Listener(this, args);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void FireEvent(String type, int division = -1)
 {
     if (Listeners != null)
     {
         DataEventArgs args = new DataEventArgs();
         args.setDataType(type);
         args.setDivision(division);
         Listeners(this, args);
     }
 }