コード例 #1
0
        private void SetLocationRequest(LocationRequest request)
        {
            TableLayout table = FindViewById <TableLayout>(Resource.Id.callback_table_layout_show);
            Dictionary <string, string> paramList = new Dictionary <string, string>();

            TableRow[] rows = new TableRow[table.ChildCount];
            for (int i = 0; i < rows.Length; i++)
            {
                rows[i] = (TableRow)table.GetChildAt(i);
                paramList[((TextView)rows[i].GetChildAt(0)).Text] = ((EditText)rows[i].GetChildAt(1)).Text;
            }
            request.SetPriority(int.Parse(paramList[LocationRequestConstants.Priority]));
            request.SetInterval(long.Parse(paramList[LocationRequestConstants.Interval]));
            request.SetFastestInterval(long.Parse(paramList[LocationRequestConstants.FastestInterval]));
            request.SetExpirationTime(long.Parse(paramList[LocationRequestConstants.ExpirationTime]));
            request.SetExpirationDuration(long.Parse(paramList[LocationRequestConstants.ExpirationDuration]));
            request.SetNumUpdates(int.Parse(paramList[LocationRequestConstants.NumUpdates]));
            request.SetSmallestDisplacement(float.Parse(paramList[LocationRequestConstants.SmallestDisplacement]));
            request.SetMaxWaitTime(long.Parse(paramList[LocationRequestConstants.MaxWaitTime]));
            request.SetNeedAddress(bool.Parse(paramList[LocationRequestConstants.NeedAddress]));
            request.SetLanguage(paramList[LocationRequestConstants.Language]);
            request.SetCountryCode(paramList[LocationRequestConstants.CountryCode]);
        }