private SearchView _searchView; private ListView _listView; private ArrayAdapter _adapter; private DataTransferProcClient _client; public static readonly EndpointAddress EndPoint = new EndpointAddress("http://192.168.1.1:3190/DataTransferProcClient.svc"); #region onCreate protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Load the UI defined in Location.axml SetContentView(Resource.Layout.location); InitializeDataCounty(); } private void InitializeDataCounty() { BasicHttpBinding binding = CreateBasicHttp(); _client = new DataTransferProcClient(binding, EndPoint); _client.GetCountiesDataCompleted += ClientOnDataTransferProcCompleted; } private static BasicHttpBinding CreateBasicHttp() { BasicHttpBinding binding = new BasicHttpBinding { Name = "basicHttpBinding", MaxBufferSize = 2147483647, MaxReceivedMessageSize = 2147483647 }; TimeSpan timeout = new TimeSpan(0, 0, 30); binding.SendTimeout = timeout; binding.OpenTimeout = timeout; binding.ReceiveTimeout = timeout; return binding; } private void ClientOnDataTransferProcCompleted(object sender, GetCountiesDataCompletedEventArgs getCountiesDataCompletedEventArgs) { string msg = null; if (getCountiesDataCompletedEventArgs.Error != null) { msg = getCountiesDataCompletedEventArgs.Error.Message; } else if (getCountiesDataCompletedEventArgs.Cancelled) { msg = "Request was cancelled."; } else { msg = getCountiesDataCompletedEventArgs.Result.ToString(); } RunOnUiThread(() => msg); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)