Beispiel #1
0
        private static ProviderBase GetParticipantProvider(string providerType)
        {
            try
            {
                ParticipantProviderBase base2 = null;
                if (string.IsNullOrEmpty(providerType))
                {
                    throw new ArgumentException("Provider type is invalid");
                }
                Type c = Type.GetType(providerType, true, true);
                if (!typeof(ParticipantProviderBase).IsAssignableFrom(c))
                {
                    throw new ArgumentException(String.Format("Provider must implement type {0}.",
                                                              typeof(ParticipantProviderBase).ToString()));
                }
                base2 = (ParticipantProviderBase)Activator.CreateInstance(c);
                var config = new NameValueCollection();
                config.Add("name", providerType);
                base2.ProviderName = providerType;

                base2.Initialize(providerType, config);
                return(base2);
            }
            catch (Exception e)
            {
                return(null);
            }
        }
        public static void Initialize()
        {
            const string fallbackProviderSetting = "BVNetwork.Attend.Business.Participant.BlockProvider.BlockParticipantProvider";
            string defaultProviderSetting = Settings.Settings.GetSetting("DefaultParticipantProviderString");
            if (string.IsNullOrEmpty(defaultProviderSetting))
                defaultProviderSetting = fallbackProviderSetting;

            defaultProvider = GetParticipantProvider(defaultProviderSetting) as ParticipantProviderBase ??
                GetParticipantProvider(fallbackProviderSetting) as ParticipantProviderBase;
        }
Beispiel #3
0
        public static void Initialize()
        {
            const string fallbackProviderSetting = "BVNetwork.Attend.Business.Participant.BlockProvider.BlockParticipantProvider";
            string       defaultProviderSetting  = Settings.Settings.GetSetting("DefaultParticipantProviderString");

            if (string.IsNullOrEmpty(defaultProviderSetting))
            {
                defaultProviderSetting = fallbackProviderSetting;
            }

            defaultProvider = GetParticipantProvider(defaultProviderSetting) as ParticipantProviderBase ??
                              GetParticipantProvider(fallbackProviderSetting) as ParticipantProviderBase;
        }