//constructor public Client(string username, string client_url, string server_url, string script_file) { this.username = username; this.client_url = client_url; this.server_url = server_url; this.script_file = script_file; meetingList = new Dictionary <string, MeetingProposal>(); IServer server = (IServer)Activator.GetObject( typeof(IServer), server_url); backupServers = server.addClient(this.GetInfo()); //get meetings ListDelegate del = new ListDelegate(server.getMeetings); del.BeginInvoke(updateCallback, null); //execute script in new thread if (script_file != "") { Thread thread = new Thread(new ThreadStart(() => this.executeScript(script_file))); thread.Start(); } }
//Lists all available meetings void list() { //print meetings lock (meetingList){ foreach (KeyValuePair <string, MeetingProposal> key in meetingList) { Log.Information(key.Value.ToString()); } } //async ask for update IServer server = (IServer)Activator.GetObject( typeof(IServer), server_url); ListDelegate del = new ListDelegate(server.getMeetings); del.BeginInvoke(updateCallback, null); }