Example #1
0
 public new void DeserializeToken(JSONReader JSONReader, string Tag)
 {
     switch (Tag) {
         case "Account" : {
             Account = JSONReader.ReadString ();
             break;
             }
         case "Domain" : {
             Domain = JSONReader.ReadString ();
             break;
             }
         case "HavePasscode" : {
             HavePasscode = JSONReader.ReadBoolean ();
             break;
             }
         case "HaveDisplay" : {
             HaveDisplay = JSONReader.ReadBoolean ();
             break;
             }
         case "Challenge" : {
             Challenge = JSONReader.ReadBinary ();
             break;
             }
         case "DeviceID" : {
             DeviceID = JSONReader.ReadString ();
             break;
             }
         case "DeviceURI" : {
             DeviceURI = JSONReader.ReadString ();
             break;
             }
         case "DeviceImage" : {
             DeviceImage = new ImageLink (JSONReader);
             break;
             }
         case "DeviceName" : {
             DeviceName = JSONReader.ReadString ();
             break;
             }
         default : {
             ((BindRequest)this).DeserializeToken(JSONReader, Tag);
             break;
             }
         }
     // check up that all the required elements are present
 }
Example #2
0
        public new void DeserializeToken(JSONReader JSONReader, string Tag)
        {
            switch (Tag) {
                case "Challenge" : {
                    Challenge = JSONReader.ReadBinary ();
                    break;
                    }
                case "ChallengeResponse" : {
                    ChallengeResponse = JSONReader.ReadBinary ();
                    break;
                    }
                case "VerificationImage" : {
                    bool _Going = JSONReader.StartArray ();
                    VerificationImage = new List <ImageLink> ();
                    while (_Going) {
                        ImageLink _Item = new ImageLink (JSONReader);
                        VerificationImage.Add (_Item);
                        _Going = JSONReader.NextArray ();
                        }

                    break;
                    }
                default : {
                    ((BindResponse)this).DeserializeToken(JSONReader, Tag);
                    break;
                    }
                }
            // check up that all the required elements are present
        }
Example #3
0
        public static void Deserialize(string _Input, out ImageLink Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

            JSONReader.StartObject ();
            string token = JSONReader.ReadToken ();
            Out = null;

            switch (token) {

                case "ImageLink" : {
                    ImageLink Result = new ImageLink ();
                    Result.Deserialize (JSONReader);
                    Out = Result;
                    break;
                    }

                default : {
                    throw new Exception ("Not supported");
                    }
                }
            JSONReader.EndObject ();

            // should we check for EOF here?
        }