C# Класс ZForge.Win32.FileAssociation.FileAssociationInfo

Provides instance methods for the creation, modification, and deletion of file extension associations in the Windows registry.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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.

Описание методов

Create() публичный Метод

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.
Результат FileAssociationInfo

Create() публичный Метод

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.
Результат FileAssociationInfo

Create() публичный Метод

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.
Результат FileAssociationInfo

Create() публичный Метод

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
Результат FileAssociationInfo

Create() публичный Метод

Creates the extension key.
public Create ( ) : void
Результат void

Create() защищенный Метод

Creates actual file extension entry in registry.
protected Create ( FileAssociationInfo file ) : void
file FileAssociationInfo instance that contains specifics on extension to be created.
Результат void

Delete() публичный Метод

Deletes the extension key.
public Delete ( ) : void
Результат void

Delete() защищенный Метод

Deletes actual file extension entry in registry.
protected Delete ( FileAssociationInfo file ) : void
file FileAssociationInfo instance that contains specifics on extension to be deleted.
Результат void

FileAssociationInfo() публичный Метод

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.
Результат System

GetContentType() защищенный Метод

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.
Результат string

GetExtensions() публичный статический Метод

Gets array containing known file extensions from HKEY_CLASSES_ROOT.
public static GetExtensions ( ) : string[]
Результат string[]

GetOpenWithList() защищенный Метод

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.
Результат string[]

GetPerceivedType() защищенный Метод

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.
Результат PerceivedTypes

GetPersistentHandler() защищенный Метод

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.
Результат System.Guid

GetProgID() защищенный Метод

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.
Результат string

IsValid() публичный Метод

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.
Результат bool

SetContentType() защищенный Метод

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.
Результат void

SetOpenWithList() защищенный Метод

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
Результат void

SetPerceivedType() защищенный Метод

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.
Результат void

SetPersistentHandler() защищенный Метод

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.
Результат void

SetProgID() защищенный Метод

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.
Результат void