DesignerDocDataService.GetFileDocData Method (String, FileAccess, String)

Retrieves a DocData with the given name.

Namespace:  Microsoft.VisualStudio.Shell.Design.Serialization
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

'宣言
Public Function GetFileDocData ( _
    fileName As String, _
    access As FileAccess, _
    createTemplate As String _
) As DocData
'使用
Dim instance As DesignerDocDataService
Dim fileName As String
Dim access As FileAccess
Dim createTemplate As String
Dim returnValue As DocData

returnValue = instance.GetFileDocData(fileName, _
    access, createTemplate)
public DocData GetFileDocData(
    string fileName,
    FileAccess access,
    string createTemplate
)
public:
DocData^ GetFileDocData(
    String^ fileName, 
    FileAccess access, 
    String^ createTemplate
)
public function GetFileDocData(
    fileName : String, 
    access : FileAccess, 
    createTemplate : String
) : DocData

Parameters

  • fileName
    Type: System.String

    The name of the requested child document.

  • createTemplate
    Type: System.String

    The path of a template file to be used in case the named document cannot be retrieved.

Return Value

Type: Microsoft.VisualStudio.Shell.Design.Serialization.DocData

DocData, or a null reference (Nothing in Visual Basic) if the file does not exist and createTemplate is a null reference (Nothing in Visual Basic).

Remarks

If the file does not exist and createTemplate points to a valid file, the file will be created as a copy of the template. The file will be checked out from source code control if F:System.IO.FileAccess.Write is requested.

The service keeps track of all doc data objects returned and disposes of them automatically when the service itself is disposed. Because of this files are saved as a unit so usually there is no need to dispose this doc data yourself.

Permissions

See Also

Reference

DesignerDocDataService Class

DesignerDocDataService Members

GetFileDocData Overload

Microsoft.VisualStudio.Shell.Design.Serialization Namespace