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


C# JObject.GetValue方法代码示例

本文整理汇总了C#中Newtonsoft.Json.Linq.JObject.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# JObject.GetValue方法的具体用法?C# JObject.GetValue怎么用?C# JObject.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Newtonsoft.Json.Linq.JObject的用法示例。


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

示例1: parseJObject

 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     ObjectType = extractString(obj.GetValue("ObjectType", StringComparison.InvariantCultureIgnoreCase));
     foreach (IfcRelDefinesByProperties rdp in mDatabase.extractJArray<IfcRelDefinesByProperties>(obj.GetValue("IsDefinedBy", StringComparison.InvariantCultureIgnoreCase) as JArray))
         rdp.Assign(this);
 }
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:7,代码来源:IFC+O+JSON.cs

示例2: RatePlace

        public Result<bool> RatePlace(JObject jsonData)
        {
            int placeId = jsonData.GetValue("placeId").ToObject<int>();
            Rate[] rates = jsonData.GetValue("rates").ToObject<Rate[]>();

            return this.GetResult(_rateService.RatePlace(this.GetAuthenticatedAccountId(), placeId, rates));
        }
开发者ID:brunasampaio,项目名称:Accessibilitta,代码行数:7,代码来源:RateController.cs

示例3: restore

 public override void restore(JObject state)
 {
     base.restore(state);
     income = (bool)state.GetValue(INCOME);
     eventTimeGenerator = (AbstractProcess)AbstractStorable.newInstance((JObject)state.GetValue(PROCESS));
     amountGenerator = (AbstractValue)AbstractStorable.newInstance((JObject)state.GetValue(AMOUNT));
 }
开发者ID:Nizhegorodtsev,项目名称:Diplom.NET,代码行数:7,代码来源:FinanceStream.cs

示例4: RemoteState

        public object RemoteState(JObject state)
        {
            var action = state.GetValue("action").Value<string>();
            var storeId = state.GetValue("storeId").Value<string>();
            var stateName = state.GetValue("stateName").Value<string>();
            var data = state.GetValue("data").Value<JObject>();
            switch (action)
            {
                case "getAll":
                    return DtStates.ContainsKey(storeId) 
                        ? new
                            {
                                defaultState = DtStates[storeId].Item1,
                                states = DtStates[storeId].Item2
                            } 
                        : new object();
                case "setDefault":
                    if (DtStates.ContainsKey(storeId))
                        DtStates[storeId] = new Tuple<string, Dictionary<string, object>>(stateName, DtStates[storeId].Item2);
                    break;
                case "delete":
                    if (DtStates.ContainsKey(storeId) && DtStates[storeId].Item2.ContainsKey(stateName))
                        DtStates[storeId].Item2.Remove(stateName);
                    break;
                case "save":
                    if (!DtStates.ContainsKey(storeId))
                        DtStates[storeId] = new Tuple<string, Dictionary<string, object>>(null, new Dictionary<string, object>());
                    DtStates[storeId].Item2[stateName] = data;
                    break;
            }
            File.WriteAllText(GetStateFilePath(), JsonConvert.SerializeObject(DtStates));

            return null;
        }
开发者ID:Iarly,项目名称:datatables.plugins,代码行数:34,代码来源:NorthBreezeController.cs

示例5: parseJObject

 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     JObject jobj = obj.GetValue("Points", StringComparison.InvariantCultureIgnoreCase) as JObject;
     if (jobj != null)
         Points = mDatabase.parseJObject<IfcCartesianPointList>(jobj);
     JArray array = obj.GetValue("Segments", StringComparison.InvariantCultureIgnoreCase) as JArray;
     if (array != null)
     {
         foreach (JToken tok in array)
         {
             JObject ob = tok as JObject;
             if (ob != null)
             {
                 JToken jtoken = ob.GetValue("IfcLineIndex", StringComparison.InvariantCultureIgnoreCase);
                 if (jtoken != null)
                     mSegments.Add(new IfcLineIndex(jtoken.Value<string>().Split(" ".ToCharArray()).ToList().ConvertAll(x => int.Parse(x))));
                 else
                 {
                     jtoken = ob.GetValue("IfcArcIndex", StringComparison.InvariantCultureIgnoreCase);
                     if (jtoken != null)
                     {
                         List<int> tokens = jtoken.Value<string>().Split(" ".ToCharArray()).ToList().ConvertAll(x => int.Parse(x));
                         mSegments.Add(new IfcArcIndex(tokens[0], tokens[1], tokens[2]));
                     }
                 }
             }
         }
     }
     JToken token = obj.GetValue("SelfIntersect", StringComparison.InvariantCultureIgnoreCase);
     if (token != null)
         Enum.TryParse<IfcLogicalEnum>(token.Value<string>(), true, out mSelfIntersect);
 }
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:33,代码来源:IFC+I+JSON.cs

