示例#1
0
        /// <summary>
        /// Verifies that any Additional Info layers are consistent.
        /// </summary>
        private void VerifyInfoLayers()
        {
            var infoLayersCount = AdditionalInfo.Count(x => x is InfoLayers);

            if (infoLayersCount > 1)
            {
                throw new PsdInvalidException(
                          "Cannot have more than one InfoLayers in a PSD file.");
            }
            if ((infoLayersCount > 0) && (Layers.Count == 0))
            {
                throw new PsdInvalidException(
                          "InfoLayers cannot exist when there are 0 layers.");
            }
        }