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
 /**  For messages of type POSTED_FILES, parses the body XML and creates a list of Transfer instances.
 @returns transfers
  */
 public SktTransfer.List GetTransfers()
 {
     if (skypeRef.logging) skypeRef.Log("Executing Message.GetTransfers");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 4, OID);
     SktTransfer.List transfers = new SktTransfer.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("SktMessage.GetTransfers failed.");
         argNr = (char)skypeRef.transport.ReadByte();
         switch (argNr)
         {
             case 1:
                 transfers = (SktTransfer.List)skypeRef.decoder.DecodeObjectList(6);
                 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 SktMessage.GetTransfers", argNr));
                 break;
         }
     }
     } while (marker != 'z');
     skypeRef.transport.ResumeSocketReaderFromMethod();
     return transfers;
 }