Solution4.IsOpen Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém se uma solução está aberta.
public:
property bool IsOpen { bool get(); };
public:
property bool IsOpen { bool get(); };
[System.Runtime.InteropServices.DispId(36)]
public bool IsOpen { [System.Runtime.InteropServices.DispId(36)] get; }
[<System.Runtime.InteropServices.DispId(36)>]
[<get: System.Runtime.InteropServices.DispId(36)>]
member this.IsOpen : bool
Public ReadOnly Property IsOpen As Boolean
Valor da propriedade
true se uma solução estiver aberta; caso contrário, false .
Implementações
- Atributos
Exemplos
Sub IsOpenExample(ByVal dte As DTE2)
' Display the IsOpen status of the solution.
' Open a solution in Visual Studio before running this example.
Try
Dim soln As Solution4 = CType _
(_applicationObject.Solution, Solution4)
Dim solnName As String = _
System.IO.Path.GetFileNameWithoutExtension(soln.FullName)
MsgBox("Solution " & solnName & _
" has the following IsOpen state:" & _
vbCrLf & vbCrLf & soln.IsOpen.ToString())
Catch ex As System.Exception
MsgBox(ex.ToString)
End Try
End Sub
using System.Windows.Forms;
public void IsOpenExample(DTE2 dte)
{
// Determines if a solution is open.
// Open a solution in Visual Studio before running this example.
try
{
Solution4 soln = (Solution4)_applicationObject.Solution;
string solnName =
System.IO.Path.GetFileNameWithoutExtension(soln.FullName);
MessageBox.Show("Solution " + solnName + " IsOpen status is: "
+ soln.IsOpen.ToString());
}
catch(SystemException ex)
{
MessageBox.Show("ERROR: " + ex);
}
}
Comentários
Uma solução aberta não tem necessariamente um arquivo de solução (. sln), pois talvez ainda não tenha sido salvo.