• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# JSONReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Deserialize

        public static void Deserialize(string _Input, out BindRequest Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

                case "BindRequest" : {
                    Out = null;
                    throw new Exception ("Can't create abstract type");
                    }

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

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

            // should we check for EOF here?
        }
开发者ID:hallambaker,项目名称:Omnibroker,代码行数:31,代码来源:Connection.cs


示例2: Deserialize

		/// <summary>
        /// Construct an instance from the specified tagged JSONReader stream.
        /// </summary>
        /// <param name="JSONReader">Input stream</param>
        /// <param name="Out">The created object</param>
        public static void Deserialize(JSONReader JSONReader, out JSONObject Out) {
	
			JSONReader.StartObject ();
            if (JSONReader.EOR) {
                Out = null;
                return;
                }

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

			switch (token) {

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


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

				default : {
					throw new Exception ("Not supported");
					}
				}	
			JSONReader.EndObject ();
            }
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:39,代码来源:SchemaMail.cs


示例3: Deserialize

        public static void Deserialize(string _Input, out AdvertiseRequest Out)
        {
            StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);

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

            switch (token) {

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

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

            // should we check for EOF here?
        }
开发者ID:hallambaker,项目名称:Omnibroker,代码行数:26,代码来源:Query.cs


示例4: Deserialize

		/// <summary>
        /// Construct an instance from the specified tagged JSONReader stream.
        /// </summary>
        public static void Deserialize(JSONReader JSONReader, out JSONObject Out) {
	
			JSONReader.StartObject ();
            if (JSONReader.EOR) {
                Out = null;
                return;
                }

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

			switch (token) {

				case "PortalEntry" : {
					Out = null;
					throw new Exception ("Can't create abstract type");
					}


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


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


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

				default : {
					throw new Exception ("Not supported");
					}
				}	
			JSONReader.EndObject ();
            }
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:51,代码来源:PortalProtocol.cs


示例5: FromTagged

        /// <summary>
        /// Create a new instance from tagged string input.
		/// i.e. { "HostEntry" : {... data ... } }
        /// </summary>
        /// <param name="_Input">The input data.</param>
        /// <returns>The created object.</returns>		
		public static new HostEntry FromTagged (string _Input) {
			//HostEntry _Result;
			//Deserialize (_Input, out _Result);
			StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);
			return FromTagged (JSONReader) ;
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:13,代码来源:SchemaSSH.cs


