Compartir a través de


HTMLWindow.Parent (Propiedad)

Obtiene el objeto primario inmediato de un objeto HTMLWindow.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
ReadOnly Property Parent As Window
Window Parent { get; }
property Window^ Parent {
    Window^ get ();
}
abstract Parent : Window
function get Parent () : Window

Valor de propiedad

Tipo: EnvDTE.Window
Un objeto Window.

Comentarios

La propiedad Parent devuelve el objeto primario inmediato del objeto o la colección.

Ejemplos

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

Seguridad de .NET Framework

Vea también

Referencia

HTMLWindow Interfaz

EnvDTE (Espacio de nombres)

Otros recursos

Cómo: Compilar y ejecutar los ejemplos de código del modelo de objetos de automatización