本文整理汇总了C#中Book.Open方法的典型用法代码示例。如果您正苦于以下问题:C# Book.Open方法的具体用法?C# Book.Open怎么用?C# Book.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book.Open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetContacts
public ArrayList GetContacts(string bookName)
{
string contact_fax = null;
ArrayList ebooks = new ArrayList();
ArrayList records = new ArrayList();
SourceList slist = new SourceList ("/apps/evolution/addressbook/sources");
if (slist != null) {
SList group_list = slist.Groups;
foreach (SourceGroup group in group_list) {
//Only get phone books on this machine.
if (group.Name == "On This Computer") {
SList src_list = group.Sources;
foreach (Evolution.Source src in src_list) {
if (src.Name == bookName) {
//Book bk = Book.NewSystemAddressbook ();
Book bk = new Book(src);
bk.Open (true);
BookQuery q = BookQuery.AnyFieldContains ("");
Contact[] contactlist = bk.GetContacts (q);
//Console.WriteLine ("Contact count (range) : {0}", contactlist.Length);
if (contactlist != null) {
foreach (Contact comp in contactlist) {
contact_fax = null;
if (comp.BusinessFax != null && comp.BusinessFax != String.Empty) {
contact_fax = comp.BusinessFax;
}
else if (comp.OtherFax != null && comp.OtherFax != String.Empty) {
contact_fax = comp.OtherFax;
}
else if (comp.HomeFax != null && comp.HomeFax != String.Empty) {
contact_fax = comp.HomeFax;
}
if (contact_fax != null) {
GfaxContact gc = new GfaxContact();
//Console.WriteLine ("Id: {0}", comp.Id);
gc.PhoneNumber = contact_fax;
gc.ContactPerson = comp.FullName;
gc.Organization = comp.Org;
records.Add(gc);
}
}
}
}
}
}
}
}
return records;
}