예제 #1
0
        public virtual async Task <IWSMessage> ProcessAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            while (cancellationToken.IsCancellationRequested == false)
            {
                var frame = await ReadOperations.ReadFrame(cancellationToken);

                if (Stopwatch.IsRunning)
                {
                    Stopwatch.Restart();
                }

                switch (frame.Code)
                {
                case WSConsts.CodePong:
                    Pulser.Push(frame, false);
                    continue;

                case WSConsts.CodePing:
                    await SendPingBack(frame, cancellationToken);

                    continue;

                case WSConsts.CodeClose:
                case WSConsts.CodeContentText:
                case WSConsts.CodeContentBinary:
                    return(await ToMessage(frame, cancellationToken));
                }
            }

            return(default);
예제 #2
0
        public override void Read(Chunk chunk)
        {
            int chunkId = chunk.Id;

            if (!ReadOperations.ContainsKey(chunkId))
            {
                ReadOperation readOperation = new ReadOperation();
                ReadOperations.Add(chunkId, readOperation);

                readOperation.Run(chunk, Directory);

                //FLogger.Log(LogType.Message, "ChunkReader: Reading " + chunk.FileName);
                //IOMessages.CurrentState = "Reading " + chunk.FileName;
            }
        }
예제 #3
0
 public Task <Child> GetUserChildAsync(int id)
 {
     return(ReadOperations.GetWithChildrenAsync <Child>(_asyncConnection, id));
 }
예제 #4
0
 public Task <List <Child> > GetAllUserChildrenAsync()
 {
     return(ReadOperations.GetAllWithChildrenAsync <Child>(_asyncConnection));
 }
예제 #5
0
 // Obter todas as categorias
 public List <Category> GetCategories()
 {
     return(ReadOperations.GetAllWithChildren <Category>(sqliteconnection));
 }
예제 #6
0
 // Obter detalhes da categoria
 public Category GetCategoryDetail(int categoryId)
 {
     return(ReadOperations.GetWithChildren <Category>(sqliteconnection, categoryId));
 }
예제 #7
0
 // Obter todos os produtos
 public List <Product> GetProductList()
 {
     // using SQLite Extensions to solve relations
     return(ReadOperations.GetAllWithChildren <Product>(sqliteconnection));
 }
예제 #8
0
 // Obter detalhes do produto
 public Product GetProductDetail(int id)
 {
     return(ReadOperations.GetWithChildren <Product>(sqliteconnection, id));
 }
예제 #9
0
 public List <User> GetUsersAsync()
 {
     //return db.Table<Question>().ToListAsync();
     return(ReadOperations.GetAllWithChildren <User>(db));
 }
예제 #10
0
 public List <Department> GetAllDepartment()
 {
     return(ReadOperations.GetAllWithChildren <Department>(connection, recursive: true).ToList());
 }
예제 #11
0
        private async Task UpdateDebtsAsync()
        {
            var debts = await ReadOperations.GetAllWithChildrenAsync <Debt>(_databaseConnection.Database);

            Content = new ObservableCollection <Debt>(debts);
        }
예제 #12
0
 public Task <Milestone> GetMilestoneByIdAsync(int id)
 {
     return(ReadOperations.GetWithChildrenAsync <Milestone>(_asyncConnection, id));
 }
예제 #13
0
 public Task <List <Milestone> > GetAllMilestonesAsync()
 {
     return(ReadOperations.GetAllWithChildrenAsync <Milestone>(_asyncConnection));
 }
 public Task <Vaccine> GetVaccineAsync(int id)
 {
     return(ReadOperations.GetWithChildrenAsync <Vaccine>(_asyncConnection, id));
 }
 public Task <List <Vaccine> > GetAllVaccinesAsync()
 {
     return(ReadOperations.GetAllWithChildrenAsync <Vaccine>(_asyncConnection));
 }