Exemple #1
0
 public Task GetConversations()
 {
     return(Bouncer.StartSingleTask(() =>
     {
         Threads = _chattingService.GetGroupThreads(_contextGroup.Id);
         //OnPropertyChanged("Threads");
     }));
 }
Exemple #2
0
 public Task GetMessagesForThread([NotNull] PrivateConversation thread)
 {
     return(Bouncer.StartSingleTask(() =>
     {
         Messages = _chattingService.GetThreadMessages(thread);
         OnPropertyChanged("Messages");
     }));
 }
Exemple #3
0
        public Task <bool> Save([NotNull] List <ThreadMember> members)
        {
            _builder.SetName(Name);
            var ul = UserLinker;

            foreach (var m in members.Where(m => !m.Included))
            {
                ul.UnlinkItem(m.User);
            }

            return(Bouncer.StartSingleTask(() => _builder.Save()));
        }
Exemple #4
0
        public Task SendMessage()
        {
            @Asure.NotNull(SelectedThread, MessageText, Messages);
            return(Bouncer.StartSingleTask(() =>
            {
                var newMessage = _chattingService.SendThreadMessage(SelectedThread, MessageText);
                MessageText = "";
                Messages.Add(newMessage);
                Messages = Messages.ToList(Messages.Count);

                OnPropertyChanged("MessageText");
                OnPropertyChanged("Messages");
            }));
        }
Exemple #5
0
        private Task <FailInfo> TestConnection(SqlConnectionStringBuilder connBuilder)
        {
            var connString = connBuilder.ToString();

            return(Bouncer.StartSingleTask(() => {
                using (SqlConnection connection = new SqlConnection(connString))
                {
                    try
                    {
                        if (connection.State == ConnectionState.Closed)
                        {
                            connection.Open();
                        }
                    }
                    catch (SqlException e)
                    {
                        throw new ActionFailException("Connection error. Check server address.");
                    }
                }
            }).AwaitCall());
        }
Exemple #6
0
        public async Task <FailInfo> TryLogin()
        {
            _model.Password = Password;
            _model.Email    = Email;

            var conn = new SqlConnectionStringBuilder()
            {
                DataSource     = Server,
                InitialCatalog = "GRWOMain",
                UserID         = "GRWO_DPUser",
                Password       = "******",
            };
            var fail = await TestConnection(conn);

            if (fail != null)
            {
                return(fail);
            }

            _dbConfig.SaveConnection(conn, DbConnectionType.StandardMain);
            return(await Bouncer.StartSingleTask(() => _service.Login(_model)).AwaitCall());
        }
Exemple #7
0
 public Task GetConversersForThread([NotNull] PrivateConversation thread)
 {
     return(Bouncer.StartSingleTask(() => _conversers = _chattingService.GetGroupThreadConversers(thread)));
 }
Exemple #8
0
 public Task <IList <Group> > GetGroups()
 {
     return(Bouncer.StartSingleTask(() => _groupService.GetUserGroups()));
 }
Exemple #9
0
 public Task <int> GetNewMessagesCount()
 {
     return(Bouncer.StartSingleTask(() => _dataService.GetNewDataInfo()?.NewGroupMessages ?? 0));
 }
Exemple #10
0
 public Task <FailInfo> SelectProject()
 {
     return(Bouncer.StartSingleTask(() => _joiningService.JoinProject(SelectedProject)).AwaitCall());
 }
Exemple #11
0
 public Task <IList <ProjectModel> > GetProjects() => Bouncer.StartSingleTask(() => _projectService.LoadProjects());