Aracılığıyla paylaş


ContentControlBase.StoreUpdating Olay

Yalnızca Microsoft Office Word'ün verileri, içeriğe bağlı özel XML bölümü güncellemeden önce oluşur (metin içerik denetimi değişiklikleri) sonra denetlemek.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)

Sözdizimi

'Bildirim
Event StoreUpdating As ContentControlStoreUpdatingEventHandler
event ContentControlStoreUpdatingEventHandler StoreUpdating

Notlar

Bir XML parçasına öğe içerik denetimlerini bağlayabilirsiniz (adı da özel XML bölümü) belgede katıştırılmış.Daha fazla bilgi için, bkz. İçerik Denetimleri ve Özel XML Bölümlerine Genel Bakış.

StoreUpdating Olayı metin içerik denetimi olarak değiştirir ve bir özelleşmiş XML bölümündeki bir öğeye içerik denetiminin bağlı.

Örnekler

Aşağıdaki kod örneği için olay işleyicilerini gösterir StoreUpdating ve ContentUpdating olaylar.Bu örnek belgeyi içeren varsayar bir PlainTextContentControl adlı plainTextContentControl1 bir özelleşmiş XML bölümündeki bir öğeye bağlı.İçerik denetimini özelleşmiş bir XML bölümüne bağlamak nasıl gösteren bir kod örneği için bkz: İzlenecek Yol: İçerik Denetimlerini Özel XML Bölümlerine Bağlama.

Bu kodu kullanmak için kodu, projenizdeki ThisDocument sınıfının içine yapıştırın.C# [NULL]'ta, ayrıca olay işleyicileri eklemelisiniz StoreUpdating ve ContentUpdating olayları plainTextContentControl1.

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 Güvenliği

Ayrıca bkz.

Başvuru

ContentControlBase Arabirim

Microsoft.Office.Tools.Word Ad Alanı

Diğer Kaynaklar

İçerik Denetimleri

Özel XML Bölümlerine Genel Bakış

İzlenecek Yol: İçerik Denetimlerini Özel XML Bölümlerine Bağlama