Пример #1
0
        public EmailTemplate AddEmailTemplate(EventName eventName, EmailTemplate emailTemplate)
        {
            // Ensure the key is present
              if (!EmailTemplateLookup.ContainsKey(eventName.ToString())) EmailTemplateLookup.Add(eventName.ToString(), new Dictionary<Type, EmailTemplate>());
              // Ensure the key is present
              if (!EmailTemplateLookup[eventName.ToString()].ContainsKey(emailTemplate.EntityType))
              {
            EmailTemplateLookup[eventName.ToString()].Add(emailTemplate.EntityType, emailTemplate);
              }
              else
              {
            throw new DuplicateNameException("This dictionary already contains a template for this EventName + Type!");
              }

              return emailTemplate;
        }
Пример #2
0
 public Subscriber(EventName eventName, string userId)
 {
     this.EventName = eventName;
     this.UserId = userId;
 }