예제 #1
0
        void getEightTrackMixes_Completed(object sender, DownloadStringCompletedEventArgs e)
        {
            byte[] encodedString = Encoding.UTF8.GetBytes(e.Result);

            //// Put the byte array into a stream and rewind it to the beginning
            MemoryStream ms = new MemoryStream(encodedString);
            ms.Flush();
            ms.Position = 0;

            // convert json result to model
            Stream stream = ms;
            DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(EightTracksMixes));
            EightTracksMixes myResults =
            (EightTracksMixes)dataContractJsonSerializer.ReadObject(stream);

            var result = myResults;
            objEightTracksMixes = result;
            GetTracksCallback(result, null);
        }
예제 #2
0
 public EightTrackDataService()
 {
     objEightTracksMixes = new EightTracksMixes ();
       objEightTrackPlayToken = new EightTrackPlayToken ();
       objEightTrackPlaySong = new EightTrackPlaySong ();
 }