Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 /**  Returns a list of custom contact group references, i.e. all contact groups that are not hardwired.
 @returns groups
  */
 public SktContactGroup.List GetCustomContactGroups()
 {
     if (skypeRef.logging) skypeRef.Log("Executing Skype.GetCustomContactGroups");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 2, OID);
     SktContactGroup.List groups = new SktContactGroup.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("SktSkype.GetCustomContactGroups failed.");
         argNr = (char)skypeRef.transport.ReadByte();
         switch (argNr)
         {
             case 1:
                 groups = (SktContactGroup.List)skypeRef.decoder.DecodeObjectList(10);
                 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 SktSkype.GetCustomContactGroups", argNr));
                 break;
         }
     }
     } while (marker != 'z');
     skypeRef.transport.ResumeSocketReaderFromMethod();
     return groups;
 }