예제 #1
0
 internal void FireOnContactSearchNewResult(SktContactSearch sender, OnContactSearchNewResultArgs e)
 {
     if (OnContactSearchNewResult == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnContactSearchNewResultInNewThread); return; }
     gui.BeginInvoke(OnContactSearchNewResult, new object[] { sender, e }); // Synchronizing to gui thread
 }
예제 #2
0
 public void Add(SktContactSearch item)
 {
     base.Add((SktContactSearch)item);
 }
예제 #3
0
 internal void FireOnContactSearchContactSearchStatus(SktContactSearch sender, SktContactSearch.STATUS value)
 {
     if (OnContactSearchContactSearchStatus == null) return; // Event not assigned
     OnContactSearchContactSearchStatusArgs args = new OnContactSearchContactSearchStatusArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnContactSearchContactSearchStatusInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnContactSearchContactSearchStatus, new object[] { sender, args }); // Syncing to GUI thread
 }
예제 #4
0
 /**  Adds a string search term to a custom contact search object.
 @returns valid Returns true if the ContactSearch term-set remains valid after adding this term.
 @param [in] prop - Following Contact class string propkeys can be used for Contact search: @li SktContact.P_SKYPENAME
   @li SktContact.P_FULLNAME @li SktContact.P_LANGUAGES @li SktContact.P_COUNTRY @li SktContact.P_PROVINCE
   @li SktContact.P_CITY @li SktContact.P_PHONE_HOME @li SktContact.P_PHONE_OFFICE @li SktContact.P_PHONE_MOBILE
   @li SktContact.P_EMAILS @li SktContact.P_HOMEPAGE @li SktContact.P_ABOUT Note that while SktContact.P_EMAILS is technically a string and can be used in this method, it is recommended
   that you use ContactSearch.AddEmailTerm method instead.
 @param [in] cond - Search condition Skt(ContactSearch.CONDITION)
 @param [in] value - Value to match against.
 @param [in] add_to_subs - This argument enables you to group conditions. See ContactSearch class details for more information.
   Default value is false
  */
 public Boolean AddStrTerm(
 int                             prop,
 SktContactSearch.CONDITION      cond,
 String                          value,
 Boolean                         add_to_subs=false)
 {
     if (skypeRef.logging) skypeRef.Log("Executing ContactSearch.AddStrTerm");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 5, OID);
     skypeRef.encoder.AddPropkeyParam(1, prop);
     skypeRef.encoder.AddEnumParam(2, (uint)cond);
     skypeRef.encoder.AddStringParam(3, value);
     skypeRef.encoder.AddBoolParam(4, add_to_subs);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     Dictionary<uint, uint> tagMap = new Dictionary<uint, uint> { {1, 1} };
     object[] args = new object[1];
     args[0] = false;
     skypeRef.decoder.DecodeMethodResponseArguments(1, ref args, new uint[1]{0}, ref tagMap, "SktContactSearch.AddStrTerm");
     return (Boolean)args[0];
 }
예제 #5
0
 public OnContactSearchContactSearchStatusArgs(SktContactSearch sender, SktContactSearch.STATUS newValue)
 {
     this.sender = sender;  value = newValue;
 }
예제 #6
0
 internal void ProcessOnContactSearchNewResult(SktContactSearch sender)
 {
     if (skypeRef.logging) skypeRef.Log("Processing event OnContactSearchNewResult");
     OnContactSearchNewResultArgs args = new OnContactSearchNewResultArgs();
     int marker = 0;
     int typeTag = 0;
     do
     {
     typeTag = skypeRef.transport.ReadByte();
     if (typeTag == 122) break;
     marker = skypeRef.transport.ReadByte();
     switch (marker)
     {
         case 1:
             args.contact = (SktContact)skypeRef.decoder.DecodeObject(2); // SktContact class ID = 2
             break;
         case 2:
             args.rankValue = skypeRef.decoder.DecodeUint();
             break;
         default:
             if (marker != 122) skypeRef.Error(String.Format("Invalid event argument tag {0} in OnContactSearchNewResult", marker));
             break;
     }
     } while (marker != 'z');
     skypeRef.transport.ResumeSocketReaderFromEvent();
     args.senderobj = sender;
     FireOnContactSearchNewResult(sender, args);
 }
예제 #7
0
 // This callback gets fired every time a new matching contact is found
 public void OnContactSearchNewResult(SktContactSearch sender, SktEvents.OnContactSearchNewResultArgs e)
 {
     this.searchResultListBox.Items.Add(e.contact);
 }
예제 #8
0
 // This callback could be useful for checking if e.value == SktContactSearch.STATUS.FINISHED
 public void OnContactSearchContactSearchStatus(SktContactSearch sender, SktEvents.OnContactSearchContactSearchStatusArgs e)
 {
     feedbackLabel.Text = "Contact search status: " + e.value.ToString();
     if ((e.value == SktContactSearch.STATUS.FINISHED) || (e.value == SktContactSearch.STATUS.FAILED) || (e.value == SktContactSearch.STATUS.EXTENDABLE))
     {
         sender.Release();
     }
 }