コード例 #1
0
ファイル: Program.cs プロジェクト: sev-it/asp.net
        static void Main(string[] args)
        {
            Connection myConnection1 = new Connection();
            myConnection1.Name = "First connection";

            Display myDisplay = new Display();
            myConnection1.MessageArrived += new MessageHandler(myConnection1.CheckForMessage);
            myConnection1.Connect();

            Console.ReadKey(); 
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ktjones/BVCS2012
 static void Main(string[] args)
 {
     Connection myConnection1 = new Connection();
      myConnection1.Name = "First connection.";
      Connection myConnection2 = new Connection();
      myConnection2.Name = "Second connection.";
      Display myDisplay = new Display();
      myConnection1.MessageArrived += myDisplay.DisplayMessage;
      myConnection2.MessageArrived += myDisplay.DisplayMessage;
      myConnection1.Connect();
      myConnection2.Connect();
      System.Threading.Thread.Sleep(200);
      Console.ReadKey();
 }