Solution4.Saved Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft einen Wert ab, der angibt, ob eine Projektmappe seit dem letzten Speichern oder Öffnen nicht geändert wurde, oder legt diesen Wert fest.
public:
property bool Saved { bool get(); void set(bool value); };
public:
property bool Saved { bool get(); void set(bool value); };
[System.Runtime.InteropServices.DispId(29)]
public bool Saved { [System.Runtime.InteropServices.DispId(29)] get; [System.Runtime.InteropServices.DispId(29)] set; }
[<System.Runtime.InteropServices.DispId(29)>]
[<get: System.Runtime.InteropServices.DispId(29)>]
[<set: System.Runtime.InteropServices.DispId(29)>]
member this.Saved : bool with get, set
Public Property Saved As Boolean
Eigenschaftswert
true, wenn das Objekt seit dem letzten Speichern oder Öffnen nicht geändert wurde; andernfalls false. Der Standardwert lautet true.
Implementiert
- Attribute
Beispiele
Sub PropertiesExample(ByVal dte As DTE2)
' Set and get the Saved status of a 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(solnName & " has the following Saved status: " _
& soln.Saved.ToString())
MsgBox("Setting the Saved status to False")
soln.Saved = False
MsgBox(solnName & " now has the following Saved status: " & soln.Saved.ToString())
Catch ex As System.Exception
MsgBox(ex.ToString)
End Try
End Sub
using System.Windows.Forms;
public void ProjectExample(DTE2 dte)
{
// Get and set the Saved status of a solution.
// 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(solnName + " has the following Saved status: "
+ soln.Saved.ToString());
MessageBox.Show("Setting the Saved status to false...");
soln.Saved = false;
MessageBox.Show(solnName +
" now has the following Saved status: " +
soln.Saved.ToString());
}
catch(SystemException ex)
{
MessageBox.Show("ERROR: " + ex);
}
}
Hinweise
Die- Saved Eigenschaft ersetzt die- IsDirty Eigenschaft in Visual Studio, Version 6,0, gibt jedoch den umgekehrten Wert von zurück IsDirty .