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(); }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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));