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

C# Contracts类代码示例

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

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



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

示例1: IsEqual

        /// <summary>
        /// Determines whether the specified <see cref="T:Tridion.ContentDelivery.Taxonomies.Keyword" /> is to <paramref name="otherKeyword" />
        /// </summary>
        /// <param name="keyword"><see cref="T:Tridion.ContentDelivery.Taxonomies.Keyword" /></param>
        /// <param name="otherKeyword"><see cref="T:Tridion.ContentDelivery.Taxonomies.Keyword" /></param>
        /// <returns><c>true</c> if the <see cref="T:TcmCDService.ContentDelivery.TcmUri" /> is equal, otherwise <c>false</c>.</returns>
        internal static Boolean IsEqual(this Keyword keyword, Contracts.Keyword otherKeyword)
        {
            if (keyword != null && otherKeyword != null)
                return (TcmUri)keyword.KeywordUri == (TcmUri)otherKeyword.Uri;

            return false;
        }
开发者ID:TcmExtensions,项目名称:TcmCDService,代码行数:13,代码来源:ContractExtensions.cs


示例2: CompareContractWithSavedEntity

        public static void CompareContractWithSavedEntity(Contracts.Curve contract)
        {
            int id = int.Parse(contract.Identifiers.Where(x => x.IsNexusId).First().Identifier);
            var savedEntity = new DbSetRepository<MDM.Curve>(new MappingContext()).FindOne<MDM.Curve>(id);

            CompareContractWithEntityDetails(contract, savedEntity);
        }
开发者ID:RaoulHolzer,项目名称:EnergyTrading-MDM-Sample,代码行数:7,代码来源:CurveDataChecker.cs


示例3: Initialize

 public void Initialize(Contracts.Projections.RecipeView view)
 {
     RecipeId = view.Id.Id;
     Title = view.Title;
     Instructions = view.Instructions;
     RecipeStatus = view.RecipeStatus;
 }
开发者ID:gnschenker,项目名称:RecipesWithCqrsAndEs,代码行数:7,代码来源:RecipeViewModelState.cs


示例4: registrirajUporabnika

        public string registrirajUporabnika(Contracts.Data.Uporabnik uporabnik)
        {
            Uporabnik u = udao.Read(uporabnik.Upime);
            if (u != null) return "false";

            return udao.Create(uporabnik).ToString();
        }
开发者ID:gpanic,项目名称:fleamart,代码行数:7,代码来源:UporabnikService.svc.cs


示例5: Delete

		public async Task Delete(Contracts.Entities.Item e)
        {
			e.ItemProperties = null;
			Uow.MarkDeleted(e);
			await Task.FromResult(0);
			// Uow.ExecuteSqlCommand("delete from ItemProperty where ItemID = " + e.ItemID); => delete cascade
		}
开发者ID:aiten,项目名称:CNCLib,代码行数:7,代码来源:ItemRepository.cs


示例6: Store

		public async Task Store(Contracts.Entities.Item item)
		{
			// search und update machine

			int id = item.ItemID;

			var itemInDb = await Context.Items.
				Where((m) => m.ItemID == id).
				Include((d) => d.ItemProperties).
				FirstOrDefaultAsync();

            var optValues = item.ItemProperties ?? new List<Contracts.Entities.ItemProperty>();

			if (itemInDb == default(Contracts.Entities.Item))
			{
                // add new
				Uow.MarkNew(item);
			}
			else
			{
                // syn with existing

                Uow.SetValue(itemInDb,item);

				// search und update machinecommands (add and delete)

				Sync<Contracts.Entities.ItemProperty>(
                    itemInDb.ItemProperties,
                    optValues, 
					(x, y) => x.ItemID > 0 && x.ItemID == y.ItemID && x.Name == y.Name);
			}
		}
开发者ID:aiten,项目名称:CNCLib,代码行数:32,代码来源:ItemRepository.cs


示例7: SetOptions

 public void SetOptions (Contracts.Options options)
 {
   CalenderUrl = options.CalenderUrl;
   UserName = options.UserName;
   UseAccountPassword = options.UseAccountPassword;
   Password = options.Password;
   EmailAddress = options.EmailAddress;
 }
开发者ID:aluxnimm,项目名称:outlookcaldavsynchronizer,代码行数:8,代码来源:ServerSettingsTemplateViewModel.cs


示例8: CheckCompletionCode

 /// <summary>
 /// This checks for valid completion code for all functions
 /// </summary>
 /// <param name="responseCompletionCode"></param>
 /// <returns></returns>
 public static bool CheckCompletionCode(Contracts.CompletionCode responseCompletionCode)
 {
     if (responseCompletionCode == Contracts.CompletionCode.Success)
     {
         return true;
     }
     return false;
 }
开发者ID:silupher,项目名称:ChassisManager,代码行数:13,代码来源:ChassisManagerUtil.cs


示例9: AddAgent

 public override void AddAgent(Contracts.Agents.AgentBase agent)
 {
     if (_queue.Count == 0)
     {
         _currentServedTime = 0;
     }
     _queue.Add(agent);
 }
开发者ID:nomoreserious,项目名称:FlowSimulation,代码行数:8,代码来源:Queue.cs


示例10: ConfirmEntitySaved

        public static void ConfirmEntitySaved(int id, Contracts.Curve contract)
        {
            var savedEntity =
                new DbSetRepository<MDM.Curve>(new MappingContext()).FindOne<MDM.Curve>(id);
            contract.Identifiers.Add(new NexusId() { IsNexusId = true, Identifier = id.ToString() });

            CompareContractWithEntityDetails(contract, savedEntity);
        }
开发者ID:RaoulHolzer,项目名称:EnergyTrading-MDM-Sample,代码行数:8,代码来源:CurveDataChecker.cs


