package com.jnbridge.javaclient;

import com.jnbridge.jnbcore.*;

import System.Collections.Generic.*;   
//引用Proxy.jar包内System.Collection.Generice.*空间里面的代理类

import Manager.*;
import Model.*;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try{
		//注册JNBridge的TCP配置文件jnbcore_tcp.properties
		DotNetSide.init("E:\\Java Projects\\JNBridge JAVA\\JAVA Client\\bin\\jnbcore_tcp.properties");
		
        PersonManager personManager=new PersonManager();
        //注意此List_1是Proxy.jar包内System.Collections.Generic.List的代理类，而并非JDK内自带的List类
        List__1 personList=personManager.GetList();
        if(personList.Get_Count()!=0){
        	//注意此Get_Count()方法是Proxy.jar包内System.Collections.Generic.List代理类的GetCount()方法
        	for(int n=0;n<personList.Get_Count();n++){
        	    Person person=(Person)personList.Get_Item(n);
              	System.out.println("Id:"+person.Get_ID()+" Age:"+person.Get_Age()+" Name:"+person.Get_Name());  
        	}
        }
		}catch(Exception ex){
			ex.printStackTrace();
		}
	}
}
