当前位置: 首页>>代码示例>>C#>>正文


C# Json.JsonValue类代码示例

本文整理汇总了C#中System.Json.JsonValue的典型用法代码示例。如果您正苦于以下问题:C# JsonValue类的具体用法?C# JsonValue怎么用?C# JsonValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JsonValue类属于System.Json命名空间,在下文中一共展示了JsonValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ViewResultRow

 /// <constructor />
 public ViewResultRow(JsonValue key, JsonValue value, string documentId, Document document)
 {
     Key = key;
     Value = value;
     DocumentId = documentId;
     Document = document;
 }
开发者ID:artikh,项目名称:CouchDude,代码行数:8,代码来源:ViewResultRow.cs

示例2: WorkshopSetAdapter

		/*private void ParseAndDisplay (JsonValue json, ListView workshopList)
		{

			string jsonString = json.ToString();
			WorkshopSetResult root = JsonConvert.DeserializeObject<WorkshopSetResult> (jsonString);
			workshopSets = root.Results;
			workshopList = FindViewById<ListView> (Resource.Id.workshopList);

			WorkshopSetAdapter adapter = new WorkshopSetAdapter (this, workshopSets);
			workshopList.Adapter = adapter;

			//workshopList.ItemClick += workshopList_ItemClick;
			workshopList.ItemClick += async (object sender, AdapterView.ItemClickEventArgs e) => 
			{
				int clickedID = workshopSets [e.Position].id;

				string url = String.Format ("http://uts-helps-07.cloudapp.net/api/workshop/search?workshopSetID={0}", clickedID);
				Console.WriteLine("Clicked ID is {0}", clickedID);
				Console.WriteLine(url);
				JsonValue j = await FetchWorkshopAsync (url);
				string jObject = j.ToString();
				Intent intent = new Intent (this, typeof(WorkshopActivity));
				//intent.PutExtra ("WorkshopSetID", clickedID);
				intent.PutExtra("JsonValue", jObject);
				this.StartActivity (intent);
			};
		}
开发者ID:SDP2015Group7,项目名称:HELPSMobile,代码行数:27,代码来源:WorkshopSetActivity.cs

示例3: MakeRestaurantInspectionDto

        public static RestaurantInspectionDto MakeRestaurantInspectionDto(JsonValue returnString)
        {
            var returnStringResults = returnString["result"];
            var inspectionList = new List<RestaurantInspectionDto>();
            var inspectionData = new RestaurantInspectionDto();

            if (returnStringResults["total"] != 0)
            {
                var returnStringRecords = returnStringResults["records"];

                foreach (JsonValue establishment in returnStringRecords)
                {
                    var locationFound = new RestaurantInspectionDto()
                    {
                        EstablishmentId = establishment["EstablishmentId"],
                        EstablishmentName = establishment["EstablishmentName"],
                        Grade = establishment["Grade"],
                        Score = establishment["Score"],
                        InspectionDate = establishment["InspectionDate"]
                    };

                    inspectionList.Add(locationFound);
                }

                inspectionData = inspectionList.OrderByDescending(i => i.InspectionDate).ToList().FirstOrDefault();
            }

            return inspectionData;
        }
开发者ID:CodeMonkeyLaura,项目名称:DangerouslyDelicious,代码行数:29,代码来源:ParseJson.cs

示例4: MakeYelpListingDto

        public static List<YelpListingDto> MakeYelpListingDto(JsonValue restaurantList)
        {
            var yelpListingDtoList = new List<YelpListingDto>();

            var businesses = restaurantList["businesses"];

            foreach (JsonValue business in businesses)
            {
                var location = business["location"];
                var address = location["address"];
                var coordinates = location["coordinate"];

                var listing = new YelpListingDto()
                {
                    Id = business["id"],
                    Name = business["name"],
                    Address = address[0],
                    City = location["city"],
                    Latitude = coordinates["latitude"],
                    Longitude = coordinates["longitude"],
                    LocationClosed = business["is_closed"],
                    MobileUrl = business["mobile_url"],
                    Rating = business["rating"],
                    NumberReviews = business["review_count"],
                    RatingImage = business["rating_img_url_large"]
                };

                yelpListingDtoList.Add(listing);
            }

            return yelpListingDtoList;
        }
开发者ID:CodeMonkeyLaura,项目名称:DangerouslyDelicious,代码行数:32,代码来源:ParseJson.cs

示例5: Initalize

 public static  EditTournamentStateDialog Initalize(JsonValue _json, Activity _context)
 {
     var dialogFragment = new EditTournamentStateDialog();
     dialogFragment.json = _json;
     dialogFragment.context = _context;
     return dialogFragment;
 }
开发者ID:coldlink,项目名称:challonger,代码行数:7,代码来源:EditTournamentStateDialog.cs

示例6: RelationshipUser

 public RelationshipUser(JsonValue json)
 {
     Id = json["id"];
     ScreenName = json["screen_name"];
     IsFollowing = json["following"];
     IsFollowedBy = json["followed_by"];
 }
开发者ID:bling,项目名称:Ping.Pong,代码行数:7,代码来源:Relationship.cs

示例7: displayString

 private string displayString(JsonValue input)
 {
     string s = input.ToString ();
     int l = s.Length-2;
     string output = s.Substring(1, l);
     return output;
 }
开发者ID:bny-mobile,项目名称:RemoteData,代码行数:7,代码来源:Tweet.cs

示例8: Parser

 internal Parser(JsonValue json)
 {
     _sourceparser = json;
     MissingTokens = json.ContainsKey("missing_tokens")
                         ? new HashSet<string>(json["missing_tokens"].Select(x => (string) x))
                         : new HashSet<string>();
 }
开发者ID:CVertex,项目名称:bigml-csharp,代码行数:7,代码来源:Parser.cs

示例9: Torrent

        public Torrent(JsonValue json)
        {
            if (json.Count == 1)
            {
                ID = json[0];
                return;
            }

            int index = 0;
            ID = json[index++];
            Status = (TorrentStatus)(int)json[index++];
            Name = json[index++];
            Size = json[index++];
            PercentProgress = json[index++];
            Downloaded = json[index++];
            Uploaded = json[index++];
            Ratio = json[index++];
            UploadSpeed = json[index++];
            DownloadSpeed = json[index++];
            Eta = json[index++];
            Label = json[index++];
            PeersConnected = json[index++];
            PeersInSwarm = json[index++];
            SeedsConnected = json[index++];
            SeedsInSwarm = json[index++];
            Availability = json[index++];
            QueueOrder = json[index++];
            Remaining = json[index++];
        }
开发者ID:jonathanpeppers,项目名称:uController,代码行数:29,代码来源:Torrent.cs

示例10: UserMention

 public UserMention(JsonValue json)
 {
     Id = json["id"];
     Name = json["name"];
     ScreenName = json["screen_name"];
     Indices = ((JsonArray)json["indices"]).Select(x => (int)x).ToArray();
 }
开发者ID:bling,项目名称:Ping.Pong,代码行数:7,代码来源:Tweet.cs

示例11: ToInt

		public static int ToInt (JsonValue jsonValue, string key, int defaultValue = 0)
		{
			int returnValue = JsonUtil.ContainsKey (jsonValue, key)
				? jsonValue [key] as JsonPrimitive
				: defaultValue;			
			return returnValue;
		}
开发者ID:avantidesai,项目名称:EmpireCLS,代码行数:7,代码来源:JsonUtil.cs

示例12: ClassDefiniation

 public ClassDefiniation(string propertyName, JsonValue jValue, StringBuilder sb, string classHeadser)
 {
     PropertyName = propertyName;
     JValue = jValue;
     StringBuilder = sb;
     ClassHeader = classHeadser;
 }
开发者ID:JDCB,项目名称:JDCB,代码行数:7,代码来源:SimpleJsonToDataContractHelper.cs

示例13: RateLimitStatus

 public RateLimitStatus(JsonValue json)
 {
     var resources = json["resources"];
     HelpConfiguration = new RateLimit(resources["help"]["/help/configuration"]);
     HelpPrivacy = new RateLimit(resources["help"]["/help/privacy"]);
     StatusesOembed = new RateLimit(resources["statuses"]["/statuses/oembed"]);
 }
开发者ID:bling,项目名称:Ping.Pong,代码行数:7,代码来源:RateLimit.cs

示例14: ToString

		public static string ToString (JsonValue jsonValue, string key, string defaultValue = "")
		{
			string returnValue = JsonUtil.ContainsKey (jsonValue, key)
				? jsonValue [key] as JsonPrimitive
				: defaultValue;		
			return returnValue;
		}
开发者ID:avantidesai,项目名称:EmpireCLS,代码行数:7,代码来源:JsonUtil.cs

示例15: GetJsonValue

        private object GetJsonValue(JsonValue member) {
            object result = null;
            if (member.JsonType == JsonType.Array) {
                var array = member as JsonArray;
                if (array.Any()) {
                    if (array.First().JsonType == JsonType.Object || array.First().JsonType == JsonType.Array)
                        result = array.Select(x => new DynamicJsonObject(x as JsonObject)).ToArray();
                    else
                        result = array.Select(x => GetJsonValue(x)).ToArray();
                }
                else
                    result = member;
            }
            else if (member.JsonType == JsonType.Object) {
                return new DynamicJsonObject(member as JsonObject);
            }
            else if (member.JsonType == JsonType.Boolean)
                return (bool)member;
            else if (member.JsonType == JsonType.Number) {
                string s = member.ToString();
                int i;
                if (int.TryParse(s, out i))
                    return i;
                else return double.Parse(s);
            }
            else
                return (string)member;

            return result;
        }
开发者ID:curtisrutland,项目名称:RottenTomatoes.NET,代码行数:30,代码来源:DynamicJsonObject.cs


注:本文中的System.Json.JsonValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。