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
'Dichiarazione
Sub Add ( _
extension As String, _
defaultIcon As String, _
description As String, _
progid As String _
)
'Utilizzo
Dim instance As IFileAssociationCollection
Dim extension As String
Dim defaultIcon As String
Dim description As String
Dim progid As String
instance.Add(extension, defaultIcon, description, _
progid)
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: System.String
The file name extension for the file type.
- defaultIcon
Type: System.String
The default icon that is associated with files of this type.
- description
Type: System.String
The description of the program used to open files of this type.
- progid
Type: System.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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IFileAssociationCollection Interface