示例11: SetOptions

 public void SetOptions (Contracts.Options options)
 {
   EmailAddress = options.EmailAddress;
   if (!string.IsNullOrEmpty (options.CalenderUrl))
     CalenderUrl = options.CalenderUrl;
   else
     CalenderUrl = OptionTasks.GoogleDavBaseUrl;
 }
开发者ID:aluxnimm,项目名称:outlookcaldavsynchronizer,代码行数:8,代码来源:GoogleServerSettingsTemplateViewModel.cs


示例12: Delete

		public async Task Delete(Contracts.Entities.Machine m)
        {
			m.MachineCommands = null;
			m.MachineInitCommands = null;
			Uow.MarkDeleted(m);
			await Task.FromResult(0);
			//Uow.ExecuteSqlCommand("delete from MachineCommand where MachineID = " + m.MachineID); => delete cascade
			//Uow.ExecuteSqlCommand("delete from MachineInitCommand where MachineID = " + m.MachineID); => delete cascade
		}
开发者ID:aiten,项目名称:CNCLib,代码行数:9,代码来源:MachineRepository.cs


示例13: Message

 public Message(DateTimeOffset timestamp, bool isOutbound, string subject, string content, Contracts.IProviderDescription provider)
 {
     Timestamp = timestamp;
     Direction = isOutbound ? MessageDirection.Outbound : MessageDirection.Inbound;
     Subject = subject;
     Content = content;
     Provider = provider;
     MessageType = MessageType.Email;
 }
开发者ID:CallWall,项目名称:CallWall.Web,代码行数:9,代码来源:FakeGoogleCommunicationProvider.cs


示例14: ServiceModel

        public ServiceModel(ulong id, string name, Contracts.Services.Metadata.IServiceManagerMetadata serviceMetadata, Dictionary<string, object> settings)
        {
            Id = id;

            _name = name;
            _managerCode = serviceMetadata.Code;
            _typeName = serviceMetadata.FancyName;
            _settings = settings;
        }
开发者ID:nomoreserious,项目名称:FlowSimulation,代码行数:9,代码来源:ServiceModel.cs


示例15: Send

        public void Send(Contracts.MessageContract contract)
        {
            BrokeredMessage msg = new BrokeredMessage(contract);

            //ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;

            System.Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

            _Client.Send(msg);
        }
开发者ID:Notifyd,项目名称:notifyd,代码行数:10,代码来源:QueueClient.cs


示例16: MapLocationViewModel

        public MapLocationViewModel(Contracts.Models.GeoLocation location, string label)
        {
            Location = new Geopoint(new BasicGeoposition
            {
                Latitude = location.Latitude,
                Longitude = location.Longtitude
            });

            Label = label;
        }
开发者ID:telemat,项目名称:Demo,代码行数:10,代码来源:MapLocationViewModel.cs


示例17: Compare

 public static void Compare(Contracts.Curve contract, MDM.Curve entity)
 {
     Assert.AreEqual(contract.Details.Name, entity.Name);
     Assert.AreEqual(contract.Details.Commodity.NexusId().Value, entity.Commodity.Id);
     Assert.AreEqual(contract.Details.Originator.NexusId().Value, entity.Originator.Id);
     Assert.AreEqual(contract.Details.Location.NexusId().Value, entity.Location.Id);
     Assert.AreEqual(contract.Details.CommodityUnit, entity.CommodityUnit);
     Assert.AreEqual(contract.Details.CurveType, entity.Type);
     Assert.AreEqual(contract.Details.DefaultSpread, entity.DefaultSpread);
     Assert.AreEqual(contract.Details.Currency, entity.Currency);
 }
开发者ID:RaoulHolzer,项目名称:EnergyTrading-MDM-Sample,代码行数:11,代码来源:CurveComparer.cs


示例18: Compare

        public static void Compare(Contracts.PartyRole contract, MDM.PartyRole entity)
        {
            PartyRoleDetails detailsToCompare = entity.Details[0];

            if (contract.Nexus != null)
            {
                detailsToCompare = entity.Details.Where(details => details.Validity.Start == contract.Nexus.StartDate).First();
            }

            Assert.AreEqual(contract.Details.Name, detailsToCompare.Name);
        }
开发者ID:RaoulHolzer,项目名称:EnergyTrading-MDM-Sample,代码行数:11,代码来源:PartyRoleComparer.cs


示例19: Create

    public IOptionsDisplayControl Create (Contracts.Options options)
    {
      if (!_displayAllProfilesAsGeneric)
      {
        if (options.DisplayType == OptionsDisplayType.Google
            || options.ServerAdapterType == ServerAdapterType.WebDavHttpClientBasedWithGoogleOAuth
            || options.ServerAdapterType == ServerAdapterType.GoogleTaskApi)
          return new GoogleOptionsDisplayControl (_session, _profileDataDirectoryFactory, _fixInvalidSettings);
      }

      return new OptionsDisplayControl (_session, _profileDataDirectoryFactory, _fixInvalidSettings);
    }
开发者ID:rjani,项目名称:outlookcaldavsynchronizer,代码行数:12,代码来源:OptionsDisplayControlFactory.cs


示例20: CanProcessContract

 public override bool CanProcessContract(Contracts.Contract contract)
 {
     // Clean house
     foreach (Agent agent in AgentList.Instance.Agencies)
     {
         if (agent.Mentality.Contains(this) && agent.Mentality.Count > 1)
         {
             agent.Mentality.RemoveAll(am => am != this);
         }
     }
     return false;
 }
开发者ID:linuxgurugamer,项目名称:ContractConfigurator,代码行数:12,代码来源:NoRandomContractMentality.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Contracts.ChassisResponse类代码示例发布时间:2022-05-24
下一篇:
C# ContractFailureKind类代码示例发布时间: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