C# Class ZForge.Win32.FileAssociation.FileAssociationInfo

Provides instance methods for the creation, modification, and deletion of file extension associations in the Windows registry.
ファイルを表示 Open project: zhuangyy/Motion Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
Create ( string progId ) : FileAssociationInfo

Creates actual extension association key in registry for the specified extension and supplied attributes.

Create ( string progId, PerceivedTypes perceivedType ) : FileAssociationInfo

Creates actual extension association key in registry for the specified extension and supplied attributes.

Create ( string progId, PerceivedTypes perceivedType, string contentType ) : FileAssociationInfo

Creates actual extension association key in registry for the specified extension and supplied attributes.

Create ( string progId, PerceivedTypes perceivedType, string contentType, string openwithList ) : FileAssociationInfo

Creates actual extension association key in registry for the specified extension and supplied attributes.

Create ( ) : void

Creates the extension key.

Delete ( ) : void

Deletes the extension key.

FileAssociationInfo ( string extension ) : System

Initializes a new instance of the FileAssociationInfoFileAssociationInfo class, which acts as a wrapper for a file extension within the registry.

GetExtensions ( ) : string[]

Gets array containing known file extensions from HKEY_CLASSES_ROOT.

IsValid ( string extension, string progId ) : bool

Verifies that given extension exists and is associated with given program id

Protected Methods

Method Description
Create ( FileAssociationInfo file ) : void

Creates actual file extension entry in registry.

Delete ( FileAssociationInfo file ) : void

Deletes actual file extension entry in registry.

GetContentType ( FileAssociationInfo file ) : string

Gets a value that determines the MIME type of the file.

GetOpenWithList ( FileAssociationInfo file ) : string[]

Gets array of containing program file names which should be displayed in the Open With List.

GetPerceivedType ( FileAssociationInfo file ) : PerceivedTypes

Gets or value that determines the PerceivedTypePerceivedType of the file.

GetPersistentHandler ( FileAssociationInfo file ) : System.Guid

Gets a value that indicates the filter component that is used to search for text within documents of this type.

GetProgID ( FileAssociationInfo file ) : string

Gets a value that indicates the name of the associated application with the behavior to handle this extension.

SetContentType ( FileAssociationInfo file, string type ) : void

Sets a value that determines the MIME type of the file.

SetOpenWithList ( FileAssociationInfo file, string programList ) : void

Sets array of containing program file names which should be displayed in the Open With List.

SetPerceivedType ( FileAssociationInfo file, PerceivedTypes type ) : void

Sets a value that determines the PerceivedTypePerceivedType of the file.

SetPersistentHandler ( FileAssociationInfo file, System.Guid persistentHandler ) : void

Sets a value that indicates the filter component that is used to search for text within documents of this type.

SetProgID ( FileAssociationInfo file, string progId ) : void

Set a value that indicates the name of the associated application with the behavior to handle this extension.

Method Details

Create() public method

Creates actual extension association key in registry for the specified extension and supplied attributes.
public Create ( string progId ) : FileAssociationInfo
progId string Name of expected handling program.
return FileAssociationInfo

Create() public method

Creates actual extension association key in registry for the specified extension and supplied attributes.
public Create ( string progId, PerceivedTypes perceivedType ) : FileAssociationInfo
progId string Name of expected handling program.
perceivedType PerceivedTypes PerceivedType of file type.
return FileAssociationInfo

Create() public method

Creates actual extension association key in registry for the specified extension and supplied attributes.
public Create ( string progId, PerceivedTypes perceivedType, string contentType ) : FileAssociationInfo
progId string Name of expected handling program.
perceivedType PerceivedTypes PerceivedType of file type.
contentType string MIME type of file type.
return FileAssociationInfo

Create() public method

Creates actual extension association key in registry for the specified extension and supplied attributes.
public Create ( string progId, PerceivedTypes perceivedType, string contentType, string openwithList ) : FileAssociationInfo
progId string Name of expected handling program.
perceivedType PerceivedTypes PerceivedType of file type.
contentType string MIME type of file type.
openwithList string
return FileAssociationInfo

