public void GetInformations() { // Get the test source var testSource = Profile.FindSource(ConfigurationManager.AppSettings["Station"])[0]; // Activate ServerImplementation.EndRequest(CardServer.BeginSelect(testSource.SelectionKey)); // Create request helper var requestor = new RequestInformation(CardServer); // Remember var sources = ((GenericInformationResponse)requestor.BeginGetGroupInformation().Result).Strings.Select(s => SourceIdentifier.Parse(s)).ToArray(); // Request data foreach (var group in ((NetworkInformationResponse)requestor.BeginGetNetworkInformation().Result).Groups) { Console.WriteLine(group); } // Resolve names var names = ((GenericInformationResponse)requestor.BeginGetSourceInformation(sources).Result).Strings; // Report for (int i = 0, imax = Math.Max(sources.Length, names.Length); i < imax; i++) { Console.WriteLine("{0} => {1}", sources[i], names[i]); } }
public void GetInformations() { // Get the test source var testSource = Profile.FindSource( ConfigurationManager.AppSettings["Station"] )[0]; // Activate ServerImplementation.EndRequest( CardServer.BeginSelect( testSource.SelectionKey ) ); // Create request helper var requestor = new RequestInformation( CardServer ); // Remember var sources = ((GenericInformationResponse) requestor.BeginGetGroupInformation().Result).Strings.Select( s => SourceIdentifier.Parse( s ) ).ToArray(); // Request data foreach (var group in ((NetworkInformationResponse) requestor.BeginGetNetworkInformation().Result).Groups) Console.WriteLine( group ); // Resolve names var names = ((GenericInformationResponse) requestor.BeginGetSourceInformation( sources ).Result).Strings; // Report for (int i = 0, imax = Math.Max( sources.Length, names.Length ); i < imax; i++) Console.WriteLine( "{0} => {1}", sources[i], names[i] ); }