Ejemplo n.º 1
0
        void GetTablesResponseMessageHandler(GetTablesResponseMessage message)
        {
            GetTablesResponseMessage GTRM = (GetTablesResponseMessage)message;

            Console.WriteLine("GetTablesResponseMessage received");
            if (GTRM.Exception != null)
            {
                Console.WriteLine("GTRM.Exception: ");
                Console.WriteLine(GTRM.Exception);
            }
            foreach (Table t in GTRM.Tables)
            {
                Guid reqID = Guid.NewGuid();
                lock (tables) {
                    tables.Add(reqID, new Tuple <Table, List <Column> > (t, new List <Column> ()));
                }
                tableColumns.GetOrAdd(t, (tref) => new System.Collections.Concurrent.BlockingCollection <Column> ());
                Console.WriteLine(t.Name);
                agent.SendMessage(new GetColumnsRequestMessage(reqID, t.ID));
                AREGetColumns.WaitOne();
            }
            db.Close();
        }
Ejemplo n.º 2
0
Archivo: Client.cs Proyecto: vebin/BD2
 void GetTablesResponseMessageHandler(GetTablesResponseMessage message)
 {
     GetTablesResponseMessage GTRM = (GetTablesResponseMessage)message;
     Console.WriteLine ("GetTablesResponseMessage received");
     if (GTRM.Exception != null) {
         Console.WriteLine ("GTRM.Exception: ");
         Console.WriteLine (GTRM.Exception);
     }
     foreach (Table t in GTRM.Tables) {
         Guid reqID = Guid.NewGuid ();
         lock (tables) {
             tables.Add (reqID, new Tuple<Table, List<Column>> (t, new List<Column> ()));
         }
         tableColumns.GetOrAdd (t, (tref) => new System.Collections.Concurrent.BlockingCollection<Column> ());
         Console.WriteLine (t.Name);
         agent.SendMessage (new GetColumnsRequestMessage (reqID, t.ID));
         AREGetColumns.WaitOne ();
     }
     db.Close ();
 }
Ejemplo n.º 3
0
 void GetTablesRequestMessageReceived(ObjectBusMessage obj)
 {
     Console.WriteLine ("GetTablesRequestMessageReceived()");
     GetTablesRequestMessage request = (GetTablesRequestMessage)obj;
     GetTablesResponseMessage response;
     try {
         response = new GetTablesResponseMessage (request.ID, (new List<Table> (getTables ())).ToArray (), null);
     } catch (Exception ex) {
         response = new GetTablesResponseMessage (request.ID, new Table[0] { }, ex);
     }
     ObjectBusSession.SendMessage (response);
 }