/** result list is dynamically updated @returns contacts @param [in] from Default value is 0 @param [in] count Default value is uint.MaxValue */ public SktContact.List GetResults(uint from=0, uint count=uint.MaxValue) { if (skypeRef.logging) skypeRef.Log("Executing ContactSearch.GetResults"); uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 11, OID); skypeRef.encoder.AddUintParam(1, from); skypeRef.encoder.AddUintParam(2, count); SktContact.List contacts = new SktContact.List(); // We always guarantee non-null list is returned skypeRef.transport.SubmitMethodRequest (RequestId); int argNr, marker; do { marker = (char)skypeRef.transport.ReadByte(); if (marker != 'z') { if (marker == 'N') skypeRef.Error("SktContactSearch.GetResults failed."); argNr = (char)skypeRef.transport.ReadByte(); switch (argNr) { case 1: contacts = (SktContact.List)skypeRef.decoder.DecodeObjectList(2); break; case 'z': marker = argNr; break; // exiting the arg loop if the method failed default: skypeRef.Error(String.Format("Got unexpected response argument {0} from runtime in SktContactSearch.GetResults", argNr)); break; } } } while (marker != 'z'); skypeRef.transport.ResumeSocketReaderFromMethod(); return contacts; }
internal override SktObjectList CreateObjectList(uint classId) { SktObjectList newList; switch (classId) { case 19 : newList = new SktParticipant.List(); break; case 10 : newList = new SktContactGroup.List(); break; case 11 : newList = new SktVideo.List(); break; case 9 : newList = new SktMessage.List(); break; case 7 : newList = new SktVoicemail.List(); break; case 6 : newList = new SktTransfer.List(); break; case 2 : newList = new SktContact.List(); break; case 18 : newList = new SktConversation.List(); break; case 1 : newList = new SktContactSearch.List(); break; case 12 : newList = new SktSms.List(); break; case 5 : newList = new SktAccount.List(); break; default: skypeRef.Error(String.Format("Attempt to construct a list object with invalid class ID {0}", classId)); return null; } return newList; }
public void OnAccountStatus(SktAccount sender, EventArgs e) { loginFeedback.Text = "Login in progress.. " + sender.P_STATUS.ToString(); if (sender.P_STATUS == SktAccount.STATUS.LOGGED_IN) { loginFeedback.Text = ""; SktContactGroup allAuthorizedContacts; allAuthorizedContacts = skype.GetHardwiredContactGroup(SktContactGroup.TYPE.ALL_BUDDIES); contactList = allAuthorizedContacts.GetContacts(); foreach (SktContact contact in contactList) { contactListBox.Items.Add(contact); } } if (sender.P_STATUS == SktAccount.STATUS.LOGGED_OUT) { DialogResult result = MessageBox.Show(this, "Login failed because of " + sender.P_LOGOUTREASON.ToString(), "Login has failed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign); } }
// Note that we are using SKYPE_BUDDIES filter for our connectable contact list. // The reason not to use ONLINE_BUDDIES filter is that online statuses take rather // long time to update. As with calls, it is better to attempt connection to an // apparently offline contact and then handle failure, rather than to only allow // connections to people who are known for sure to be online. private void UpdateContactCombo() { SktContactGroup allAuthorizedContacts; allAuthorizedContacts = skype.GetHardwiredContactGroup(SktContactGroup.TYPE.SKYPE_BUDDIES); contactList = allAuthorizedContacts.GetContacts(); contactCombo.Items.Clear(); foreach (SktContact contact in contactList) { contactCombo.Items.Add(contact); } contactCombo.Enabled = (contactCombo.Items.Count != 0); }
// Refreshing the contact list box private void UpdateContactListBox() { SktContactGroup allAuthorizedContacts; allAuthorizedContacts = skype.GetHardwiredContactGroup(SktContactGroup.TYPE.ALL_KNOWN_CONTACTS); contactList = allAuthorizedContacts.GetContacts(); contactListBox.Items.Clear(); foreach (SktContact contact in contactList) { contactListBox.Items.Add(contact); } }