Exemplo n.º 1
0
        public void AddLabel(IAccountSource source, string label)
        {
            TaskChainHandler handler = delegate()
            {
                return(AddLabelAsync(source, label));
            };

            AddTaskToChain(handler);
        }
Exemplo n.º 2
0
        async Task UpdateAccountAsync(IAccountSource account, bool silent)
        {
            Account raccount = account as Account;

            raccount.ViewAccount.ShowSpinner = !silent;
            await raccount.UpdateAccount();

            await mAccountDB.SaveChangesAsync();
        }
Exemplo n.º 3
0
        public void UpdateAccount(IAccountSource account, bool silent)
        {
            TaskChainHandler handler = delegate()
            {
                return(UpdateAccountAsync(account, silent));
            };

            AddTaskToChain(handler);
        }
Exemplo n.º 4
0
        public async Task AddLabelWait(IAccountSource source, string label)
        {
            TaskChainHandler handler = delegate()
            {
                return(AddLabelAsync(source, label));
            };

            TaskCompletionSource <object> waitfor = new TaskCompletionSource <object>();

            AddTaskToChain(handler, waitfor);

            await waitfor.Task;
        }
Exemplo n.º 5
0
        public async Task UpdateAccountWait(IAccountSource account, bool silent)
        {
            TaskChainHandler handler = delegate()
            {
                return(UpdateAccountAsync(account, silent));
            };

            TaskCompletionSource <object> waitfor = new TaskCompletionSource <object>();

            AddTaskToChain(handler, waitfor);

            await waitfor.Task;
        }
Exemplo n.º 6
0
        public void Sync(IAccountSource source)
        {
            mSource      = source;
            UserName     = source.UserName;
            ImageUrl     = source.ImageUrl;
            AccountState = source.AccountState;
            UnreadCount  = source.UnreadCount;
            IsExpanded   = source.IsExpanded;
            Id           = source.Id;

            var label_dict = mFilters.ToDictionary((l) => l.Id);
            var delete     = new List <ViewLabel>(mFilters);
            var order      = new List <ViewLabel>(source.Labels.Length);

            foreach (var i in source.Labels)
            {
                ViewLabel label;

                if (!label_dict.TryGetValue(i.Id, out label))
                {
                    label = new ViewLabel(this, i);
                    mFilters.Add(label);
                    order.Add(label);
                    continue;
                }

                delete.Remove(label);
                order.Add(label);
                label.Sync(this, i);
            }

            foreach (var i in delete)
            {
                mFilters.Remove(i);
            }

            for (int i = 0; i < order.Count; i++)
            {
                int index = mFilters.IndexOf(order[i]);

                if (index == i)
                {
                    continue;
                }
                mFilters.Move(index, i);
            }
        }
Exemplo n.º 7
0
 protected AccountAuthentication(IAccountSource accountSource)
 {
     this.accountSource = accountSource;
 }
 public DefaultAccountAuthentication(IAccountSource accountSource) : base(accountSource)
 {
 }
Exemplo n.º 9
0
        async Task AddLabelAsync(IAccountSource source, string label)
        {
            var account = source as Account;

            await account.AddLabel(label);
        }