実行時に連絡先(複数可)を予定に割り当てるには、[連絡先]ダイアログボックスを使用します。項目の追加方法については、「連絡先リストの追加」を参照してください。
The contact appears next in the Contacts text box as shown in the following image.
実行時に連絡先を予定に割り当てるには
To assign contacts to an appointment programmatically, use the following code:
C# |
コードのコピー
|
---|---|
//予定を作成します。 Appointment app = new Appointment(DateTime.Now.Date,DateTime.Now.Date.AddDays(1)); app.Subject = "Meeting"; sched1.DataStorage.AppointmentStorage.Appointments.Add(app); //連絡先を ContactList に追加します。 sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Lionel Messi" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Cristiano Ronaldo" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Xavi" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Andres Iniesta" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Zlatan Ibrahimovic" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Radamel Falcao" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Robin van Persie" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Andrea Pirlo" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "aya Toure" }); sched1.DataStorage.ContactStorage.Contacts.Add(new Contact() { MenuCaption = "Edinson Cavani" }); var appointment = sched1.DataStorage.AppointmentStorage.Appointments.First(x => x.Start == DateTime.Now.Date); var contactList = sched1.DataStorage.ContactStorage.Contacts; appointment.Links.Add(contactList.First(x => x.MenuCaption == "Cristiano Ronaldo")); appointment.Links.Add(contactList.First(x => x.MenuCaption == "Lionel Messi")); |