Share via


ContentControlBase.StoreUpdating 이벤트

Microsoft Office Word에서 콘텐츠 컨트롤에 바인딩된 사용자 지정 XML 부분의 데이터를 업데이트하기 직전, 즉 콘텐츠 컨트롤의 텍스트가 변경된 후에 발생합니다.

네임스페이스:  Microsoft.Office.Tools.Word
어셈블리:  Microsoft.Office.Tools.Word(Microsoft.Office.Tools.Word.dll)

구문

‘선언
Event StoreUpdating As ContentControlStoreUpdatingEventHandler
event ContentControlStoreUpdatingEventHandler StoreUpdating

설명

문서에 포함된 XML 부분(사용자 지정 XML 부분이라고도 함)의 요소에 콘텐츠 컨트롤을 바인딩할 수 있습니다. 자세한 내용은 콘텐츠 컨트롤사용자 지정 XML 부분 개요을 참조하십시오.

StoreUpdating 이벤트는 콘텐츠 컨트롤이 사용자 지정 XML 부분의 요소에 바인딩되어 있고 콘텐츠 컨트롤의 텍스트가 변경될 때 발생합니다.

이벤트 처리에 대한 자세한 내용은 이벤트 사용을 참조하십시오.

예제

다음 코드 예제에서는 StoreUpdating 및 ContentUpdating 이벤트의 이벤트 처리기를 보여 줍니다. 이 예제에서는 사용자 지정 XML 부분의 요소에 바인딩되어 있는 plainTextContentControl1이라는 PlainTextContentControl이 문서에 포함되어 있다고 가정합니다. 사용자 지정 XML 부분의 요소에 콘텐츠 컨트롤을 바인딩하는 방법을 보여 주는 코드 예제는 연습: 콘텐츠 컨트롤을 사용자 지정 XML 부분에 바인딩을 참조하십시오.

이 코드를 사용하려면 프로젝트의 ThisDocument 클래스에 해당 코드를 붙여넣습니다. 또한 C#의 경우 plainTextContentControl1의 StoreUpdating 및 ContentUpdating 이벤트에 이벤트 처리기를 연결해야 합니다.

Private Sub plainTextContentControl1_StoreUpdating(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ContentControlStoreUpdatingEventArgs) _
    Handles PlainTextContentControl1.StoreUpdating

    MessageBox.Show("The control was changed to the following value: " & vbCrLf & _
        e.Content & vbCrLf & "This value is about to be written to the node that is bound to this control.")
End Sub

Private Sub plainTextContentControl1_ContentUpdating(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ContentControlContentUpdatingEventArgs) _
    Handles PlainTextContentControl1.ContentUpdating

    MessageBox.Show("The node that is bound to this control was changed to the following value: " & vbCrLf & _
        e.Content & vbCrLf & "This value is about to be written to this control.")
End Sub
void plainTextContentControl1_StoreUpdating(object sender, 
    Microsoft.Office.Tools.Word.ContentControlStoreUpdatingEventArgs e)
{
    MessageBox.Show("The control was changed to the following value: \n\n" +
        e.Content + "\n\nThis value is about to be written to the node that is bound to this control.");
}

void plainTextContentControl1_ContentUpdating(object sender, 
    Microsoft.Office.Tools.Word.ContentControlContentUpdatingEventArgs e)
{
    MessageBox.Show("The node that is bound to this control was changed to the following value: \n\n" +
        e.Content + "\n\nThis value is about to be written to this control.");
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

ContentControlBase 인터페이스

Microsoft.Office.Tools.Word 네임스페이스

기타 리소스

콘텐츠 컨트롤

사용자 지정 XML 부분 개요

연습: 콘텐츠 컨트롤을 사용자 지정 XML 부분에 바인딩