Share via


Configuration.IsBuildable, propriété

Obtient une valeur indiquant si la configuration du projet ou de l'élément de projet peut être générée.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
ReadOnly Property IsBuildable As Boolean
    Get
bool IsBuildable { get; }
property bool IsBuildable {
    bool get ();
}
abstract IsBuildable : bool
function get IsBuildable () : boolean

Valeur de propriété

Type : System.Boolean
Valeur booléenne indiquant true si un projet ou élément de projet doit être généré, false dans le cas contraire.

Notes

Pour spécifier si un projet ou un élément de projet doit être généré, définissez-le dans un objet SolutionContext comme étant la configuration comportant le contexte et les générations d'une configuration de solution donnée.

Exemples

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        Project prj;
        Configuration config;
        if (dte.Solution.Projects.Count > 0)
        {
            prj = dte.Solution.Projects.Item(1);
            config = prj.ConfigurationManager.ActiveConfiguration;
            // Determine and show whether the active configuration is buildable.
            MessageBox.Show(config.IsBuildable.ToString());
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

Sécurité .NET Framework

Voir aussi

Référence

Configuration Interface

EnvDTE, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation