Changeset 151
- Timestamp:
- 03/08/07 17:39:15 (2 years ago)
- Files:
-
- dmp/trunk/Bridge/Bridge.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dmp/trunk/Bridge/Bridge.cs
r140 r151 106 106 } 107 107 catch { 108 return -1; 109 } 110 } 111 112 /// <summary> 113 /// Connects to the given server and eventually will get the songs from it 114 /// </summary> 115 /// <param name="zeroconfName">The Zeroconf name of the server to connect to</param> 116 /// <returns>The library id, which is referred to in the db and the 117 /// bridge's dictionary of clients or -1 if the connect fails</returns> 118 public int AddServerConnection(string zeroconfName) { 119 Dictionary<string, Service> serverList = this.getZeroconfServerList(); 120 if (serverList.ContainsKey(zeroconfName)) { 121 Service theService = serverList[zeroconfName]; 122 int result = this.AddServerConnection(theService); 123 return result; 124 } 125 else { // The UI is smoking crack 108 126 return -1; 109 127 } … … 259 277 Console.WriteLine("Connected to " + newClient.Name); 260 278 279 280 if (this.serverNameToIdList != null) { 281 this.ServerAdded(this, new ServerStatusEventArgs(newClient.Name, true)); 282 } 283 261 284 if (this.SongListChanged != null) { 262 285 DataTable newSongs = this.getAvailableSongsInCollection(); … … 282 305 if (libraryId > -1) { //Reconnect to this server 283 306 int addResult = this.AddServerConnection(newServer); 284 if (addResult > -1) {285 if (this. serverNameToIdList!= null) {286 this.ServerAdded(this, new ServerStatusEventArgs(newServer.Name, true));307 if (addResult <= -1) { //Connect failed 308 if (this.ServerAdded != null) { 309 this.ServerAdded(this, new ServerStatusEventArgs(newServer.Name, false)); 287 310 } 288 311 }
