public Task GetConversations() { return(Bouncer.StartSingleTask(() => { Threads = _chattingService.GetGroupThreads(_contextGroup.Id); //OnPropertyChanged("Threads"); })); }
public Task GetMessagesForThread([NotNull] PrivateConversation thread) { return(Bouncer.StartSingleTask(() => { Messages = _chattingService.GetThreadMessages(thread); OnPropertyChanged("Messages"); })); }
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())); }
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"); })); }
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()); }
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()); }
public Task GetConversersForThread([NotNull] PrivateConversation thread) { return(Bouncer.StartSingleTask(() => _conversers = _chattingService.GetGroupThreadConversers(thread))); }
public Task <IList <Group> > GetGroups() { return(Bouncer.StartSingleTask(() => _groupService.GetUserGroups())); }
public Task <int> GetNewMessagesCount() { return(Bouncer.StartSingleTask(() => _dataService.GetNewDataInfo()?.NewGroupMessages ?? 0)); }
public Task <FailInfo> SelectProject() { return(Bouncer.StartSingleTask(() => _joiningService.JoinProject(SelectedProject)).AwaitCall()); }
public Task <IList <ProjectModel> > GetProjects() => Bouncer.StartSingleTask(() => _projectService.LoadProjects());