OdsoRecipientDataCollection

OdsoRecipientDataCollection class

Yazılı bir koleksiyonOdsoRecipientData

Daha fazla bilgi edinmek için şu adresi ziyaret edin:Posta Birleştirme ve Raporlama belgeleme makalesi.

public class OdsoRecipientDataCollection : IEnumerable<OdsoRecipientData>

yapıcılar

İsimTanım
OdsoRecipientDataCollection()Default_Constructor

Özellikleri

İsimTanım
Count { get; }Koleksiyonda bulunan öğelerin sayısını alır.
Item { get; set; }Bu koleksiyondaki bir öğeyi alır veya ayarlar.

yöntemler

İsimTanım
Add(OdsoRecipientData)Bu koleksiyonun sonuna bir nesne ekler.
Clear()Bu koleksiyondaki tüm öğeleri kaldırır.
GetEnumerator()Koleksiyondaki tüm öğeler üzerinde yineleme yapmak için kullanılabilen bir numaratör nesnesi döndürür.
RemoveAt(int)Belirtilen dizindeki öğeyi kaldırır.

Örnekler

Bir posta birleştirme işleminin hangi birleştirme veri kaynağı kayıtlarını hariç tutacağını belirten veri koleksiyonuna nasıl erişileceğini gösterir.

Document doc = new Document(MyDir + "Odso data.docx");

OdsoRecipientDataCollection dataCollection = doc.MailMergeSettings.Odso.RecipientDatas;

Assert.AreEqual(70, dataCollection.Count);

using (IEnumerator<OdsoRecipientData> enumerator = dataCollection.GetEnumerator())
{
    int index = 0;
    while (enumerator.MoveNext())
    {
        Console.WriteLine(
            $"Odso recipient data index {index++} will {(enumerator.Current.Active ? "" : "not ")}be imported upon mail merge.");
        Console.WriteLine($"\tColumn #{enumerator.Current.Column}");
        Console.WriteLine($"\tHash code: {enumerator.Current.Hash}");
        Console.WriteLine($"\tContents array length: {enumerator.Current.UniqueTag.Length}");
    }
}

// Bu koleksiyondaki elemanları klonlayabiliriz.
Assert.AreNotEqual(dataCollection[0], dataCollection[0].Clone());

// Ayrıca öğeleri tek tek kaldırabilir veya tüm koleksiyonu bir kerede temizleyebiliriz.
dataCollection.RemoveAt(0);

Assert.AreEqual(69, dataCollection.Count);

dataCollection.Clear();

Assert.AreEqual(0, dataCollection.Count);

Ayrıca bakınız