Esempio n. 1
0
                void IAsyncStateMachine.MoveNext()
                {
                    int num1 = this._1__state;

                    try
                    {
                        TaskAwaiter awaiter;
                        if (num1 != 0)
                        {
                            if (this.result.ResultCode == ResultCode.Succeeded)
                            {
                                ContactsCache contactsCache = new ContactsCache();
                                List <string> stringList    = this._4__this.phoneNumbers;
                                contactsCache.PhoneNumbers = stringList;
                                awaiter = ContactsSyncManager.StoreContactsAsync(contactsCache).GetAwaiter();
                                if (!awaiter.IsCompleted)
                                {
                                    this._1__state = 0;
                                    this.u__1      = awaiter;
                                    this.t__builder.AwaitUnsafeOnCompleted <TaskAwaiter, ContactsSyncManager.c__DisplayClass9_0.d>(ref awaiter, ref this);
                                    return;
                                }
                            }
                            else
                            {
                                goto label_7;
                            }
                        }
                        else
                        {
                            awaiter        = this.u__1;
                            this.u__1      = new TaskAwaiter();
                            this._1__state = -1;
                        }
                        awaiter.GetResult();
                        awaiter = new TaskAwaiter();
label_7:
                        this._4__this._4__this._isSynching = false;
                        if (this._4__this.callback != null)
                        {
                            this._4__this.callback();
                        }
                    }
                    catch (Exception ex)
                    {
                        this._1__state = -2;
                        this.t__builder.SetException(ex);
                        return;
                    }
                    this._1__state = -2;
                    this.t__builder.SetResult();
                }
Esempio n. 2
0
        public async void Sync(Action callback = null)
        {
            if (!AppGlobalStateManager.Current.GlobalState.AllowSendContacts || this._isSynching)
            {
                // ISSUE: reference to a compiler-generated field
                if (callback == null)
                {
                    return;
                }
                // ISSUE: reference to a compiler-generated field
                callback.Invoke();
            }
            else
            {
                this._isSynching = true;
                // ISSUE: variable of a compiler-generated type
//        ContactsSyncManager.<>c__DisplayClass9_0 cDisplayClass90_2 = cDisplayClass90_1;
                // ISSUE: reference to a compiler-generated field
//        List<string> phoneNumbers = cDisplayClass90_2.phoneNumbers;
                List <string> phoneContactsAsync = await ContactsSyncManager.GetPhoneContactsAsync();

                // ISSUE: reference to a compiler-generated field
//        cDisplayClass90_2.phoneNumbers = phoneContactsAsync;
//        cDisplayClass90_2 = (ContactsSyncManager.<>c__DisplayClass9_0) null;
                // ISSUE: reference to a compiler-generated field
                if (phoneContactsAsync == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    if (callback != null)
                    {
                        // ISSUE: reference to a compiler-generated field
                        callback.Invoke();
                    }
                    this._isSynching = false;
                }
                else
                {
                    ContactsCache contactsCache = await ContactsSyncManager.RetrieveContactsAsync();

                    // ISSUE: reference to a compiler-generated field
                    if (!ContactsSyncManager.AreListsEqual(phoneContactsAsync, contactsCache.PhoneNumbers))
                    {
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated method
                        // AccountService.Instance.LookupContacts("phone", "", phoneContactsAsync, new Action<BackendResult<LookupContactsResponse, ResultCode>>(cDisplayClass90_1.<Sync>b__0));

                        AccountService.Instance.LookupContacts("phone", "", phoneContactsAsync, async delegate(BackendResult <LookupContactsResponse, ResultCode> result)
                        {
                            if (result.ResultCode == ResultCode.Succeeded)
                            {
                                await ContactsSyncManager.StoreContactsAsync(new ContactsCache
                                {
                                    PhoneNumbers = phoneContactsAsync
                                });
                            }
                            this._isSynching = false;
                            if (callback != null)
                            {
                                callback.Invoke();
                            }
                        });
                    }
                    this._isSynching = false;
                    // ISSUE: reference to a compiler-generated field
                    if (callback == null)
                    {
                        return;
                    }
                    // ISSUE: reference to a compiler-generated field
                    callback.Invoke();
                }
            }
        }