ContentControlContentUpdatingEventArgs Arabirim

Tanım

ContentUpdatingİçerik denetimi olayı için veri sağlar.

[System.Runtime.InteropServices.Guid("a2f71dcd-984c-4fed-8395-1ca5588190d6")]
public interface ContentControlContentUpdatingEventArgs
Öznitelikler

Örnekler

Aşağıdaki kod örneği, ve olayları için olay işleyicilerini ContentUpdating gösterir StoreUpdating . Bu örnek, belgenin PlainTextContentControl plainTextContentControl1 özel bir XML parçasındaki bir öğeye bağlanan adlandırılmış bir ada sahip olduğunu varsayar. Bir içerik denetiminin özel XML parçasındaki bir öğeye nasıl bağlanacağını gösteren bir kod örneği için bkz. Izlenecek yol: Içerik denetimlerini özel XML bölümlerine bağlama.

Bu kodu kullanmak için ThisDocument projenizdeki sınıfa yapıştırın. C# için olay işleyicilerini ve olaylarına de eklemeniz gerekir ContentUpdating StoreUpdating plainTextContentControl1 .

Bu örnek, belge düzeyinde özelleştirme içindir

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

Özellikler

Content

Denetime bağlanan özel XML bölümünden içerik denetimine yazılan metni alır veya ayarlar.

Şunlara uygulanır