Changeset 16278

Show
Ignore:
Timestamp:
04/29/08 18:15:47 (4 months ago)
Author:
everaldo
Message:

Fix connection sample according with last bindings changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/apis/mono/samples/ConnectionSample.cs

    r16238 r16278  
    1 /*  
    2  * Midgard# - Midgard bindings for Mono 
    3  * 
    4  * Copyright (C) 2007 Everaldo Canuto <everaldo@simios.org> 
    5  * 
    6  * This program is free software; you can redistribute it and/or modify it 
    7  * under the terms of the GNU Lesser General Public License as published 
    8  * by the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  *  
    11  * This program is distributed in the hope that it will be useful, 
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    14  * GNU General Public License for more details. 
    15  *  
    16  * You should have received a copy of the GNU General Public License 
    17  * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    19  */ 
    20  
    211using System; 
    222using Midgard; 
     
    299                { 
    3010                        Console.WriteLine ("Midgard Connection Sample"); 
    31                         Console.WriteLine (""); 
    32                          
    33                         // TODO: Implement a connection sample :) 
    34                          
    35                         Config cfg = new Config (); 
    36                         cfg.SaveFile ("test", true); 
    3711 
    38                         Connection conn = new Connection (); 
     12                        Midgard.Context.Init (); 
     13                        Midgard.Connection conn = new Midgard.Connection (); 
    3914 
    40                         //if (!conn.Open ("midgard", null)) { 
    41                         //      Console.WriteLine ("Fail to connect!"); 
    42                         //      return; 
    43                         //} 
    44                         Console.WriteLine ("End."); 
     15                        if (!conn.Open ("monotest")) 
     16                                Console.WriteLine ("Fail to connect!"); 
     17                        else 
     18                                Console.WriteLine ("Connection opened"); 
    4519                } 
    4620        }