예제 #1
0
        } // Validate

        public static string ValidateArray(RecorderConfig[] recorders, string arrayElementTag, string arrayTag, string ownerTag)
        {
            var validationError = ConfigCommon.ValidateArray(recorders, arrayElementTag, arrayTag, ownerTag);

            if (validationError != null)
            {
                return(validationError);
            }

            var set = new HashSet <string>();

            foreach (var recorder in recorders)
            {
                validationError = recorder.Validate(arrayElementTag);
                if (validationError != null)
                {
                    return(validationError);
                }

                if (!set.Add(recorder.Name))
                {
                    return(ConfigCommon.ErrorDuplicatedEntry(arrayTag, arrayElementTag, "name", recorder.Name));
                } // if
            }     // foreach

            return(null);
        } // ValidateArray
예제 #2
0
        } // Validate

        public static string ValidateArray(RecordTaskSchedulerFolder[] folders, string arrayElementTag, string arrayTag, string ownerTag)
        {
            if ((folders == null) || (folders.Length < 1))
            {
                return(null);
            }

            var set = new HashSet <string>();

            foreach (var folder in folders)
            {
                var validationError = folder.Validate(arrayElementTag);
                if (validationError != null)
                {
                    return(validationError);
                }

                if (!set.Add(folder.Name))
                {
                    return(ConfigCommon.ErrorDuplicatedEntry(arrayTag, arrayElementTag, "name", folder.Name));
                } // if
            }     // foreach

            return(null);
        } // ValidateArray
예제 #3
0
        } // Validate

        public static string ValidateArray(RecordSaveLocation[] locations, string arrayElementTag, string arrayTag, string ownerTag)
        {
            var validationError = ConfigCommon.ValidateArray(locations, arrayElementTag, arrayTag, ownerTag);

            if (validationError != null)
            {
                return(validationError);
            }

            var set = new HashSet <string>();

            foreach (var location in locations)
            {
                validationError = location.Validate(arrayElementTag);
                if (validationError != null)
                {
                    return(validationError);
                }

                if (!set.Add(location.Name))
                {
                    return(ConfigCommon.ErrorDuplicatedEntry(arrayTag, arrayElementTag, "name", location.Name ?? "(empty or null)"));
                } // if
            }     // foreach

            return(null);
        } // ValidateArray