예제 #1
0
 public ExchangeConferenceRoomService(IMeetingRepository meetingRepository,
                                      ISecurityRepository securityRepository,
                                      IBroadcastService broadcastService,
                                      IDateTimeService dateTimeService,
                                      IMeetingCacheService meetingCacheService,
                                      IChangeNotificationService changeNotificationService,
                                      IExchangeServiceManager exchangeServiceManager,
                                      ISimpleTimedCache simpleTimedCache,
                                      IInstantMessagingService instantMessagingService,
                                      ISmsMessagingService smsMessagingService,
                                      ISmsAddressLookupService smsAddressLookupService,
                                      ISignatureService signatureService,
                                      IRoomRepository roomRepository)
 {
     _meetingRepository         = meetingRepository;
     _securityRepository        = securityRepository;
     _broadcastService          = broadcastService;
     _dateTimeService           = dateTimeService;
     _meetingCacheService       = meetingCacheService;
     _changeNotificationService = changeNotificationService;
     _exchangeServiceManager    = exchangeServiceManager;
     _simpleTimedCache          = simpleTimedCache;
     _instantMessagingService   = instantMessagingService;
     _smsMessagingService       = smsMessagingService;
     _smsAddressLookupService   = smsAddressLookupService;
     _signatureService          = signatureService;
     _roomRepository            = roomRepository;
     _ignoreFree             = bool.Parse(ConfigurationManager.AppSettings["ignoreFree"] ?? "false");
     _useChangeNotification  = bool.Parse(ConfigurationManager.AppSettings["useChangeNotification"] ?? "true");
     _impersonateForAllCalls = bool.Parse(ConfigurationManager.AppSettings["impersonateForAllCalls"] ?? "true");
     _emailDomains           = (ConfigurationManager.AppSettings["emailDomains"] ?? "")
                               .Split(';')
                               .Select(_ => _.StartsWith("@") ? _.ToLowerInvariant() : "@" + _.ToLowerInvariant())
                               .ToArray();
 }
 public ExchangeConferenceRoomService(ExchangeService exchangeService, IMeetingRepository meetingRepository, ISecurityRepository securityRepository, IBroadcastService broadcastService, IDateTimeService dateTimeService, IMeetingCacheService meetingCacheService, IChangeNotificationService changeNotificationService, IConcurrencyLimiter concurrencyLimiter)
 {
     _exchangeService = exchangeService;
     _meetingRepository = meetingRepository;
     _securityRepository = securityRepository;
     _broadcastService = broadcastService;
     _dateTimeService = dateTimeService;
     _meetingCacheService = meetingCacheService;
     _changeNotificationService = changeNotificationService;
     _concurrencyLimiter = concurrencyLimiter;
     _ignoreFree = bool.Parse(ConfigurationManager.AppSettings["ignoreFree"] ?? "false");
     _useChangeNotification = bool.Parse(ConfigurationManager.AppSettings["useChangeNotification"] ?? "true");
 }
 public ExchangeConferenceRoomService(ExchangeService exchangeService, IMeetingRepository meetingRepository, ISecurityRepository securityRepository, IBroadcastService broadcastService, IDateTimeService dateTimeService, IMeetingCacheService meetingCacheService, IChangeNotificationService changeNotificationService, IConcurrencyLimiter concurrencyLimiter)
 {
     _exchangeService           = exchangeService;
     _meetingRepository         = meetingRepository;
     _securityRepository        = securityRepository;
     _broadcastService          = broadcastService;
     _dateTimeService           = dateTimeService;
     _meetingCacheService       = meetingCacheService;
     _changeNotificationService = changeNotificationService;
     _concurrencyLimiter        = concurrencyLimiter;
     _ignoreFree            = bool.Parse(ConfigurationManager.AppSettings["ignoreFree"] ?? "false");
     _useChangeNotification = bool.Parse(ConfigurationManager.AppSettings["useChangeNotification"] ?? "true");
 }
 public ExchangeConferenceRoomService(IMeetingRepository meetingRepository,
                                      IBroadcastService broadcastService,
                                      IDateTimeService dateTimeService,
                                      IMeetingCacheService meetingCacheService,
                                      IChangeNotificationService changeNotificationService,
                                      IExchangeServiceManager exchangeServiceManager,
                                      ISimpleTimedCache simpleTimedCache,
                                      ISmsMessagingService smsMessagingService,
                                      ISmsAddressLookupService smsAddressLookupService,
                                      ISignatureService signatureService,
                                      IRoomMetadataRepository roomRepository,
                                      IBuildingRepository buildingRepository,
                                      IFloorRepository floorRepository,
                                      IContextService contextService,
                                      IConferenceRoomDiscoveryService exchangeConferenceRoomDiscoveryService,
                                      ExchangeConferenceRoomServiceConfiguration config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
     _meetingRepository         = meetingRepository;
     _broadcastService          = broadcastService;
     _dateTimeService           = dateTimeService;
     _meetingCacheService       = meetingCacheService;
     _changeNotificationService = changeNotificationService;
     _exchangeServiceManager    = exchangeServiceManager;
     _simpleTimedCache          = simpleTimedCache;
     _smsMessagingService       = smsMessagingService;
     _smsAddressLookupService   = smsAddressLookupService;
     _signatureService          = signatureService;
     _roomRepository            = roomRepository;
     _buildingRepository        = buildingRepository;
     _floorRepository           = floorRepository;
     _contextService            = contextService;
     _exchangeConferenceRoomDiscoveryService = exchangeConferenceRoomDiscoveryService;
     _ignoreFree             = config.IgnoreFree;
     _useChangeNotification  = config.UseChangeNotification;
     _impersonateForAllCalls = config.ImpersonateForAllCalls;
     _emailDomains           = config.EmailDomains;
 }
