Solution3.IsOpen Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Получает значение, указывающее, открыто ли решение.
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
Значение свойства
Возвращает true, если решение открыто; в противном случае — false.
Реализации
- Атрибуты
Примеры
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 Solution3 = CType _
(_applicationObject.Solution, Solution3)
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
{
Solution3 soln = (Solution3)_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);
}
}
Комментарии
Открытое решение не обязательно содержит файл решения (SLN), так как он, возможно, еще не сохранен.