SolutionBuild.ActiveConfiguration 屬性
取得目前現用的 SolutionConfiguration 物件。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
'宣告
ReadOnly Property ActiveConfiguration As SolutionConfiguration
SolutionConfiguration ActiveConfiguration { get; }
property SolutionConfiguration^ ActiveConfiguration {
SolutionConfiguration^ get ();
}
abstract ActiveConfiguration : SolutionConfiguration
function get ActiveConfiguration () : SolutionConfiguration
屬性值
型別:EnvDTE.SolutionConfiguration
SolutionConfiguration 物件。
備註
SolutionConfiguration 物件代表目前的方案組態,也就是方案建置作業發生時所使用的組態。
範例
public void CodeExample(DTE2 dte)
{
try
{
SolutionBuild sb = dte.Solution.SolutionBuild;
SolutionConfiguration sc = sb.ActiveConfiguration;
vsBuildState vsBS;
string msg = "Return relative path to startup projects: ";
foreach (String s in (Array)sb.StartupProjects)
{
msg += "\n " + s;
}
msg += "\nSolutionConfiguration: " + sc.Name;
vsBS = sb.BuildState;
if (vsBS == vsBuildState.vsBuildStateDone)
msg += "\nA build has occurred.";
else if (vsBS == vsBuildState.vsBuildStateInProgress)
msg += "\nA build is in progress.";
else msg += "\nA build has not occurred.";
MessageBox.Show(msg);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。