Solution4.Saved Propriedade

Definição

Obtém ou define um valor que indica se uma solução não foi modificada desde a última vez que foi salva ou aberta.

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

Valor da propriedade

Boolean

true Se o objeto não tiver sido modificado desde a última vez que foi salvo ou aberto; caso contrário, false . O padrão é true.

Implementações

Atributos

Exemplos

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);  
    }  
}  

Comentários

A Saved propriedade substitui a IsDirty propriedade no Visual Studio versão 6,0, mas retorna o valor oposto de IsDirty .

Aplica-se a