本文整理匯總了C#中ShareFile.Api.Models.ODataObject.TryGetProperty方法的典型用法代碼示例。如果您正苦於以下問題:C# ODataObject.TryGetProperty方法的具體用法?C# ODataObject.TryGetProperty怎麽用?C# ODataObject.TryGetProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShareFile.Api.Models.ODataObject
的用法示例。
在下文中一共展示了ODataObject.TryGetProperty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as Metadata;
if(typedSource != null)
{
Name = typedSource.Name;
Value = typedSource.Value;
IsPublic = typedSource.IsPublic;
}
else
{
JToken token;
if(source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
{
Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("Value", out token) && token.Type != JTokenType.Null)
{
Value = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("IsPublic", out token) && token.Type != JTokenType.Null)
{
IsPublic = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
}
}
}
示例2: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as QueryPaging;
if(typedSource != null)
{
PageNumber = typedSource.PageNumber;
PageSize = typedSource.PageSize;
Count = typedSource.Count;
Skip = typedSource.Skip;
}
else
{
JToken token;
if(source.TryGetProperty("PageNumber", out token) && token.Type != JTokenType.Null)
{
PageNumber = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
}
if(source.TryGetProperty("PageSize", out token) && token.Type != JTokenType.Null)
{
PageSize = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
}
if(source.TryGetProperty("Count", out token) && token.Type != JTokenType.Null)
{
Count = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
}
if(source.TryGetProperty("Skip", out token) && token.Type != JTokenType.Null)
{
Skip = (int)serializer.Deserialize(token.CreateReader(), typeof(int));
}
}
}
示例3: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as AccessControlFailedEntry;
if(typedSource != null)
{
AccessControl = typedSource.AccessControl;
Code = typedSource.Code;
Message = typedSource.Message;
}
else
{
JToken token;
if(source.TryGetProperty("AccessControl", out token) && token.Type != JTokenType.Null)
{
AccessControl = (AccessControl)serializer.Deserialize(token.CreateReader(), typeof(AccessControl));
}
if(source.TryGetProperty("Code", out token) && token.Type != JTokenType.Null)
{
Code = (SafeEnum<HttpStatusCode>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<HttpStatusCode>));
}
if(source.TryGetProperty("Message", out token) && token.Type != JTokenType.Null)
{
Message = (ODataExceptionMessage)serializer.Deserialize(token.CreateReader(), typeof(ODataExceptionMessage));
}
}
}
示例4: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as AdvancedSearchResults;
if(typedSource != null)
{
PartialResults = typedSource.PartialResults;
Results = typedSource.Results;
TimedOut = typedSource.TimedOut;
}
else
{
JToken token;
if(source.TryGetProperty("PartialResults", out token) && token.Type != JTokenType.Null)
{
PartialResults = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
}
if(source.TryGetProperty("Results", out token) && token.Type != JTokenType.Null)
{
Results = (IEnumerable<SearchResult>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<SearchResult>));
}
if(source.TryGetProperty("TimedOut", out token) && token.Type != JTokenType.Null)
{
TimedOut = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
}
}
}
示例5: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as ConnectorGroupAccessControl;
if(typedSource != null)
{
Principal = typedSource.Principal;
CanManage = typedSource.CanManage;
CanCreate = typedSource.CanCreate;
}
else
{
JToken token;
if(source.TryGetProperty("Principal", out token) && token.Type != JTokenType.Null)
{
Principal = (Principal)serializer.Deserialize(token.CreateReader(), typeof(Principal));
}
if(source.TryGetProperty("CanManage", out token) && token.Type != JTokenType.Null)
{
CanManage = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
}
if(source.TryGetProperty("CanCreate", out token) && token.Type != JTokenType.Null)
{
CanCreate = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
}
}
}
示例6: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as AccessControlParam;
if(typedSource != null)
{
AccessControl = typedSource.AccessControl;
NotifyUser = typedSource.NotifyUser;
NotifyMessage = typedSource.NotifyMessage;
Recursive = typedSource.Recursive;
}
else
{
JToken token;
if(source.TryGetProperty("AccessControl", out token) && token.Type != JTokenType.Null)
{
AccessControl = (AccessControl)serializer.Deserialize(token.CreateReader(), typeof(AccessControl));
}
if(source.TryGetProperty("NotifyUser", out token) && token.Type != JTokenType.Null)
{
NotifyUser = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
}
if(source.TryGetProperty("NotifyMessage", out token) && token.Type != JTokenType.Null)
{
NotifyMessage = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("Recursive", out token) && token.Type != JTokenType.Null)
{
Recursive = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
}
}
}
示例7: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as AccountZoneUsage;
if(typedSource != null)
{
TotalFileSizeBytes = typedSource.TotalFileSizeBytes;
Zone = typedSource.Zone;
RootFolderCount = typedSource.RootFolderCount;
FileCount = typedSource.FileCount;
}
else
{
JToken token;
if(source.TryGetProperty("TotalFileSizeBytes", out token) && token.Type != JTokenType.Null)
{
TotalFileSizeBytes = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?));
}
if(source.TryGetProperty("Zone", out token) && token.Type != JTokenType.Null)
{
Zone = (Zone)serializer.Deserialize(token.CreateReader(), typeof(Zone));
}
if(source.TryGetProperty("RootFolderCount", out token) && token.Type != JTokenType.Null)
{
RootFolderCount = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?));
}
if(source.TryGetProperty("FileCount", out token) && token.Type != JTokenType.Null)
{
FileCount = (long?)serializer.Deserialize(token.CreateReader(), typeof(long?));
}
}
}
示例8: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as PowerTools;
if(typedSource != null)
{
EnableDesktopToolsPage = typedSource.EnableDesktopToolsPage;
EnableMobileApps = typedSource.EnableMobileApps;
ShowMobileTools = typedSource.ShowMobileTools;
}
else
{
JToken token;
if(source.TryGetProperty("EnableDesktopToolsPage", out token) && token.Type != JTokenType.Null)
{
EnableDesktopToolsPage = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
}
if(source.TryGetProperty("EnableMobileApps", out token) && token.Type != JTokenType.Null)
{
EnableMobileApps = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
}
if(source.TryGetProperty("ShowMobileTools", out token) && token.Type != JTokenType.Null)
{
ShowMobileTools = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
}
}
}
示例9: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as AccessControlsBulkParams;
if(typedSource != null)
{
NotifyUser = typedSource.NotifyUser;
NotifyMessage = typedSource.NotifyMessage;
AccessControlParams = typedSource.AccessControlParams;
}
else
{
JToken token;
if(source.TryGetProperty("NotifyUser", out token) && token.Type != JTokenType.Null)
{
NotifyUser = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
}
if(source.TryGetProperty("NotifyMessage", out token) && token.Type != JTokenType.Null)
{
NotifyMessage = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("AccessControlParams", out token) && token.Type != JTokenType.Null)
{
AccessControlParams = (IEnumerable<AccessControlParam>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<AccessControlParam>));
}
}
}
示例10: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as DeviceUserWipe;
if(typedSource != null)
{
WipeToken = typedSource.WipeToken;
Success = typedSource.Success;
ErrorMessage = typedSource.ErrorMessage;
}
else
{
JToken token;
if(source.TryGetProperty("WipeToken", out token) && token.Type != JTokenType.Null)
{
WipeToken = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("Success", out token) && token.Type != JTokenType.Null)
{
Success = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("ErrorMessage", out token) && token.Type != JTokenType.Null)
{
ErrorMessage = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
}
}
示例11: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as DownloadSpecification;
if(typedSource != null)
{
DownloadToken = typedSource.DownloadToken;
PrepareXmlInfo = typedSource.PrepareXmlInfo;
DownloadUrl = typedSource.DownloadUrl;
DownloadPrepStartURL = typedSource.DownloadPrepStartURL;
}
else
{
JToken token;
if(source.TryGetProperty("DownloadToken", out token) && token.Type != JTokenType.Null)
{
DownloadToken = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("PrepareXmlInfo", out token) && token.Type != JTokenType.Null)
{
PrepareXmlInfo = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("DownloadUrl", out token) && token.Type != JTokenType.Null)
{
DownloadUrl = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
}
if(source.TryGetProperty("DownloadPrepStartURL", out token) && token.Type != JTokenType.Null)
{
DownloadPrepStartURL = (Uri)serializer.Deserialize(token.CreateReader(), typeof(Uri));
}
}
}
示例12: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as Principal;
if(typedSource != null)
{
Name = typedSource.Name;
Email = typedSource.Email;
Username = typedSource.Username;
Domain = typedSource.Domain;
}
else
{
JToken token;
if(source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
{
Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("Email", out token) && token.Type != JTokenType.Null)
{
Email = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("Username", out token) && token.Type != JTokenType.Null)
{
Username = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("Domain", out token) && token.Type != JTokenType.Null)
{
Domain = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
}
}
示例13: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as SSOInfo;
if(typedSource != null)
{
Info = typedSource.Info;
AppControlPlane = typedSource.AppControlPlane;
ApiControlPlane = typedSource.ApiControlPlane;
}
else
{
JToken token;
if(source.TryGetProperty("Info", out token) && token.Type != JTokenType.Null)
{
Info = (IEnumerable<SSOInfoEntry>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<SSOInfoEntry>));
}
if(source.TryGetProperty("AppControlPlane", out token) && token.Type != JTokenType.Null)
{
AppControlPlane = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
if(source.TryGetProperty("ApiControlPlane", out token) && token.Type != JTokenType.Null)
{
ApiControlPlane = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
}
}
}
示例14: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as DiskSpace;
if(typedSource != null)
{
Max = typedSource.Max;
Used = typedSource.Used;
Free = typedSource.Free;
}
else
{
JToken token;
if(source.TryGetProperty("Max", out token) && token.Type != JTokenType.Null)
{
Max = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
}
if(source.TryGetProperty("Used", out token) && token.Type != JTokenType.Null)
{
Used = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
}
if(source.TryGetProperty("Free", out token) && token.Type != JTokenType.Null)
{
Free = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
}
}
}
示例15: Copy
public override void Copy(ODataObject source, JsonSerializer serializer)
{
if(source == null || serializer == null) return;
base.Copy(source, serializer);
var typedSource = source as UserUsage;
if(typedSource != null)
{
EmployeeMax = typedSource.EmployeeMax;
EmployeeCount = typedSource.EmployeeCount;
ClientCount = typedSource.ClientCount;
}
else
{
JToken token;
if(source.TryGetProperty("EmployeeMax", out token) && token.Type != JTokenType.Null)
{
EmployeeMax = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
}
if(source.TryGetProperty("EmployeeCount", out token) && token.Type != JTokenType.Null)
{
EmployeeCount = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
}
if(source.TryGetProperty("ClientCount", out token) && token.Type != JTokenType.Null)
{
ClientCount = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
}
}
}