Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AppxBundleMetadata"/> class.
        /// </summary>
        /// <param name="parentBundleInfo">the parent bundle from which this bundle is referenced</param>
        /// <param name="fileRelativePath">the relative path to the appxbundle file, as referenced
        /// from a parent appxbundle file</param>
        public AppxBundleMetadata(AppxBundleMetadata parentBundleInfo, string fileRelativePath)
        {
            this.RelativePath = fileRelativePath;
            string fullPath = Path.Combine(Path.GetDirectoryName(parentBundleInfo.FilePath), fileRelativePath);

            this.Initialize(fullPath);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExternalPackageReference"/> class.
        /// </summary>
        /// <param name="parentBundle">The parent bundle in which this reference was found</param>
        /// <param name="packageFullName">The full name of the package</param>
        /// <param name="relativePath">The relative path of this package as specified in the parent bundle</param>
        /// <param name="isOptional">a flag indicating if this package is optional w.r.t its parent</param>
        public ExternalPackageReference(
            AppxBundleMetadata parentBundle,
            string packageFullName,
            string relativePath,
            bool isOptional)
        {
            this.PackageFullName = packageFullName;
            this.FullPath        = Path.Combine(Path.GetDirectoryName(parentBundle.FilePath), relativePath);
            this.ParentBundle    = parentBundle;
            this.RelativePath    = relativePath;
            this.IsOptional      = isOptional;
            this.IsBundle        = FileExtensionHelper.HasUnencryptedBundleExtension(this.FullPath);

            this.packageInfoFactory = new Lazy <PackageMetadata>(() =>
            {
                if (this.IsBundle)
                {
                    return(new AppxBundleMetadata(this.FullPath));
                }
                else
                {
                    return(new AppxMetadata(this.FullPath));
                }
            });
        }
Exemple #3
0
 public ChildPackageMetadata(AppxBundleMetadata parentBundle, string packageFullName, string relativePath, APPX_BUNDLE_PAYLOAD_PACKAGE_TYPE packageType, ulong packageSize, ulong packageVersion, string packageResourceId)
 {
     this.ParentBundle     = parentBundle;
     this.RelativeFilePath = relativePath;
     this.PackageType      = (PackageType)packageType;
     this.Size             = packageSize;
     this.PackageFullName  = packageFullName;
     this.Architecture     = PackagingUtils.GetPackageArchitectureFromFullName(packageFullName);
     this.Version          = new VersionInfo(packageVersion);
     this.ResourceId       = packageResourceId;
 }