Represents a software package. Namespace: Microsoft.ComponentStudio.ComponentPlatformInterface
Assembly: Microsoft.ComponentStudio.ComponentPlatformInterface (in microsoft.componentstudio.componentplatforminterface.dll)

Usage

Visual Basic
Dim package1 As New Package()

Syntax

Visual Basic
Public Class Package
		Inherits ObjectBase
		Implements ICustomTypeDescriptor
C#
public class Package : ObjectBase, ICustomTypeDescriptor
C++
public ref class Package : ObjectBase, ICustomTypeDescriptor
J#
public class Package extends ObjectBase implements ICustomTypeDescriptor
JScript
public class Package extends ObjectBase implements ICustomTypeDescriptor

Example

In this example, you open a package from a specified path on the hard disk and display several package properties.

noteNote:
For this example to work properly, you must change the path name of the package in the code to match the package path on your local machine.
// Package.cs

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace Microsoft.ComponentStudio.ComponentPlatformInterface
{
	public class MyClass
	{
		static void Main()
		{
			// Open a package from a specific path:
			Package pkg = Cpi.Instance.OpenPackage(
			@"C:\DistributionShare\Packages\HotFix\calc.package");
		 // Display the package properties:
			Console.WriteLine(pkg.Description);
			Console.WriteLine(pkg.CompanyName);
			Console.WriteLine(pkg.Copyright);
	}
}
}
/* Output:
Microsoft.Windows.Calc.Demo
Microsoft Corporation
c Microsoft Corporation
*/

Inheritance Hierarchy

System.Object
   Microsoft.ComponentStudio.Common.ObjectBase
    Microsoft.ComponentStudio.ComponentPlatformInterface.Package

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Vista, and Windows 2000

Target Platforms

See Also