示例6: HostEntry

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
        /// <param name="JSONReader">Input stream</param>	
		public HostEntry (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:7,代码来源:SchemaSSH.cs


示例7: DeviceEntry

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
        /// <param name="JSONReader">Input stream</param>	
		public DeviceEntry (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:7,代码来源:SchemaSSH.cs


示例8: DeserializeToken

        /// <summary>
        /// Having read a tag, process the corresponding value data.
        /// </summary>
        /// <param name="JSONReader">The input stream</param>
        /// <param name="Tag">The tag</param>
		public override void DeserializeToken (JSONReader JSONReader, string Tag) {
			
			switch (Tag) {
				case "Account" : {
					Account = JSONReader.ReadString ();
					break;
					}
				case "DeviceEntries" : {
					// Have a sequence of values
					bool _Going = JSONReader.StartArray ();
					DeviceEntries = new List <DeviceEntry> ();
					while (_Going) {
						// an untagged structure.
						var _Item = new DeviceEntry (JSONReader);
						DeviceEntries.Add (_Item);
						_Going = JSONReader.NextArray ();
						}
					break;
					}
				case "HostEntries" : {
					// Have a sequence of values
					bool _Going = JSONReader.StartArray ();
					HostEntries = new List <HostEntry> ();
					while (_Going) {
						// an untagged structure.
						var _Item = new HostEntry (JSONReader);
						HostEntries.Add (_Item);
						_Going = JSONReader.NextArray ();
						}
					break;
					}
				default : {
					base.DeserializeToken(JSONReader, Tag);
					break;
					}
				}
			// check up that all the required elements are present
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:43,代码来源:SchemaSSH.cs


示例9: From

        /// <summary>
		/// Create a new instance from untagged string input.
		/// i.e. {... data ... }
        /// </summary>	
        /// <param name="_Input">The input data.</param>
        /// <returns>The created object.</returns>				
		public static new SSHProfilePrivate From (string _Input) {
			StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);
			return new SSHProfilePrivate (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:11,代码来源:SchemaSSH.cs


示例10: LeaveResponse

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
		public LeaveResponse (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:6,代码来源:RecryptProtocol.cs


示例11: FromTagged

        /// <summary>
        /// Create a new instance from tagged string input.
		/// i.e. { "LeaveRequest" : {... data ... } }
        /// </summary>
        /// <param name="_Input">The input data.</param>
        /// <returns>The created object.</returns>		
		public static new LeaveRequest FromTagged (string _Input) {
			//LeaveRequest _Result;
			//Deserialize (_Input, out _Result);
			StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);
			return FromTagged (JSONReader) ;
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:13,代码来源:RecryptProtocol.cs


示例12: From

        /// <summary>
		/// Create a new instance from untagged string input.
		/// i.e. {... data ... }
        /// </summary>	
        /// <param name="_Input">The input data.</param>
        /// <returns>The created object.</returns>				
		public static new LeaveRequest From (string _Input) {
			StringReader _Reader = new StringReader (_Input);
            JSONReader JSONReader = new JSONReader (_Reader);
			return new LeaveRequest (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:11,代码来源:RecryptProtocol.cs


示例13: LeaveRequest

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
		public LeaveRequest (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:6,代码来源:RecryptProtocol.cs


示例14: JoinResponse

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
		public JoinResponse (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:6,代码来源:RecryptProtocol.cs


示例15: FromFile

        /// <summary>
        /// Search for the specified profile on the local machine.
        /// </summary>
        /// <param name="UDF">Fingerprint of the profile to find.</param>
        /// <param name="FileName">The name of the file</param>
        /// <returns>The signed profile if found or null otherwise.</returns>
        public static SignedApplicationProfile FromFile(string UDF, string FileName) {

            using (var FileReader = FileName.OpenFileReadShared()) {
                using (var TextReader = FileReader.OpenTextReader()) {
                    var Reader = new JSONReader(TextReader);
                    var Result = SignedApplicationProfile.FromTagged(Reader);

                    return Result;
                    }
                }
            }
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:17,代码来源:SignProfile.cs


示例16: RecryptRequest

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
		public RecryptRequest (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:6,代码来源:RecryptProtocol.cs


示例17: SSHProfilePrivate

        /// <summary>
		/// Initialize class from JSONReader stream.
        /// </summary>		
        /// <param name="JSONReader">Input stream</param>	
		public SSHProfilePrivate (JSONReader JSONReader) {
			Deserialize (JSONReader);
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:7,代码来源:SchemaSSH.cs


示例18: RecryptProtocol

        /// <summary>
        /// Construct an instance from a JSON encoded stream.
        /// </summary>
		public RecryptProtocol (JSONReader JSONReader) {
			Deserialize (JSONReader);
			_Initialize () ;
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:7,代码来源:RecryptProtocol.cs


示例19: Deserialize

		/// <summary>
        /// Construct an instance from the specified tagged JSONReader stream.
        /// </summary>
        public static void Deserialize(JSONReader JSONReader, out JSONObject Out) {
	
			JSONReader.StartObject ();
            if (JSONReader.EOR) {
                Out = null;
                return;
                }

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

			switch (token) {

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


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


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


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


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


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


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


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


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


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


				case "KeySet" : {
					var Result = new KeySet ();
					Result.Deserialize (JSONReader);
					Out = Result;
//.........这里部分代码省略.........
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:101,代码来源:RecryptProtocol.cs


示例20: MeshSSH

        /// <summary>
        /// Construct an instance from a JSON encoded stream.
        /// </summary>
        /// <param name="JSONReader">Input stream</param>
		public MeshSSH (JSONReader JSONReader) {
			Deserialize (JSONReader);
			_Initialize () ;
			}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:8,代码来源:SchemaSSH.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# JSObject类代码示例发布时间:2022-05-24
下一篇:
C# JSONObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap