示例#1
0
        public void SignOn(string name, Callback Receive, Interact visuals)
        {
            // Add the Colleague to the delegate chain
            Respond += Receive;
            new Thread((ParameterizedThreadStart) delegate(object o)
            {
                visuals.InputEvent += Send;
                Application.Run(visuals);
            }).Start(this);

            // Wait to load the GUI
            while (visuals == null || !visuals.IsHandleCreated)
            {
                Application.DoEvents();
                Thread.Sleep(100);
            }
        }
示例#2
0
 public Colleague(Mediator mediator, string name)
 {
     this.name = name; visuals = new Interact(name);
     mediator.SignOn(name, Receive, visuals);
 }