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

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

static private ParameterInvalid ( string parameter ) : ArgumentException
parameter string
Результат System.ArgumentException
        static internal ArgumentException ParameterInvalid(string parameter) {
            return new ArgumentException(SR.GetString(SR.Parameter_Invalid, parameter), parameter);
        }

Usage Example

Пример #1
0
        internal static string ConvertFileNameToUrl(string fileName)
        {
            string prefix;

            if (IsAbsoluteLocalPhysicalPath(fileName))
            {
                prefix = FileUrlLocal;
            }
            else
            {
                if (IsAbsoluteUncPhysicalPath(fileName))
                {
                    prefix = FileUrlUnc;
                }
                else
                {
                    // We should never get here, but if we do we are likely to have
                    // serious security problems, so throw an exception rather than simply
                    // asserting.
                    throw ExceptionUtil.ParameterInvalid(nameof(fileName));
                }
            }

            string newFileName = prefix + fileName.Replace('\\', '/');

            return(newFileName);
        }
All Usage Examples Of System.Configuration.ExceptionUtil::ParameterInvalid