Пример #1
0
        public void Add(RealtimeSheetEntry entry)
        {
            int newId = Interlocked.Increment(ref this._uniqueId);

            entry.RealtimeId = newId;

            this._entries.Add(entry);
        }
Пример #2
0
        public int AddOrUpdatePendingSheetEntry(RealtimeSheetEntry input)
        {
            string group = this.GetGroupName();

            input.ConnectionId = input.ConnectionId;
            input.UserName     = this.Context.User.Identity.Name;

            if (input.RealtimeId == 0)
            {
                this._sheetContext.Alter(group, s => s.Add(input));
            }
            else
            {
                this._sheetContext.Alter(group, s => s.Update(input));
            }

            this.Clients.OthersInGroup(group).pushSheetEntry(input);

            return(input.RealtimeId);
        }
Пример #3
0
 public void Update(RealtimeSheetEntry entry)
 {
     this._entries.RemoveWhere(x => x.RealtimeId == entry.RealtimeId);
     this._entries.Add(entry);
 }