HTMLWindow.Parent 屬性
取得 HTMLWindow 物件的直屬父物件。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
'宣告
ReadOnly Property Parent As Window
Window Parent { get; }
property Window^ Parent {
Window^ get ();
}
abstract Parent : Window
function get Parent () : Window
屬性值
型別:EnvDTE.Window
Window 物件。
備註
Parent 屬性會將直接上層父代傳給物件或集合。
範例
public void CodeExample(DTE2 dte, AddIn addin)
{
// Make sure you have an open HTML document before running this example.
try
{
if (dte.ActiveDocument.ActiveWindow.Object is HTMLWindow)
{
HTMLWindow htmlwin;
string msg = "";
htmlwin = dte.ActiveDocument.ActiveWindow.Object as HTMLWindow;
// Show the related application object's name.
msg += "The application containing this HTMLWindow is " + htmlwin.DTE.Name;
// Show the HTMLWindow's parent object.
msg += "\nThe HTMLWindow's parent object is " + htmlwin.Parent.Type.ToString();
MessageBox.Show(msg);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。