Ejemplo n.º 1
0
        private void ValidateTypes()
        {
            // check process protocol handler

            Type processHandlerType;

            try {
                processHandlerType = Type.GetType(ProcessHandlerType, true /*throwOnError*/);
            }
            catch (Exception e) {
                throw new ConfigurationErrorsException(
                          e.Message,
                          e,
                          this.ElementInformation.Properties["ProcessHandlerType"].Source,
                          this.ElementInformation.Properties["ProcessHandlerType"].LineNumber);
            }
            ConfigUtil.CheckAssignableType(typeof(ProcessProtocolHandler), processHandlerType, this, "ProcessHandlerType");

            // check app domain protocol handler

            Type appDomainHandlerType;

            try {
                appDomainHandlerType = Type.GetType(AppDomainHandlerType, true /*throwOnError*/);
            }
            catch (Exception e) {
                throw new ConfigurationErrorsException(
                          e.Message,
                          e,
                          this.ElementInformation.Properties["AppDomainHandlerType"].Source,
                          this.ElementInformation.Properties["AppDomainHandlerType"].LineNumber);
            }
            ConfigUtil.CheckAssignableType(typeof(AppDomainProtocolHandler), appDomainHandlerType, this, "AppDomainHandlerType");
        }
Ejemplo n.º 2
0
        private void ValidateTypes()
        {
            Type type;
            Type type2;

            try
            {
                type = Type.GetType(this.ProcessHandlerType, true);
            }
            catch (Exception exception)
            {
                throw new ConfigurationErrorsException(exception.Message, exception, base.ElementInformation.Properties["ProcessHandlerType"].Source, base.ElementInformation.Properties["ProcessHandlerType"].LineNumber);
            }
            ConfigUtil.CheckAssignableType(typeof(ProcessProtocolHandler), type, this, "ProcessHandlerType");
            try
            {
                type2 = Type.GetType(this.AppDomainHandlerType, true);
            }
            catch (Exception exception2)
            {
                throw new ConfigurationErrorsException(exception2.Message, exception2, base.ElementInformation.Properties["AppDomainHandlerType"].Source, base.ElementInformation.Properties["AppDomainHandlerType"].LineNumber);
            }
            ConfigUtil.CheckAssignableType(typeof(AppDomainProtocolHandler), type2, this, "AppDomainHandlerType");
        }