本文整理汇总了C#中Serializer.FromString方法的典型用法代码示例。如果您正苦于以下问题:C# Serializer.FromString方法的具体用法?C# Serializer.FromString怎么用?C# Serializer.FromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Serializer
的用法示例。
在下文中一共展示了Serializer.FromString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPlaces
public PlacesResponse GetPlaces(string what, string where)
{
var url = string.Format("{0}Places?what={1}&where={2}&pagesize=20", _configuration.BasePath,
what, where);
var response = _downloader.GetString(new Uri(url));
var serializer = new Serializer<PlacesResponse>();
return serializer.FromString(response);
}
示例2: loadCase
void loadCase(bool status, string data, string error_msg, WWW download)
{
// if status ok then set case valid
if ( status == true )
{
// convert from string data to serialized
Serializer<CaseOptionData> serializer = new Serializer<CaseOptionData>();
this.Data = serializer.FromString(data);
if ( this.Data != null )
{
UnityEngine.Debug.Log ("CaseConfigurator.loadCase() : casename=<" + this.data.casename + ">, loadTime=" + (Time.time-loadTime).ToString ());
PrepareCaseForStart();
}
else
{
// error msg
error_msg = "DBError: de-serialize error!";
// dialog
// do callback with error
if ( loadCaseCallback != null )
loadCaseCallback(false,data,error_msg,download);
return;
}
}
// callback
if ( loadCaseCallback != null )
loadCaseCallback(status,data,error_msg,download);
}
示例3: SetOptionData
public void SetOptionData( string data )
{
if ( data != null )
{
Serializer<CaseOptionData> serializer = new Serializer<CaseOptionData>();
CaseOptionData = serializer.FromString(data);
}
}
示例4: CasesCallback
public void CasesCallback(bool status, string data, string error_msg, WWW download)
{
if ( status == true )
{
Serializer<List<string>> serializer = new Serializer<List<string>>();
Cases = serializer.FromString(data);
}
}
示例5: loadCase
void loadCase(bool status, string data, string error_msg, WWW download)
{
// convert from string data to serialized
Serializer<CaseOptionData> serializer = new Serializer<CaseOptionData>();
this.data = serializer.FromString(data);
}