예제 #5
0
 /// <inheritdoc/>
 public int BuildComponent(object model, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex,
                           IChangeNotificationService notificationService) => this.BuildGenericField(model, typeof(LookupField <>), builder, propertyInfo, currentIndex, notificationService);
예제 #6
0
 /// <inheritdoc/>
 public int BuildComponent(object model, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex, IChangeNotificationService notificationService) => this.BuildField <ICollection <int> >(model, typeof(IntCollectionField), propertyInfo, builder, currentIndex, notificationService);
예제 #7
0
 /// <summary>
 /// Builds a <paramref name="componentType"/> for the type <typeparamref name="TValue"/>.
 /// </summary>
 /// <typeparam name="TValue">The type of the value.</typeparam>
 /// <param name="model">The model.</param>
 /// <param name="componentType">The type of the component.</param>
 /// <param name="propertyInfo">The property information.</param>
 /// <param name="builder">The builder.</param>
 /// <param name="currentIndex">The current index in the render tree.</param>
 /// <param name="notificationService">The notification service.</param>
 /// <returns>The updated index in the render tree.</returns>
 protected int BuildField <TValue>(object model, Type componentType, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex, IChangeNotificationService notificationService)
 {
     builder.OpenComponent(currentIndex++, componentType);
     try
     {
         builder.AddAttribute(currentIndex++, "ValueExpression", model.CreatePropertyExpression <TValue>(propertyInfo));
         builder.AddAttribute(currentIndex++, "Value", propertyInfo.GetValue(model));
         builder.AddAttribute(currentIndex++, "ValueChanged", EventCallback.Factory.Create(this, EventCallback.Factory.Create <TValue>(
                                                                                               this,
                                                                                               value =>
         {
             if (propertyInfo.SetMethod is { })
             {
                 propertyInfo.SetValue(model, value);
                 notificationService.NotifyChange(model, propertyInfo.Name);
             }
         })));
예제 #8
0
 /// <summary>
 /// Builds a <typeparamref name="TComponent"/> for the type <typeparamref name="TValue"/>.
 /// </summary>
 /// <typeparam name="TValue">The type of the value.</typeparam>
 /// <typeparam name="TComponent">The type of the component.</typeparam>
 /// <param name="model">The model.</param>
 /// <param name="propertyInfo">The property information.</param>
 /// <param name="builder">The builder.</param>
 /// <param name="currentIndex">The current index in the render tree.</param>
 /// <param name="notificationService">The notification service.</param>
 /// <returns>The updated index in the render tree.</returns>
 protected int BuildField <TValue, TComponent>(object model, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex, IChangeNotificationService notificationService)
 {
     return(this.BuildField <TValue>(model, typeof(TComponent), propertyInfo, builder, currentIndex, notificationService));
 }
예제 #9
0
        /// <summary>
        /// Builds a generic component of type <paramref name="genericBaseComponentType"/>.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="genericBaseComponentType">Type of the generic base component.</param>
        /// <param name="builder">The builder.</param>
        /// <param name="propertyInfo">The property information.</param>
        /// <param name="currentIndex">The current index in the render tree.</param>
        /// <param name="notificationService">The notification service.</param>
        /// <returns>The updated index in the render tree.</returns>
        protected int BuildGenericField(object model, Type genericBaseComponentType, RenderTreeBuilder builder, PropertyInfo propertyInfo, int currentIndex, IChangeNotificationService notificationService)
        {
            var method = this.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance)
                         .Where(m => m.Name == nameof(this.BuildField))
                         .First(m => m.ContainsGenericParameters && m.GetGenericArguments().Length == 1)
                         .MakeGenericMethod(propertyInfo.PropertyType);
            var componentType = genericBaseComponentType.MakeGenericType(propertyInfo.PropertyType);
            var parameters    = new[] { model, componentType, propertyInfo, builder, currentIndex, notificationService };

            return((int)method.Invoke(this, parameters) !);
        }
예제 #10
0
 /// <inheritdoc/>
 public int BuildComponent(object model, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex,
                           IChangeNotificationService notificationService) => this.BuildField <TNumber, NumberField <TNumber> >(model, propertyInfo, builder, currentIndex, notificationService);
예제 #11
0
        private int BuiltItemTableField(object model, RenderTreeBuilder builder, PropertyInfo propertyInfo, int i, IChangeNotificationService notificationService)
        {
            var method = this.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy)
                         .Where(m => m.Name == nameof(this.BuildField))
                         .First(m => m.ContainsGenericParameters && m.GetGenericArguments().Length == 2)
                         .MakeGenericMethod(propertyInfo.PropertyType, typeof(ItemTable <>).MakeGenericType(propertyInfo.PropertyType.GenericTypeArguments[0]));
            var parameters = new[] { model, propertyInfo, builder, i, notificationService };

            return((int)method.Invoke(this, parameters) !);
        }
예제 #12
0
 /// <inheritdoc/>
 public int BuildComponent(object model, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex, IChangeNotificationService notificationService)
 => this.BuiltItemTableField(model, builder, propertyInfo, currentIndex, notificationService);
예제 #13
0
 /// <inheritdoc/>
 public int BuildComponent(object model, PropertyInfo propertyInfo, RenderTreeBuilder builder, int currentIndex, IChangeNotificationService notificationService) => this.BuildField <byte[]>(model, typeof(ByteArrayField), propertyInfo, builder, currentIndex, notificationService);