CommandWindow.Parent 속성
지정된 개체의 직계 개체를 가져옵니다.
네임스페이스: 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)
{
try
{
// Get a reference to a Command window.
Window win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow);
CommandWindow cmdWin = (CommandWindow)win.Object;
// Add some text to the window.
cmdWin.OutputString("This is a line of text in the CommandWindow TextDocument");
// Return the contents of the TextDocument and display them.
TextDocument txtDoc = cmdWin.TextDocument;
TextSelection txtSel = txtDoc.Selection;
TextRanges txtRanges = txtSel.TextRanges;
// Show text in textdocument.
foreach (TextRange txtRange in txtRanges)
{
txtRange.StartPoint.StartOfDocument();
MessageBox.Show(txtRange.StartPoint.GetText(txtRange.EndPoint));
}
// Show the CommandWindow's parent object's caption property.
MessageBox.Show("The Parent window's caption: " + cmdWin.Parent.Caption);
// Show the application object containing the CommandWindow.
MessageBox.Show(cmdWin.DTE.Name);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.