Represents the enumeration that indicates the source of an instance
of
OfflineImage.
Namespace:
Microsoft.ComponentStudio.ComponentPlatformInterface
Assembly:
Microsoft.ComponentStudio.ComponentPlatformInterface (in
microsoft.componentstudio.componentplatforminterface.dll)
Usage
Syntax
Visual Basic |
Public Enum OfflineImageInfo.ImageType
|
C# |
public enum OfflineImageInfo.ImageType
|
C++ |
public enum class OfflineImageInfo::ImageType
|
J# |
public enum OfflineImageInfo.ImageType
|
JScript |
public enum OfflineImageInfo.ImageType
|
Example
In this example, you use the enumeration elements in a
switch to select the appropriate case and thus
display the images in the .wim file.
Note: |
To run this example, you must change the value of the variable
wimPath to the folder name that contains the .wim file
on your computer. |
// OfflineImageInfo_Type.cs
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ComponentStudio.ComponentPlatformInterface;
namespace OfflineImageInfo_Type
{
class Program
{
void DisplayImageInfo(OfflineImageInfo info)
{
Console.WriteLine("Image name: {0}", info.ImageName);
switch (info.Type)
{
case OfflineImageInfo.ImageType.Wim:
Console.WriteLine(
"This is an image inside a .wim file:");
Console.WriteLine("Wim file path: {0}",
info.SourcePath);
// Display all image names in wim file:
Console.WriteLine(
"All the images in the .wim file:");
WimInfo wimInfo =
Cpi.Instance.OpenWim(info.SourcePath);
foreach (OfflineImageInfo wimImageInfo
in wimInfo.Images)
{
Console.WriteLine("Image name: {0}",
wimImageInfo.ImageName);
}
break;
case OfflineImageInfo.ImageType.Folder:
Console.WriteLine(
"This is an uncompressed image:");
Console.WriteLine("Folder path: {0}",
info.SourcePath);
break;
case OfflineImageInfo.ImageType.Catalog:
Console.WriteLine(
"This image comes from a catalog file:");
Console.WriteLine("Catalog file path: {0}",
info.SourcePath);
break;
default:
break;
}
}
static void Main(string[] args)
{
string wimPath = @"C:\myWorkingFolder\install.wim";
// Create a Cpi instance:
Cpi n = Cpi.Instance;
// Get an OfflineImageInfo object for an image inside
// a wim file:
OfflineImageInfo oLImgInfo =
n.OpenWim(wimPath).Images[0];
// Display the offlineImageInfo:
Program progObj = new Program();
progObj.DisplayImageInfo(oLImgInfo);
}
}
}
/* Output:
Image name: Windows Vista ULTIMATE
This is an image inside a .wim file:
Wim file path: C:\myWorkingFolder\install.wim
All the images in the .wim file:
Image name: Windows Vista ULTIMATE
Image name: Windows Vista BUSINESS
Image name: Windows Vista BUSINESSN
Image name: Windows Vista ENTERPRISE
Image name: Windows Vista HOMEBASICN
Image name: Windows Vista HOMEPREMIUM
Image name: Windows Vista STARTER
*/
|
Members
Platforms
Development Platforms
Windows XP Home Edition, Windows XP Professional, Windows Server
2003, Windows Vista, and Windows 2000
Target Platforms
See Also