コード例 #1
0
ファイル: DownloadHelper.cs プロジェクト: mokth/merpV3
        void _client_GetRunnoCompleted(object sender, GetRunnoCompletedEventArgs e)
        {
            List <RunnoInfo> list    = new List <RunnoInfo> ();
            string           msg     = null;
            bool             success = true;

            if (e.Error != null)
            {
                msg     = e.Error.Message;
                success = false;
            }
            else if (e.Cancelled)
            {
                msg     = CallingActivity.Resources.GetString(Resource.String.msg_reqcancel);
                success = false;
            }
            else
            {
                list = e.Result.ToList <RunnoInfo>();
                RunOnUiThread(() => InsertRunoIntoDb(list));
            }
            if (!success)
            {
                RunOnUiThread(() => Downloadhandle.Invoke(CallingActivity, 0, msg));
                if (_downloadAll)
                {
                    _downloadAll = false;
                    FireEvent(EventID.LOGIN_DOWNCOMPLETE);
                }
            }
        }
コード例 #2
0
ファイル: DownloadHelper.cs プロジェクト: mokth/merpCS
        void _client_GetRunnoCompleted(object sender, GetRunnoCompletedEventArgs e)
        {
            List<RunnoInfo> list = new List<RunnoInfo> ();
            string msg = null;
            bool success = true;
            if ( e.Error != null)
            {
                msg =  e.Error.Message;
                success = false;
            }
            else if ( e.Cancelled)
            {
                msg = "Request was cancelled.";
                success = false;
            }
            else
            {
                list =  e.Result.ToList<RunnoInfo>();
                RunOnUiThread (() => InsertRunoIntoDb(list));
            }
            if (!success) {
                RunOnUiThread (() => Downloadhandle.Invoke(CallingActivity,0,msg));
                if (_downloadAll) {
                    _downloadAll = false;
                    FireEvent (EventID.LOGIN_DOWNCOMPLETE);
                }

            }
        }