コード例 #1
0
 /// <summary>
 ///     Determines whether the specified <see cref="DismWimCustomizedInfo" /> is equal to the current
 ///     <see cref="DismWimCustomizedInfo" />.
 /// </summary>
 /// <param name="wimCustomizedInfo">The <see cref="DismWimCustomizedInfo" /> object to compare with the current object.</param>
 /// <returns>
 ///     true if the specified <see cref="DismWimCustomizedInfo" /> is equal to the current
 ///     <see cref="DismWimCustomizedInfo" />; otherwise, false.
 /// </returns>
 public bool Equals(DismWimCustomizedInfo wimCustomizedInfo)
 {
     return(wimCustomizedInfo != null &&
            CreatedTime == wimCustomizedInfo.CreatedTime &&
            DirectoryCount == wimCustomizedInfo.DirectoryCount &&
            FileCount == wimCustomizedInfo.FileCount &&
            ModifiedTime == wimCustomizedInfo.ModifiedTime &&
            Size == wimCustomizedInfo.Size);
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DismImageInfo" /> class.
        /// Creates an instance of the DismImageInfo class.
        /// </summary>
        /// <param name="imageInfo">A instance of a DismImageInfo_ structure.</param>
        internal DismImageInfo(DismApi.DismImageInfo_ imageInfo)
        {
            _imageInfo = imageInfo;

            _languages = _imageInfo.Language.ToList <CultureInfo, DismApi.DismLanguage>(_imageInfo.LanguageCount, language => CultureInfo.GetCultureInfo(language));

            // Parse the OS version from the various fields
            ProductVersion = new Version((int)imageInfo.MajorVersion, (int)imageInfo.MinorVersion, (int)imageInfo.Build, (int)imageInfo.SpBuild);

            // Marshal the WIM customized info
            if (_imageInfo.CustomizedInfo != IntPtr.Zero)
            {
                CustomizedInfo = new DismWimCustomizedInfo(_imageInfo.CustomizedInfo);
            }
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DismImageInfo"/> class.
        /// Creates an instance of the DismImageInfo class.
        /// </summary>
        /// <param name="imageInfo">A instance of a DismImageInfo_ structure.</param>
        internal DismImageInfo(DismApi.DismImageInfo_ imageInfo)
        {
            _imageInfo = imageInfo;

            foreach (var language in _imageInfo.Language.AsEnumerable <DismApi.DismLanguage>((int)_imageInfo.LanguageCount))
            {
                _languages.Add(CultureInfo.GetCultureInfo(language));
            }

            // Parse the OS version from the various fields
            ProductVersion = new Version((int)imageInfo.MajorVersion, (int)imageInfo.MinorVersion, (int)imageInfo.Build, (int)imageInfo.SpBuild);

            // Marshal the WIM customized info
            if (_imageInfo.CustomizedInfo != IntPtr.Zero)
            {
                CustomizedInfo = new DismWimCustomizedInfo(_imageInfo.CustomizedInfo);
            }
        }