public void Unregister(Entry entry) { System.Diagnostics.Debug.Assert(entry != null); Remove(new KeyValuePair<Guid, Entry>(entry.Id, entry)); if (Count == 0 && RegistryCleared != null) { RegistryCleared(); } }
void AddEntry(Service service) { var entry = new Entry() { Id = new Guid(service.Id), Name = service.Name, Quantity = 1, CurrentMarkupPrice = Math.Round(service.TotalCost(), 2), TaxPercentage = Math.Round(service.TaxPercentage, 3) }; Entries.Add(entry); _registry.Add(new KeyValuePair<Guid, Entry>(entry.Id, entry)); _entryDictionary.Add(service, entry); bool collectionsInSync = Entries.Count == _registry.Count && Entries.Count == _entryDictionary.Count; Debug.Assert(collectionsInSync); }
void ProcessEntry(Service service) { Services.Add(service); AddMaterials(service); var entry = new Entry() { Id = new Guid(service.Id), Name = service.Name, Quantity = 1, CurrentMarkupPrice = Math.Round(service.TotalCost(), 2), TaxPercentage = Math.Round(service.TaxPercentage, 3) }; Entries.Add(entry); _registry.Add(new KeyValuePair<Guid, Entry>(entry.Id, entry)); _entryDictionary.Add(service, entry); SelectedEntry = entry; UpdateSummary(); }
public void Register(Entry entry) => Add(new KeyValuePair<Guid, Entry>(entry.Id, entry));