C# Class ZForge.Win32.FileAssociation.FileAssociationInfo

Provides instance methods for the creation, modification, and deletion of file extension associations in the Windows registry.
Afficher le fichier Open project: zhuangyy/Motion Class Usage Examples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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.
Résultat FileAssociationInfo

Create() public méthode

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.
Résultat FileAssociationInfo

Create() public méthode

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.
Résultat FileAssociationInfo

Create() public méthode

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
Résultat FileAssociationInfo

Create() public méthode

Creates the extension key.
public Create ( ) : void
Résultat void

Create() protected méthode

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

Delete() public méthode

Deletes the extension key.
public Delete ( ) : void
Résultat void

Delete() protected méthode

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

FileAssociationInfo() public méthode

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.
Résultat System

GetContentType() protected méthode

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.
Résultat string

GetExtensions() public static méthode

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

GetOpenWithList() protected méthode

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.
Résultat string[]

GetPerceivedType() protected méthode

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.
Résultat PerceivedTypes

GetPersistentHandler() protected méthode

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.
Résultat System.Guid

GetProgID() protected méthode

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.
Résultat string

IsValid() public méthode

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.
Résultat bool

SetContentType() protected méthode

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.
Résultat void

SetOpenWithList() protected méthode

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
Résultat void

SetPerceivedType() protected méthode

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.
Résultat void

SetPersistentHandler() protected méthode

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.
Résultat void

SetProgID() protected méthode

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.
Résultat void