Пример #1
0
        private PSValidationType Convert(ValidationType value)
        {
            switch (value)
            {
            case ValidationType.DatasetSize:
                return(PSValidationType.DatasetSize);

            case ValidationType.Filename:
                return(PSValidationType.Filename);

            case ValidationType.FilenameCharacters:
                return(PSValidationType.FilenameCharacters);

            case ValidationType.FilenameLength:
                return(PSValidationType.FilenameLength);

            case ValidationType.FileSize:
                return(PSValidationType.FileSize);

            case ValidationType.FileSystem:
                return(PSValidationType.FileSystem);

            case ValidationType.NodeDepth:
                return(PSValidationType.NodeDepth);

            case ValidationType.OsVersion:
                return(PSValidationType.OsVersion);

            case ValidationType.PathLength:
                return(PSValidationType.PathLength);

            default:
                throw new ArgumentException($"{value.GetType().Name} value {value} is unsupported");
            }
        }
Пример #2
0
        /// <summary>
        /// Converts the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>PSValidationType.</returns>
        /// <exception cref="ArgumentException"></exception>
        private PSValidationType Convert(ValidationType value)
        {
            switch (value)
            {
            case ValidationType.DatasetSize:
                return(PSValidationType.DatasetSize);

            case ValidationType.Filename:
                return(PSValidationType.Filename);

            case ValidationType.FilenameCharacters:
                return(PSValidationType.FilenameCharacters);

            case ValidationType.FilenameLength:
                return(PSValidationType.FilenameLength);

            case ValidationType.FileSize:
                return(PSValidationType.FileSize);

            case ValidationType.FileSystem:
                return(PSValidationType.FileSystem);

            case ValidationType.NodeDepth:
                return(PSValidationType.NodeDepth);

            case ValidationType.OsVersion:
                return(PSValidationType.OsVersion);

            case ValidationType.PathLength:
                return(PSValidationType.PathLength);

            default:
                throw new ArgumentException(string.Format(StorageSyncResources.UnsupportedErrorFormat, value.GetType().Name, value));
            }
        }