示例6: Post

        public async Task<bool> Post(JObject data)
        {
            try
            {
                //TODO: Trzeba rozpoznawać użytkowników i wysyłać do właściwych urzadzeń
                var currentUser = this.User as ServiceUser;
                ////
                NotificationHubClient hub = NotificationHubClient
                    .CreateClientFromConnectionString("Endpoint=sb://karolzakpip.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=J2Rrw4Xt67NADIOprmmEiyPX89LCOrcP+8WkCBMsuXw=", "karolzakpip");
                string wnsToast = string.Format("<?xml version=\"1.0\" encoding=\"utf-8\"?><toast><visual><binding template=\"ToastText01\"><text id=\"1\">{0}</text></binding></visual></toast>", data.GetValue("message").Value<string>());

                WindowsPushMessage message = new WindowsPushMessage();
                message.XmlPayload = wnsToast;
                //var result = await Services.Push.SendAsync(message, currentUser.Id);
                await hub.SendWindowsNativeNotificationAsync(wnsToast,currentUser.Id);

                ////
                string text = data.GetValue("message").Value<string>();              
                string toast = PrepareToastPayload(text, text);
                await hub.SendMpnsNativeNotificationAsync(toast, currentUser.Id);

                


                return true;
            }
            catch
            {
                return false;
            }
        }
开发者ID:karolzak,项目名称:XAML-Blend-Tutorial,代码行数:31,代码来源:SendPushController.cs

示例7: parseJObject

 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     JObject jobj = obj.GetValue("OuterBoundary", StringComparison.InvariantCultureIgnoreCase) as JObject;
     if (jobj != null)
         OuterBoundary = mDatabase.parseJObject<IfcCurve>(jobj);
     InnerBoundaries = mDatabase.extractJArray<IfcCurve>(obj.GetValue("InnerBoundaries", StringComparison.InvariantCultureIgnoreCase) as JArray);
 }
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:8,代码来源:IFC+A+JSON.cs

示例8: parseJObject

 internal static IfcTranslationalStiffnessSelect parseJObject(JObject obj)
 {
     JObject jobj = obj.GetValue("IfcBoolean", StringComparison.InvariantCultureIgnoreCase) as JObject;
     if (jobj != null)
         return new IfcTranslationalStiffnessSelect( jobj.Value<bool>());
     jobj = obj.GetValue("IfcLinearStiffnessMeasure", StringComparison.InvariantCultureIgnoreCase) as JObject;
     return (jobj != null ? new IfcTranslationalStiffnessSelect(jobj.Value<double>()) : null);
 }
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:8,代码来源:IFC+T+JSON.cs

示例9: parseJObject

		internal override void parseJObject(JObject obj)
		{
			base.parseJObject(obj);
			JToken token = obj.GetValue("MethodOfMeasurement", StringComparison.InvariantCultureIgnoreCase);
			if (token != null)
				MethodOfMeasurement = token.Value<string>();
			Quantities = mDatabase.extractJArray<IfcPhysicalQuantity>(obj.GetValue("Quantities", StringComparison.InvariantCultureIgnoreCase) as JArray);
		}
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:8,代码来源:IFC+E+JSON.cs

示例10: GetInstance

 public static NewVersionEvent GetInstance(JObject data)
 {
     return new NewVersionEvent()
     {
         GameId = data.GetValue("game_id").Value<string>(),
         ReleaseId = data.GetValue("release_id").Value<string>(),
         Version = data.GetValue("version").Value<string>()
     };
 }
开发者ID:freezy,项目名称:vpdb-agent,代码行数:9,代码来源:RealtimeManager.cs

示例11: RPCResponse

		public RPCResponse(JObject json)
		{
			var error = json.GetValue("error") as JObject;
			if(error != null)
			{
				Error = new RPCError(error);
			}
			Result = json.GetValue("result") as JToken;
		}
开发者ID:nikropht,项目名称:NBitcoin,代码行数:9,代码来源:RPCResponse.cs

示例12: parseJObject

 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     JToken token = obj.GetValue("CountValue", StringComparison.InvariantCultureIgnoreCase);
     if (token != null)
         CountValue = token.Value<double>();
     token = obj.GetValue("Formula", StringComparison.InvariantCultureIgnoreCase);
     if (token != null)
         Formula = token.Value<string>();
 }
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:10,代码来源:IFC+Q+JSON.cs

示例13: parseJObject

 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     JObject jobj = obj.GetValue("MappingSource", StringComparison.InvariantCultureIgnoreCase) as JObject;
     if (jobj != null)
         MappingSource = mDatabase.parseJObject<IfcRepresentationMap>(jobj);
     jobj = obj.GetValue("MappingTarget", StringComparison.InvariantCultureIgnoreCase) as JObject;
     if (jobj != null)
         MappingTarget = mDatabase.parseJObject<IfcCartesianTransformationOperator3D>(jobj);
 }
开发者ID:jmirtsch,项目名称:GeometryGymIFC,代码行数:10,代码来源:IFC+M+JSON.cs

示例14: Post

 public async Task Post(JObject data)
 {
     await PushNotificationsService.NotifyVehicleRequestedAsync
         (
         data.GetValue("employeeId").Value<string>(),
         data.GetValue("driverId").Value<int>(),
         data.GetValue("latitude").Value<double>(),
         data.GetValue("longitude").Value<double>()
     );
 }
开发者ID:EmiiFont,项目名称:MyShuttle_RC,代码行数:10,代码来源:NotifyNewRequest.cs

示例15: Post

        public async Task Post(JObject data)
        {
            var message = new TemplatePushMessage()
            {
                { "patientId",  data.GetValue("patientId").Value<string>() },
                { "doctorId",  data.GetValue("doctorId").Value<string>() },
                { "message", data.GetValue("message").Value<string>() }
            };

            await GetPushClient().SendTemplateNotificationAsync(message);
        }
开发者ID:geekpivot,项目名称:HealthClinic.biz,代码行数:11,代码来源:NotifyDelayController.cs


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