コード例 #1
0
 public RegistrationEventArgs(RegistrationEventType eventType, ServiceDescriptor descriptor, ServiceError error, bool moreComing)
     : base(moreComing)
 {
     EventType  = eventType;
     Descriptor = descriptor;
     Error      = error;
 }
コード例 #2
0
        internal static void RunRegisteredEvents(RegistrationEventType type)
        {
            var registrations = _registeredEvents[type];

            foreach (var registration in registrations)
            {
                registration.Invoke();
            }
        }
コード例 #3
0
 public static string DisplayName(this RegistrationEventType eventType)
 {
     return
         (typeof(RegistrationEventType)
          .GetFields()
          .FirstOrDefault(x => x.Name == eventType.ToString())
          ?.GetCustomAttributes <DisplayAttribute>()
          .FirstOrDefault()
          ?.Name);
 }
コード例 #4
0
 public Registration(
     Employee employee,
     RegistrationEventType eventType,
     Entrance entrance)
 {
     SetDateTime();
     SetEventType(eventType);
     SetEmployee(employee);
     SetEntrance(entrance);
 }
コード例 #5
0
        public void RegisterEmployee(Employee employee, RegistrationEventType eventType, Entrance entrance)
        {
            if (employee == null)
            {
                throw new ArgumentNullException(nameof(employee));
            }
            if (entrance == null)
            {
                throw new ArgumentNullException(nameof(entrance));
            }

            var registration = new Registration(employee, eventType, entrance);

            _registrationRepository.Add(registration);
        }
コード例 #6
0
 private void SetEventType(RegistrationEventType eventType)
 {
     EventType = eventType;
 }