當前位置: 首頁>>代碼示例>>C#>>正文


C# Models.ODataObject類代碼示例

本文整理匯總了C#中ShareFile.Api.Models.ODataObject的典型用法代碼示例。如果您正苦於以下問題:C# ODataObject類的具體用法?C# ODataObject怎麽用?C# ODataObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ODataObject類屬於ShareFile.Api.Models命名空間,在下文中一共展示了ODataObject類的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 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));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:PowerTools.cs

示例2: 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?));
                }
            }
        }
開發者ID:BobDankert,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:Metadata.cs

示例3: Copy

		public override void Copy(ODataObject source, JsonSerializer serializer)
		{
			if(source == null || serializer == null) return;
			base.Copy(source, serializer);

			var typedSource = source as Group;
			if(typedSource != null)
			{
				Owner = typedSource.Owner;
				Account = typedSource.Account;
				IsShared = typedSource.IsShared;
				Contacts = typedSource.Contacts;
			}
			else
			{
				JToken token;
				if(source.TryGetProperty("Owner", out token) && token.Type != JTokenType.Null)
				{
					Owner = (User)serializer.Deserialize(token.CreateReader(), typeof(User));
				}
				if(source.TryGetProperty("Account", out token) && token.Type != JTokenType.Null)
				{
					Account = (Account)serializer.Deserialize(token.CreateReader(), typeof(Account));
				}
				if(source.TryGetProperty("IsShared", out token) && token.Type != JTokenType.Null)
				{
					IsShared = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("Contacts", out token) && token.Type != JTokenType.Null)
				{
					Contacts = (IEnumerable<Contact>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<Contact>));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:34,代碼來源:Group.cs

示例4: 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));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:DeviceUserWipe.cs

示例5: 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));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:34,代碼來源:Principal.cs

示例6: 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));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:AccessControlFailedEntry.cs

示例7: Copy

        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if(source == null || serializer == null) return;
            base.Copy(source, serializer);

            var typedSource = source as MarketAnalytics;
            if(typedSource != null)
            {
                ConversionIndex = typedSource.ConversionIndex;
                ConversionIndex2 = typedSource.ConversionIndex2;
                LtvIndex = typedSource.LtvIndex;
                PlanValue = typedSource.PlanValue;
            }
            else
            {
                JToken token;
                if(source.TryGetProperty("ConversionIndex", out token) && token.Type != JTokenType.Null)
                {
                    ConversionIndex = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
                if(source.TryGetProperty("ConversionIndex2", out token) && token.Type != JTokenType.Null)
                {
                    ConversionIndex2 = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
                if(source.TryGetProperty("LtvIndex", out token) && token.Type != JTokenType.Null)
                {
                    LtvIndex = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
                if(source.TryGetProperty("PlanValue", out token) && token.Type != JTokenType.Null)
                {
                    PlanValue = (decimal?)serializer.Deserialize(token.CreateReader(), typeof(decimal?));
                }
            }
        }
開發者ID:BobDankert,項目名稱:ShareFile-NET,代碼行數:34,代碼來源:MarketAnalytics.cs

示例8: 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?));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:DiskSpace.cs

示例9: 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));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:SSOInfo.cs

示例10: 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?));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:UserUsage.cs

示例11: Copy

        public override void Copy(ODataObject source, JsonSerializer serializer)
        {
            if(source == null || serializer == null) return;
            base.Copy(source, serializer);

            var typedSource = source as FindSubdomainParams;
            if(typedSource != null)
            {
                UsernameShort = typedSource.UsernameShort;
                Password = typedSource.Password;
                EmployeeOnly = typedSource.EmployeeOnly;
            }
            else
            {
                JToken token;
                if(source.TryGetProperty("UsernameShort", out token) && token.Type != JTokenType.Null)
                {
                    UsernameShort = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if(source.TryGetProperty("Password", out token) && token.Type != JTokenType.Null)
                {
                    Password = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
                }
                if(source.TryGetProperty("EmployeeOnly", out token) && token.Type != JTokenType.Null)
                {
                    EmployeeOnly = (bool)serializer.Deserialize(token.CreateReader(), typeof(bool));
                }
            }
        }
開發者ID:BobDankert,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:FindSubdomainParams.cs

示例12: Copy

		public override void Copy(ODataObject source, JsonSerializer serializer)
		{
			if(source == null || serializer == null) return;
			base.Copy(source, serializer);

			var typedSource = source as FolderTemplateItem;
			if(typedSource != null)
			{
				Name = typedSource.Name;
				Description = typedSource.Description;
				Items = typedSource.Items;
			}
			else
			{
				JToken token;
				if(source.TryGetProperty("Name", out token) && token.Type != JTokenType.Null)
				{
					Name = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("Description", out token) && token.Type != JTokenType.Null)
				{
					Description = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("Items", out token) && token.Type != JTokenType.Null)
				{
					Items = (IEnumerable<FolderTemplateItem>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<FolderTemplateItem>));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:29,代碼來源:FolderTemplateItem.cs

示例13: 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?));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:34,代碼來源:AccountZoneUsage.cs

示例14: Copy

		public override void Copy(ODataObject source, JsonSerializer serializer)
		{
			if(source == null || serializer == null) return;
			base.Copy(source, serializer);

			var typedSource = source as ShareItemHistory;
			if(typedSource != null)
			{
				Title = typedSource.Title;
				Recipient = typedSource.Recipient;
				ActivityType = typedSource.ActivityType;
				DownloadDate = typedSource.DownloadDate;
			}
			else
			{
				JToken token;
				if(source.TryGetProperty("Title", out token) && token.Type != JTokenType.Null)
				{
					Title = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("Recipient", out token) && token.Type != JTokenType.Null)
				{
					Recipient = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("ActivityType", out token) && token.Type != JTokenType.Null)
				{
					ActivityType = (SafeEnum<ItemAction>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<ItemAction>));
				}
				if(source.TryGetProperty("DownloadDate", out token) && token.Type != JTokenType.Null)
				{
					DownloadDate = (DateTime?)serializer.Deserialize(token.CreateReader(), typeof(DateTime?));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:34,代碼來源:ShareItemHistory.cs

示例15: 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?));
				}
			}
		}
開發者ID:wholroyd,項目名稱:ShareFile-NET,代碼行數:34,代碼來源:AccessControlParam.cs


注:本文中的ShareFile.Api.Models.ODataObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。