private void AddItem <T>(EventEnvelope <T> evnt, string message, HistoryItemType type = HistoryItemType.Success)
     where T : class
 {
     Items.Add(new HistoryItem()
     {
         Date    = FormatDate(evnt.OccurenceDateUtc),
         Message = message,
         Type    = type
     });
 }
Esempio n. 2
0
 public HistoryItemViewModel(string name, HistoryItemType itemType)
 {
     _name     = name;
     _itemType = itemType;
 }
Esempio n. 3
0
 public HistoryItemViewModel(IUndoableAction action, HistoryItemType itemType)
 {
     _action   = action;
     _itemType = itemType;
 }
 public HistoryItemMessage(HistoryItem historyItem, Guid entityId, HistoryItemType entityType)
 {
     this.HistoryItem = historyItem;
     this.EntityId    = entityId;
     this.EntityType  = entityType;
 }
Esempio n. 5
0
 public HistoryItemViewModel(string name, HistoryItemType itemType)
 {
     _name = name;
     _itemType = itemType;
 }
Esempio n. 6
0
 public HistoryItemViewModel(IUndoableAction action, HistoryItemType itemType)
 {
     _action = action;
     _itemType = itemType;
 }
Esempio n. 7
0
 /// <summary>
 /// Creates new in-memory history item.
 /// </summary>
 /// <param name="type">
 /// Type of created item.
 /// </param>
 /// <param name="direction">
 /// Direction of created item.
 /// </param>
 public HistoryItem(HistoryItemType type, HistoryItemDirection direction)
 {
     Type = type;
     Direction = direction;
 }
Esempio n. 8
0
 public static Task <List <HistoryItem> > GetHistory(HistoryItemType type)
 {
     return(db.Table <HistoryItem>().Where(h => h.Type == type).OrderByDescending(h => h.Timestamp).Take(30).ToListAsync());
 }
Esempio n. 9
0
 /// <summary>
 /// Get or create the current history item for the activating piece Id which the history items are grouped by
 /// If one doesn't exist, create it with the player and type passed
 /// </summary>
 private HistoryItem GetCurrent(int? activatingPieceId, HistoryItemType type, int player)
 {
     if (!activatingPieceId.HasValue)
     {
         //Dictionary can't store null values as keys so hack it to sentinal
         activatingPieceId = -1;
     }
     if (currentItems.ContainsKey(activatingPieceId))
     {
         return currentItems[activatingPieceId];
     }
     var currentItem = new HistoryItem()
     {
         type = type,
         initiatingPlayerId = player,
         spellDamage = possibleActions.GetSpellDamage(player),
         pieceChanges = new List<HistoryPieceChange>(),
     };
     currentItems[activatingPieceId] = currentItem;
     return currentItem;
 }
Esempio n. 10
0
 public static Task<List<HistoryItem>> GetHistory(HistoryItemType type)
 {
     return db.Table<HistoryItem>().Where(h => h.Type == type).OrderByDescending(h => h.Timestamp).Take(30).ToListAsync();
 }