Пример #1
0
 public void Delete()
 {
     if (Id != default(int))
     {
         RecordedEvents.Add(new ContactDeleted(Id));
     }
 }
Пример #2
0
        public Contact(FullName fullname, EmailAddress emailAddress, PhoneNumber phoneNumber, Address address, DateOfBirth dateOfBirth) : this()
        {
            if (fullname == null)
            {
                throw new ContactException("Fullname cannot be null");
            }

            if (emailAddress == null)
            {
                throw new ContactException("Emil address cannot be null");
            }

            if (phoneNumber == null)
            {
                throw new ContactException("Phone number cannot be null");
            }

            if (dateOfBirth == null)
            {
                throw new ContactException("Date of birth cannot be null");
            }

            FullName     = fullname;
            EmailAddress = emailAddress;
            PhoneNumber  = phoneNumber;
            Address      = address;

            RecordedEvents.Add(new ContactCreated(Id));
        }
Пример #3
0
 public void ClearHistory()
 {
     lock (recordLock)
     {
         RecordedEvents.Clear();
     }
 }
Пример #4
0
 public void UpdatePhoneNumber(PhoneNumber phoneNumber)
 {
     if (!PhoneNumber.Equals(phoneNumber))
     {
         PhoneNumber = phoneNumber;
         RecordedEvents.Add(new ContactPhoneNumberUpdated(phoneNumber.Value));
     }
 }
Пример #5
0
 public void UpdateEmailAddress(EmailAddress emailAddress)
 {
     if (!EmailAddress.Equals(emailAddress))
     {
         EmailAddress = emailAddress;
         RecordedEvents.Add(new ContactEmailAddressUpdated(emailAddress.Value));
     }
 }
Пример #6
0
 public void UpdateFullName(FullName fullname)
 {
     if (!FullName.Equals(fullname))
     {
         FullName = fullname;
         RecordedEvents.Add(new ContactFullNameUpdated(fullname.ToString()));
     }
 }
Пример #7
0
 public void UpdateAddress(Address address)
 {
     if (!Address.Equals(address))
     {
         Address = address;
         RecordedEvents.Add(new ContactAddressUpdated(address.ToString()));
     }
 }
Пример #8
0
        private void RecorderSettings_Load(object sender, EventArgs e)
        {
            PuppeteerOptions po = ConfigManager.GetPuppeteerConfiguration();
            RecordedEvents   re = ConfigManager.GetRecordedEventsOptions();

            puppeteerOptionsUserControl.BindOptions(po);
            recordedEventsPropertyGrid.SelectedObject = re;
        }
Пример #9
0
        private void EventHandler(string eventName, object sender, EventArgs e, ValueUpdate vu = null)
        {
            var record = new EventRecord(eventName, sender, e, vu);

            lock (recordLock)
            {
                RecordedEvents.Add(record);
            }
            if (LogEvents)
            {
                Debug.WriteLine($"EventMonitor<{typeof(T).FullName}>: caught event from {eventName}");
            }
            CaughtEvent?.Invoke(this, new EventRecordEventArgs(record));
        }
Пример #10
0
        public RecorderConfiguration ExportRecorderOptions()
        {
            RecordedEvents r = (RecordedEvents)recordedEventsPropertyGrid.SelectedObject;

            try
            {
                PuppeteerOptions      p  = puppeteerOptionsUserControl.ExportOptions();
                RecorderConfiguration rc = new RecorderConfiguration
                {
                    PuppeteerOptions = p,
                    RecordedEvents   = r
                };
                return(rc);
            }
            catch (ArgumentException e)
            {
                MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(new RecorderConfiguration
                {
                    PuppeteerOptions = ConfigManager.GetPuppeteerConfiguration(),
                    RecordedEvents = r
                });
            }
        }
 public Task RaisePlanEventAsync <T>(Guid scopeIdentifier, string hubName, Guid planId, T eventData, CancellationToken cancellationToken) where T : JobEvent
 {
     RecordedEvents.Add(eventData);
     return(Task.CompletedTask);
 }