System.Configuration.ExceptionUtil.UnexpectedError C# (CSharp) Метод

UnexpectedError() статический приватный Метод

static private UnexpectedError ( string methodName ) : InvalidOperationException
methodName string
Результат System.InvalidOperationException
        static internal InvalidOperationException UnexpectedError(string methodName) {
            return new InvalidOperationException(SR.GetString(SR.Unexpected_Error, methodName));
        }

Usage Example

Пример #1
0
        public override bool IsDefinitionAllowed(string configPath, ConfigurationAllowDefinition allowDefinition,
                                                 ConfigurationAllowExeDefinition allowExeDefinition)
        {
            string allowedConfigPath;

            switch (allowExeDefinition)
            {
            case ConfigurationAllowExeDefinition.MachineOnly:
                allowedConfigPath = MachineConfigPath;
                break;

            case ConfigurationAllowExeDefinition.MachineToApplication:
                allowedConfigPath = ExeConfigPath;
                break;

            case ConfigurationAllowExeDefinition.MachineToRoamingUser:
                allowedConfigPath = RoamingUserConfigPath;
                break;

            // MachineToLocalUser does not current have any definition restrictions
            case ConfigurationAllowExeDefinition.MachineToLocalUser:
                return(true);

            default:
                // If we have extended ConfigurationAllowExeDefinition
                // make sure to update this switch accordingly
                throw ExceptionUtil.UnexpectedError("ClientConfigurationHost::IsDefinitionAllowed");
            }

            return(configPath.Length <= allowedConfigPath.Length);
        }
All Usage Examples Of System.Configuration.ExceptionUtil::UnexpectedError