Пример #1
0
        internal ContentManifestAsset(ContentManifestGroup group, ContentManifestAssetDescription desc)
        {
            Contract.Require(group, nameof(group));
            Contract.Require(desc, nameof(desc));

            if (String.IsNullOrEmpty(desc.Name))
            {
                throw new InvalidDataException(UltravioletStrings.InvalidContentManifestAssetName);
            }

            if (String.IsNullOrEmpty(desc.Path))
            {
                throw new InvalidDataException(UltravioletStrings.InvalidContentManifestAssetPath.Format(desc.Name));
            }

            this.ManifestGroup = group;
            this.Name          = desc.Name;
            this.RelativePath  = desc.Path;
            this.AbsolutePath  = Path.Combine(group.Directory, desc.Path);
            this.Type          = group.Type;
        }