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

C# ICondition类代码示例

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

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



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

示例1: GetFileTypes

		public static List<FileType> GetFileTypes(ICondition condition)
		{
            List<FileType> returnVal = new List<FileType>();
			
			IDataSource dataSource = condition.DataLeft.Data as IDataSource;
			if (null == dataSource)
				return returnVal;

			if (2 > dataSource.Method.Parameters.Count)
                return returnVal;

			IParameter parameter = dataSource.Method.Parameters[1];
			if (0 != string.Compare(parameter.Name.Value, m_FileTypeParameterName, true, CultureInfo.InvariantCulture))
                return returnVal;

			IPolicyObjectCollection<IDataItem> collection = parameter.Value.Data as IPolicyObjectCollection<IDataItem>;
			if (null == collection)
                return returnVal;

			foreach (IDataItem item in collection)
			{
				string fileTypeString = item.Value as string;
				FileType type = (FileType)Enum.Parse(typeof(FileType), fileTypeString);
				returnVal.Add(type);
			}

			return returnVal;
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:28,代码来源:ExpressionHelpers.cs


示例2: IsConditionalExpirable

 public static Polyface IsConditionalExpirable(this Polyface root, ICondition expiry)
 {
     Condition.Requires(root).IsNotNull();
     var composited = new NaturalConditionalExpirable(expiry);
     root.Is(composited);
     return root;
 }
开发者ID:Piirtaa,项目名称:Decoratid,代码行数:7,代码来源:NaturalConditionalExpirable.cs


示例3: LoadSettingsFromCondition

 public void LoadSettingsFromCondition(ICondition condition)
 {
     var c = (ProductivityCondition)condition;
     this.settingsPanel.ConditionEnabled = c.Enabled;
     this.settingsPanel.Pomodoros = c.Pomodoros;
     this.settingsPanel.Duration = c.Duration;
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:ProductivityConditionGuiController.cs


示例4: LockedDownFileStore

 public LockedDownFileStore(string filePath, ICondition backingCondition = null)
     : base(
     NaturalInMemoryStore.New()
     .DecorateWithBackingLockedFile(filePath, backingCondition)
     )
 {
 }
开发者ID:Piirtaa,项目名称:Decoratid,代码行数:7,代码来源:FileStores.cs


示例5: LoadConditionFromXml

 public override void LoadConditionFromXml(ICondition condition, XmlElement conditionElement)
 {
     var c = condition as TimeOfDayCondition;
     c.StartTime = TimeSpan.Parse(conditionElement.GetAttribute("start"));
     c.EndTime = TimeSpan.Parse(conditionElement.GetAttribute("end"));
     c.ShouldBeWithin = bool.Parse(conditionElement.GetAttribute("shouldBeWithin"));
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:TimeOfDayConditionChecker.cs


示例6: ChainCondition

 public ChainCondition(int? transitionTarget, ICondition[] subconditions)
 {
     _currentIndex = 0;
     _subconditions = subconditions;
     _transitionTarget = transitionTarget;
     _hasNotification = false;
 }
开发者ID:ikids-research,项目名称:ikids-newborn-cognitive-unity,代码行数:7,代码来源:JSONDataConditionLoader.cs


示例7: DetachCondition

 /// <summary>
 /// This operation detaches a Condition from the WaitSet. If the Condition was not attached 
 /// to this WaitSet, the operation returns PreconditionNotMet
 /// </summary>
 /// <param name="condition">The attached condition in the WaitSet which is to be detached.</param>
 /// <returns>Possible return codes are: Ok, Error, BadParameter, OutOfResources or PreconditionNotMet.</returns>
 public ReturnCode DetachCondition(ICondition condition)
 {
     Condition conditionObj = (Condition)condition;
     return OpenSplice.Gapi.WaitSet.detach_condition(
             GapiPeer,
             conditionObj.GapiPeer);
 }
开发者ID:xrl,项目名称:opensplice_dds,代码行数:13,代码来源:WaitSet.cs


示例8: ExpiresWhen

        public static IHasExpirable ExpiresWhen(this IHasExpirable thing, ICondition condition)
        {
            Condition.Requires(thing).IsNotNull();
            thing.Expirable = thing.Expirable.DecorateWithConditionalExpirable(condition);

            return thing;
        }
开发者ID:Piirtaa,项目名称:Decoratid,代码行数:7,代码来源:ConditionalExpirableDecoration.cs


示例9: compileFirstJoin

 /// <summary> TODO - note the logic feels a bit messy. Need to rethink it and make it
 /// simpler. When the first conditional element is Exist, it can only have
 /// literal constraints, so we shouldn't need to check if the last node
 /// is a join. That doesn't make any sense. Need to rethink this and clean
 /// it up. Peter Lin 10/14/2007
 /// </summary>
 public override void compileFirstJoin(ICondition condition, Rule.IRule rule)
 {
     BaseJoin bjoin = new ExistJoinFrst(ruleCompiler.Engine.nextNodeId());
     ExistCondition cond = (ExistCondition) condition;
     BaseNode base_Renamed = cond.LastNode;
     if (base_Renamed != null)
     {
         if (base_Renamed is BaseAlpha)
         {
             ((BaseAlpha) base_Renamed).addSuccessorNode(bjoin, ruleCompiler.Engine, ruleCompiler.Memory);
         }
         else if (base_Renamed is BaseJoin)
         {
             ((BaseJoin) base_Renamed).addSuccessorNode(bjoin, ruleCompiler.Engine, ruleCompiler.Memory);
         }
     }
     else
     {
         // the rule doesn't have a literal constraint so we need to Add
         // ExistJoinFrst as a child
         ObjectTypeNode otn = ruleCompiler.findObjectTypeNode(cond.TemplateName);
         otn.addSuccessorNode(bjoin, ruleCompiler.Engine, ruleCompiler.Memory);
     }
     // important, do not call this before ExistJoinFrst is added
     // if it's called first, the List<Object> will return index
     // out of bound, since there's nothing in the list
     cond.addNode(bjoin);
 }
开发者ID:,项目名称:,代码行数:34,代码来源:


示例10: Rule

 public Rule(ICategory applyCategory, IAction action, ICondition condition, string name)
 {
     m_condition = condition;
     m_action = action;
     m_applyCategory = applyCategory;
     m_name = name;
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:7,代码来源:Rule.cs


示例11: compileJoin

 /// <summary> the method is responsible for compiling a TestCE pattern to a testjoin node.
 /// It uses the globally declared prevCE and prevJoinNode
 /// </summary>
 public virtual BaseJoin compileJoin(ICondition condition, int position, Rule.IRule rule)
 {
     TestCondition tc = (TestCondition) condition;
     ShellFunction fn = (ShellFunction) tc.Function;
     fn.lookUpFunction(ruleCompiler.Engine);
     IParameter[] oldpm = fn.Parameters;
     IParameter[] pms = new IParameter[oldpm.Length];
     for (int ipm = 0; ipm < pms.Length; ipm++)
     {
         if (oldpm[ipm] is ValueParam)
         {
             pms[ipm] = ((ValueParam) oldpm[ipm]).cloneParameter();
         }
         else if (oldpm[ipm] is BoundParam)
         {
             BoundParam bpm = (BoundParam) oldpm[ipm];
             // now we need to resolve and setup the BoundParam
             Binding b = rule.getBinding(bpm.VariableName);
             BoundParam newpm = new BoundParam(b.LeftRow, b.LeftIndex, 9, bpm.ObjectBinding);
             newpm.VariableName = bpm.VariableName;
             pms[ipm] = newpm;
         }
     }
     BaseJoin joinNode = null;
     if (tc.Negated)
     {
         joinNode = new NTestNode(ruleCompiler.Engine.nextNodeId(), fn.Function, pms);
     }
     else
     {
         joinNode = new TestNode(ruleCompiler.Engine.nextNodeId(), fn.Function, pms);
     }
     ((TestNode) joinNode).lookUpFunction(ruleCompiler.Engine);
     return joinNode;
 }
开发者ID:,项目名称:,代码行数:38,代码来源:


示例12: CreateConditionDisplay

		/// <summary>
		/// Creates a visual representation of a condition
		/// </summary>
		/// <returns>A ConditionMethodDisplay object</returns>
		public static ConditionDisplayBase CreateConditionDisplay(ICondition condition, Workshare.Policy.PolicyType type)
		{
			ConditionUnitFactory.PreDefinedConditionType conditionType = ConditionUnitFactory.PreDefinedConditionType.Undefined;

			try
			{
				conditionType = CustomAttributes.GetPreDefinedConditionType(condition);
			}
			catch (ArgumentException ex)
			{
				Logger.LogError("Condition is not one of our predefined types.");
				Logger.LogError(ex);
				return null;
			}

			switch (conditionType)
			{
			case ConditionUnitFactory.PreDefinedConditionType.ContentInFileContext:
				return new ConditionDisplayContentInFileContext(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.RegexInFileContext:
				return new ConditionDisplayRegexInFileContext(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.ContentInFileName:
				return new ConditionDisplayContentInFileName(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.RegexInFileName:
				return new ConditionDisplayRegexInFileName(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.FileSize:
				return new ConditionDisplayFileSize(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.FileType:
				return new ConditionDisplayFileType(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.HiddenDataInFile:
				return new ConditionDisplayHiddenDataInFile(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.CustomProperty:
				return new ConditionDisplayCustomProperty(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.PasswordProtectedFile:
				return new ConditionDisplayPasswordProtectedFile(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.DocumentRestrictions:
				return new ConditionDisplayDocumentRestrictions(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.PiiInFile:
				return new ConditionDisplayPiiInFile(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.FileProperty:
				return new ConditionDisplayFileProperty(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.EmbeddedEmail:
				return new ConditionDisplayEmbeddedEmail(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.EmailAdresses:
				return new ConditionDisplayEmailAddresses(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.HiddenDataInPDF:
				return new ConditionDisplayHiddenDataInPDF(condition, type);
			case ConditionUnitFactory.PreDefinedConditionType.TotalAttachmentSize:
				return new ConditionDisplayTotalAttachmentSize(condition, type);
			default:
				{
					Utilities.ErrorMessage errorMessage = new Utilities.ErrorMessage(
						"CONDITION_INVALID_PREDEFINED",
						"Workshare.PolicyDesigner.Properties.Resources",
						System.Reflection.Assembly.GetExecutingAssembly());
					Logger.LogError(errorMessage.LogString);
					throw new ArgumentException(errorMessage.DisplayString);
				}
			}
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:64,代码来源:ConditionDisplayFactory.cs


示例13: AddCondition

 public void AddCondition(ICondition c)
 {
     lock (_conditions)
     {
         _conditions.Add(c);
     }
 }
开发者ID:skohub,项目名称:Sh,代码行数:7,代码来源:VirtualDevice.cs


示例14: IsConditionLoss

 private static bool IsConditionLoss(ICondition newCondition, ICondition oldCondition)
 {
     if (newCondition is AbstractAtomicCondition)
     {
         if (oldCondition is AbstractCompositeCondition)
         {
             var condition = (AbstractCompositeCondition) oldCondition;
             if (condition.ConditionList.Count > 0)
             {
                 return true;
             }
         }
     }
     else if (newCondition is AbstractSingleCondition)
     {
         if (oldCondition is AbstractMultipleCondition)
         {
             var condition = (AbstractMultipleCondition) oldCondition;
             if (condition.ConditionList.Count > 1)
             {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:dbremner,项目名称:clrinterop,代码行数:26,代码来源:MainForm.cs


示例15: DataSelectParameter

		public DataSelectParameter(string fullName, ICondition condition, string scope, Paging paging, Sorting[] sortings) : base(fullName)
		{
			_condition = condition;
			_scope = scope;
			_paging = paging;
			_sortings = sortings;
		}
开发者ID:Zongsoft,项目名称:Zongsoft.Data,代码行数:7,代码来源:DataSelectParameter.cs


示例16: FileStore

 public FileStore(string filePath, ICondition backingCondition = null)
     : base(
     NaturalInMemoryStore.New()
     .DecorateWithBackingFile(filePath)
     )
 {
 }
开发者ID:Piirtaa,项目名称:Decoratid,代码行数:7,代码来源:FileStores.cs


示例17: ObservingConditionDecoration

 public ObservingConditionDecoration(ICondition decorated, LogicOf<ICondition> preObservation,
     LogicOf<ICondition> postObservation)
     : base(decorated)
 {
     this.PostObservation = postObservation;
     this.PreObservation = preObservation;
 }
开发者ID:Piirtaa,项目名称:Decoratid,代码行数:7,代码来源:ObservingConditionDecoration.cs


示例18: Codon

 public Codon(SkyMap.Net.Core.AddIn addIn, string name, SkyMap.Net.Core.Properties properties, ICondition[] conditions)
 {
     this.addIn = addIn;
     this.name = name;
     this.properties = properties;
     this.conditions = conditions;
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:7,代码来源:Codon.cs


示例19: SaveConditionToXml

 public override void SaveConditionToXml(ICondition condition, XmlElement conditionElement)
 {
     var c = condition as TimeOfDayCondition;
     conditionElement.SetAttribute("start", c.StartTime.ToString());
     conditionElement.SetAttribute("end", c.EndTime.ToString());
     conditionElement.SetAttribute("shouldBeWithin", c.ShouldBeWithin.ToString());
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:TimeOfDayConditionChecker.cs


示例20: IsTrue

 public override bool IsTrue(ICondition condition)
 {
     var c = (ProductivityCondition)condition;
     var since = ((DateTime)this.now.Do(null)) - c.Duration;
     var productivity = this.getProductivity.Do(new ProductivityCommandArgs(since)) as PomodorosProductivity;
     return productivity.Pomodoros < c.Pomodoros;
 }
开发者ID:kristiandupont,项目名称:CherryTomato-classic,代码行数:7,代码来源:ProductivityConditionChecker.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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