Create() public method

Creates the extension key.
public Create ( ) : void
return void

Create() protected method

Creates actual file extension entry in registry.
protected Create ( FileAssociationInfo file ) : void
file FileAssociationInfo instance that contains specifics on extension to be created.
return void

Delete() public method

Deletes the extension key.
public Delete ( ) : void
return void

Delete() protected method

Deletes actual file extension entry in registry.
protected Delete ( FileAssociationInfo file ) : void
file FileAssociationInfo instance that contains specifics on extension to be deleted.
return void

FileAssociationInfo() public method

Initializes a new instance of the FileAssociationInfoFileAssociationInfo class, which acts as a wrapper for a file extension within the registry.
public FileAssociationInfo ( string extension ) : System
extension string The dot prefixed extension.
return System

GetContentType() protected method

Gets a value that determines the MIME type of the file.
protected GetContentType ( FileAssociationInfo file ) : string
file FileAssociationInfo that provides specifics of the extension to be changed.
return string

GetExtensions() public static method

Gets array containing known file extensions from HKEY_CLASSES_ROOT.
public static GetExtensions ( ) : string[]
return string[]

GetOpenWithList() protected method

Gets array of containing program file names which should be displayed in the Open With List.
protected GetOpenWithList ( FileAssociationInfo file ) : string[]
file FileAssociationInfo that provides specifics of the extension to be changed.
return string[]

GetPerceivedType() protected method

Gets or value that determines the PerceivedTypePerceivedType of the file.
protected GetPerceivedType ( FileAssociationInfo file ) : PerceivedTypes
file FileAssociationInfo that provides specifics of the extension to be changed.
return PerceivedTypes

GetPersistentHandler() protected method

Gets a value that indicates the filter component that is used to search for text within documents of this type.
protected GetPersistentHandler ( FileAssociationInfo file ) : System.Guid
file FileAssociationInfo that provides specifics of the extension to be changed.
return System.Guid

GetProgID() protected method

Gets a value that indicates the name of the associated application with the behavior to handle this extension.
protected GetProgID ( FileAssociationInfo file ) : string
file FileAssociationInfo that provides specifics of the extension to be changed.
return string

IsValid() public method

Verifies that given extension exists and is associated with given program id
public IsValid ( string extension, string progId ) : bool
extension string Extension to be checked for.
progId string progId to be checked for.
return bool

SetContentType() protected method

Sets a value that determines the MIME type of the file.
protected SetContentType ( FileAssociationInfo file, string type ) : void
file FileAssociationInfo that provides specifics of the extension to be changed.
type string MIME content type of extension.
return void

SetOpenWithList() protected method

Sets array of containing program file names which should be displayed in the Open With List.
protected SetOpenWithList ( FileAssociationInfo file, string programList ) : void
file FileAssociationInfo that provides specifics of the extension to be changed.
programList string Program file names
return void

SetPerceivedType() protected method

Sets a value that determines the PerceivedTypePerceivedType of the file.
protected SetPerceivedType ( FileAssociationInfo file, PerceivedTypes type ) : void
file FileAssociationInfo that provides specifics of the extension to be changed.
type PerceivedTypes to be set that specifies Perceived Type of extension.
return void

SetPersistentHandler() protected method

Sets a value that indicates the filter component that is used to search for text within documents of this type.
protected SetPersistentHandler ( FileAssociationInfo file, System.Guid persistentHandler ) : void
file FileAssociationInfo that provides specifics of the extension to be changed.
persistentHandler System.Guid Guid of filter component.
return void

SetProgID() protected method

Set a value that indicates the name of the associated application with the behavior to handle this extension.
protected SetProgID ( FileAssociationInfo file, string progId ) : void
file FileAssociationInfo that provides specifics of the extension to be changed.
progId string Associated Program ID of handling program.
return void