Partager via


IFileAssociationCollection.Add Method

Creates a file association and adds it to the collection.

Namespace:  Microsoft.VisualStudio.ManagedInterfaces.Publish
Assembly:  Microsoft.VisualStudio.ManagedInterfaces.9.0 (in Microsoft.VisualStudio.ManagedInterfaces.9.0.dll)

Syntax

'Declaration
Sub Add ( _
    extension As String, _
    defaultIcon As String, _
    description As String, _
    progid As String _
)
void Add(
    string extension,
    string defaultIcon,
    string description,
    string progid
)
void Add(
    String^ extension, 
    String^ defaultIcon, 
    String^ description, 
    String^ progid
)
abstract Add : 
        extension:string * 
        defaultIcon:string * 
        description:string * 
        progid:string -> unit
function Add(
    extension : String, 
    defaultIcon : String, 
    description : String, 
    progid : String
)

Parameters

  • extension
    Type: String

    The file name extension for the file type.

  • defaultIcon
    Type: String

    The default icon that is associated with files of this type.

  • description
    Type: String

    The description of the program used to open files of this type.

  • progid
    Type: String

    The ProgID that identifies the program used to open files of this type.

Exceptions

Exception Condition
ArgumentException

extension is nulla null reference (Nothing in Visual Basic) or an invalid file name extension.

Remarks

If an association for the file name extension already exists, the new association replaces it in the collection.

.NET Framework Security

See Also

Reference

IFileAssociationCollection Interface

Microsoft.VisualStudio.ManagedInterfaces.Publish Namespace