| 36 | | this.myServiceLocator = new ServiceLocator(); |
|---|
| 37 | | this.myServiceLocator.ShowLocalServices = true; |
|---|
| 38 | | this.myServiceLocator.Start(); |
|---|
| 39 | | DataTable dbServers = db.getServersInCollection(); |
|---|
| 40 | | System.Threading.Thread.Sleep(2000); |
|---|
| 41 | | Dictionary<String, Service> whatDAAPFound = this.getZeroconfServerList(); |
|---|
| 42 | | foreach (DataRow row in dbServers.Rows) { |
|---|
| 43 | | string serverName = (string) row["name"]; |
|---|
| 44 | | Console.WriteLine("Trying to connect to " + serverName); |
|---|
| 45 | | if (whatDAAPFound.ContainsKey(serverName)) { |
|---|
| 46 | | Service newServer = whatDAAPFound[serverName]; |
|---|
| 47 | | this.AddServerConnection(newServer); |
|---|
| 48 | | } |
|---|
| 49 | | else { |
|---|
| 50 | | Console.WriteLine("Couldn't find " + serverName); |
|---|
| 51 | | } |
|---|
| 52 | | } |
|---|
| 53 | | } |
|---|
| | 38 | this.myServiceLocator = new ServiceLocator(); |
|---|
| | 39 | this.myServiceLocator.ShowLocalServices = true; |
|---|
| | 40 | this.myServiceLocatorStarted = false; |
|---|
| | 41 | } |
|---|
| | 42 | |
|---|
| | 43 | |
|---|
| | 44 | /// <summary> |
|---|
| | 45 | /// Starts the service locator if it has not been started. Performs service locating |
|---|
| | 46 | /// to connect to new servers. |
|---|
| | 47 | /// </summary> |
|---|
| | 48 | public void performServiceLocation() |
|---|
| | 49 | { |
|---|
| | 50 | if (!this.myServiceLocatorStarted) |
|---|
| | 51 | { |
|---|
| | 52 | this.myServiceLocatorStarted = true; |
|---|
| | 53 | this.myServiceLocator.Start(); |
|---|
| | 54 | } |
|---|
| | 55 | |
|---|
| | 56 | DataTable dbServers = db.getServersInCollection(); |
|---|
| | 57 | System.Threading.Thread.Sleep(2000); |
|---|
| | 58 | Dictionary<String, Service> whatDAAPFound = this.getZeroconfServerList(); |
|---|
| | 59 | foreach (DataRow row in dbServers.Rows) |
|---|
| | 60 | { |
|---|
| | 61 | string serverName = (string)row["name"]; |
|---|
| | 62 | Console.WriteLine("Trying to connect to " + serverName); |
|---|
| | 63 | if (whatDAAPFound.ContainsKey(serverName)) |
|---|
| | 64 | { |
|---|
| | 65 | Service newServer = whatDAAPFound[serverName]; |
|---|
| | 66 | this.AddServerConnection(newServer); |
|---|
| | 67 | } |
|---|
| | 68 | else |
|---|
| | 69 | { |
|---|
| | 70 | Console.WriteLine("Couldn't find " + serverName); |
|---|
| | 71 | } |
|---|
| | 72 | } |
|---|
| | 73 | } |
|---|
| | 74 | |
|---|