本文整理汇总了C#中Contacts类的典型用法代码示例。如果您正苦于以下问题:C# Contacts类的具体用法?C# Contacts怎么用?C# Contacts使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Contacts类属于命名空间,在下文中一共展示了Contacts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainPage
public MainPage()
{
InitializeComponent();
contacts = new Contacts();
contacts.SearchCompleted += contacts_SearchCompleted;
appointments.SearchCompleted += appointments_SearchCompleted;
}
示例2: LoadContactsToDbAsync
public void LoadContactsToDbAsync()
{
var cons = new Contacts();
cons.SearchCompleted += ContactsSearchCompleted;
cons.SearchAsync(String.Empty, FilterKind.None, null);
}
示例3: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
Contacts objContacts = new Contacts();
objContacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(objContacts_SearchCompleted);
objContacts.SearchAsync(string.Empty, FilterKind.None, null);
}
示例4: ConversationForm
/// <summary>
/// Constructeur de la classe
/// </summary>
/// <param name="contact">La ligne du contact avec laquel on a une conversation</param>
/// <param name="index">L'indice de ce contact dans la liste des contacts</param>
public ConversationForm(Contacts.ContactsDataSet.ContactsRow contact, int index)
{
InitializeComponent();
// permettra de tenir a jour la liste des conversations ouvertes.
indice = index;
Address = contact.Address;
DisplayName = contact.DisplayName;
Text = Address;
// On séléctionne la zone de texte dans laquelle il faut écrire pour communiquer.
WriteBox.Select();
// Mise à jour de la barre de status
StatusLabel.Text += DisplayName + " et vous commencée.";
// définition de la fonction à éxécuter par le BackgroundWorker
bw.DoWork += bw_DoWork;
// On s'abonne à l'évenement de reception des messages
SessionController.GetInstance().MessageReceived += ConversationForm_MessageReceived;
// On s'abonne à l'évenement d'appuie sur une touche ( on n'agit que sur la touche entrer )
WriteBox.KeyUp += WriteBox_KeyUp;
}
示例5: HomeModule
public HomeModule()
{
Get["/"] = _ =>
{
return View ["hub.cshtml"];
};
Get["/add_contact"] = _ =>
{
return View ["add_contact.cshtml"];
};
Post["/contact_created"] = _ =>
{
string name = Request.Form["contactName"];
int number = Request.Form["contactPhone"];
string address = Request.Form["contactAddress"];
Contacts newContact = new Contacts(name, address, number);
return View ["contact_added.cshtml", newContact];
};
Get["/view_contacts"] = _ =>
{
return View ["view_contacts.cshtml", Contacts.GetAllContacts()];
};
Get["/view_contacts/{id}"] = parameters =>
{
return View ["contact_detail.cshtml", Contacts.GetContactById(parameters.id)];
};
Get["/contacts_cleared"] = _ =>
{
Contacts.ClearContacts();
return View ["contacts_deleted"];
};
}
示例6: Delete
public ActionResult Delete(Contacts contactToDelete)
{
/*if(*/
_service.DeleteContact(contactToDelete);/*)*/
return RedirectToAction("Index");
//return View();
}
示例7: InitData
private void InitData()
{
int nItemID = ConvertData.ConvertToInt(Request.QueryString[Constants.ACTION_ID]);
string URL = Constants.ROOT + Pages.BackEnds.ADMIN + "?" + Constants.PAGE + "=" + Pages.BackEnds.STR_CONTACT;
try
{
if (nItemID > 0)
{
Contacts objContactUs = new Contacts();
objContactUs.LoadById(nItemID);
lblEmail.Text = ConvertData.ConvertToString(objContactUs.Data.Email);
lblFullName.Text = objContactUs.Data.Fullname.ToLower();
lblTelephone.Text = objContactUs.Data.Telephone;
lblMainContent.Text = objContactUs.Data.MainContent;
lblTelephone.Text = objContactUs.Data.Telephone;
lblContactDate.Text = ConvertData.ConvertIntToDatetimeString(objContactUs.Data.CreatedDate);
int Result = objContactUs.UpdateStatus(nItemID, EnumeType.ACTIVE);
}
else
{ Response.Redirect(URL); }
}
catch
{
Response.Redirect(URL);
}
}
示例8: getContacts
public void getContacts()
{
Contacts cons = new Contacts();
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
cons.SearchAsync(string.Empty, FilterKind.None, null);
}
示例9: Details_Loaded
private void Details_Loaded(object sender, RoutedEventArgs e)
{
var name = NavigationContext.QueryString["name"];
Contacts c = new Contacts();
c.SearchCompleted += c_SearchCompleted;
c.SearchAsync(name, FilterKind.DisplayName, name);
}
示例10: Fix_Name
private void Fix_Name(Contacts cont)
{
if (cont.FirstName != null)
return;
int fn = 0;
int ln = 1;
string fname = "";
string lname = "";
string[] nps = cont.Name.Split(' ');
List<string> newname = new List<string>();
foreach (string name in nps)
{
string n = "";
string nn = name.Replace(".", "");
if (nn.Length == 1)
continue;
else
n = name.Substring(0, 1) + name.Substring(1).ToLower();
newname.Add(n);
}
if (newname.Count == 0)
return;
fname = newname[0];
for (int i = 1; i < newname.Count; i++)
{
lname += newname[i] + " ";
}
cont.FirstName = fname;
if (lname.Length > 199)
lname = lname.Substring(0, 199);
cont.LastName = lname;
}
示例11: GetAllAsync
public Task<Contact[]> GetAllAsync()
{
var taskCompletionSource = new TaskCompletionSource<Contact[]>();
var contacts = new Contacts();
contacts.SearchCompleted += (sender, args) =>
{
var addressbook = args.Results
.Where(i => !string.IsNullOrEmpty(i.DisplayName))
.Select(ToContact)
.ToArray();
//if there is no any contact (run in emulator?) - add several fakes
if (!addressbook.Any())
{
addressbook = new[]
{
new Contact { Name = "Egor Bogatov", Number = "+01231"},
new Contact { Name = "Ian Gillan", Number = "+01232"},
new Contact { Name = "Freddie Mercury", Number = "+01233"},
new Contact { Name = "David Gilmour", Number = "+01234"},
new Contact { Name = "Steve Ballmer", Number = "+01235"},
};
}
taskCompletionSource.SetResult(addressbook);
};
contacts.SearchAsync(string.Empty, FilterKind.DisplayName, null);
return taskCompletionSource.Task;
}
示例12: fillContactsTextBox
private string fillContactsTextBox()
{
Contacts cons = new Contacts();
str = "";
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #1");
return str;
}
示例13: Find
public dynamic Find(int id)
{
//var table = new Contacts();
//return table.Single(key: id);
dynamic table = new Contacts();
return table.GetContact(Id: id);
}
示例14: SearchContacts
private void SearchContacts()
{
Contacts cons = new Contacts();
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
cons.SearchAsync(String.Empty, contactFilterKind, "Contacts Test #1");
}
示例15: ProcurarContacto_Click
private void ProcurarContacto_Click(object sender, RoutedEventArgs e)
{
var contacts = new Contacts();
contacts.SearchCompleted += Contacts_SearchCompleted;
contacts.SearchAsync(nomeTextbox.Text,
FilterKind.DisplayName, null);
}