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 }); }
public HistoryItemViewModel(string name, HistoryItemType itemType) { _name = name; _itemType = itemType; }
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; }
/// <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; }
public static Task <List <HistoryItem> > GetHistory(HistoryItemType type) { return(db.Table <HistoryItem>().Where(h => h.Type == type).OrderByDescending(h => h.Timestamp).Take(30).ToListAsync()); }
/// <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; }
public static Task<List<HistoryItem>> GetHistory(HistoryItemType type) { return db.Table<HistoryItem>().Where(h => h.Type == type).OrderByDescending(h => h.Timestamp).Take(30).ToListAsync(); }