ItemOperations.OpenFile – metoda
Otevře soubor, jako kdyby vyvolání Otevřít soubor v integrované vývojové prostředí (IDE).
Obor názvů: EnvDTE
Sestavení: EnvDTE (v EnvDTE.dll)
Syntaxe
'Deklarace
Function OpenFile ( _
FileName As String, _
ViewKind As String _
) As Window
Window OpenFile(
string FileName,
string ViewKind
)
Window^ OpenFile(
[InAttribute] String^ FileName,
[InAttribute] String^ ViewKind
)
abstract OpenFile :
FileName:string *
ViewKind:string -> Window
function OpenFile(
FileName : String,
ViewKind : String
) : Window
Parametry
FileName
Typ: StringPovinné.Úplná cesta a název souboru, který chcete otevřít.
ViewKind
Typ: StringNepovinné.A ConstantsvsViewKind* Konstanta určující typ zobrazení, ve kterém chcete soubor vytvořit.
Vrácená hodnota
Typ: EnvDTE.Window
Objekt Window.
Příklady
Sub OpenFileExample()
Dim ItemOp As ItemOperations
ItemOp = DTE.ItemOperations
' Open a log file as a text document.
ItemOp.OpenFile("c:\windows\ocgen.log", Constants.vsViewKindTextView)
End Sub
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.