예제 #1
0
 private void fileList_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (nexusAPIURL != null && e.AddedItems.Count == 1)
     {
         NexusFiles files = e.AddedItems[0] as NexusFiles;
         apiURL.Text = string.Format("{0}/files/{1}/download_link", nexusAPIURL, files.file_id);
     }
 }
예제 #2
0
        public static NexusFiles Deserialize(string json)
        {
            var          files    = new NexusFiles();
            MemoryStream ms       = new MemoryStream(Encoding.UTF8.GetBytes(json));
            var          settings = new DataContractJsonSerializerSettings();

            settings.UseSimpleDictionaryFormat = true;
            var serializer = new DataContractJsonSerializer(files.GetType(), settings);

            files = serializer.ReadObject(ms) as NexusFiles;
            ms.Close();

            return(files);
        }