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

C# IMatcher类代码示例

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

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



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

示例1: SameMatcher

		public override bool SameMatcher(IMatcher other)
		{
			DateTimeMatcher dtOther = other as DateTimeMatcher;
			if (dtOther == null)
				return false;
			return m_end == dtOther.m_end && m_start == dtOther.m_start && m_type == dtOther.m_type;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:7,代码来源:DateTimeMatcher.cs


示例2: SameMatcher

		public bool SameMatcher(IMatcher other)
		{
			if (other.GetType() != this.GetType())
				return false;
			ExactLiteralMatcher other1 = other as ExactLiteralMatcher;
			return m_target == other1.m_target && m_ws == other1.m_ws;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:7,代码来源:ExactLiteralMatcher.cs


示例3: setComponentNames

 static void setComponentNames(Matcher matcher, IMatcher[] matchers)
 {
     var componentNames = getComponentNames(matchers);
     if(componentNames != null) {
         matcher.componentNames = componentNames;
     }
 }
开发者ID:sschmid,项目名称:Entitas-CSharp,代码行数:7,代码来源:MatcherStatic.cs


示例4: VisualFingerprintMatchingFrm

 public VisualFingerprintMatchingFrm(IMatcher matcher, IResourceProvider resourceProvider, string resourcePath)
 {
     InitializeComponent();
     this.matcher = matcher;
     provider = resourceProvider;
     this.resourcePath = resourcePath;
     repository = new ResourceRepository(resourcePath);
 }
开发者ID:HydAu,项目名称:FingerprintRecognition-v2.2,代码行数:8,代码来源:VisualMatchingForm.cs


示例5: Equals

		public override bool Equals(IMatcher other)
		{
			var referenceMatcher = other as ReferenceMatcher;
			if (referenceMatcher == null)
				return false;

			return CompareValueTo(other);
		}
开发者ID:BiBongNet,项目名称:JustMockLite,代码行数:8,代码来源:ReferenceMatcher.cs


示例6: extractIndices

        static int[] extractIndices(IMatcher[] matchers)
        {
            var indices = new List<int>();
            for (int i = 0, matchersLength = matchers.Length; i < matchersLength; i++) {
                indices.AddRange(matchers[i].indices);
            }

            return indices.ToArray();
        }
开发者ID:fversnel,项目名称:Entitas-CSharp,代码行数:9,代码来源:AbstractCompoundMatcher.cs


示例7: Matches

		public bool Matches(IMatcher other)
		{
			if (this.Equals(other))
				return true;

			if (!this.CanMatch(other))
				return false;

			return this.MatchesCore(other);
		}
开发者ID:BiBongNet,项目名称:JustMockLite,代码行数:10,代码来源:CategoricalMatcherBase.cs


示例8: CompareValueTo

		private bool CompareValueTo(IMatcher other)
		{
			var valueMatcher = other as IValueMatcher;
			if (valueMatcher == null)
				return false;

			if (this.IsValueType)
				return Equals(this.reference, valueMatcher.Value);
			return ReferenceEquals(this.reference, valueMatcher.Value);
		}
开发者ID:BiBongNet,项目名称:JustMockLite,代码行数:10,代码来源:ReferenceMatcher.cs


示例9: ReactiveSystem

 ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, IMatcher[] triggers, GroupEventType[] eventTypes)
 {
     _subsystem = subSystem;
     var groups = new Group[triggers.Length];
     for (int i = 0, triggersLength = triggers.Length; i < triggersLength; i++) {
         groups[i] = pool.GetGroup(triggers[i]);
     }
     _observer = new GroupObserver(groups, eventTypes);
     _buffer = new List<Entity>();
 }
开发者ID:Geroppo,项目名称:Entitas-CSharp,代码行数:10,代码来源:ReactiveSystem.cs


示例10: getComponentNames

        static string[] getComponentNames(IMatcher[] matchers)
        {
            for (int i = 0; i < matchers.Length; i++) {
                var matcher = matchers[i] as Matcher;
                if(matcher != null && matcher.componentNames != null) {
                    return matcher.componentNames;
                }
            }

            return null;
        }
开发者ID:sschmid,项目名称:Entitas-CSharp,代码行数:11,代码来源:MatcherStatic.cs


示例11: GetEntityWithOrder

    public static Entity GetEntityWithOrder(this Pool pool, int order, IMatcher matcher)
    {
        Entity[] entities = pool.GetGroup(Matcher.AllOf(CoreGameMatcher.Order, matcher)).GetEntities();

        foreach(Entity e in entities){
            if(e.order.value == order){
                return e;
            }
        }
        return null;
    }
开发者ID:Reimerei,项目名称:port_experiments,代码行数:11,代码来源:OrderComponent.cs


示例12: WindsorPersister

        public WindsorPersister(IDatabase database, IKernel kernel, IMatcher matcher)
            : base(database, matcher)
        {
            if (kernel == null)
            {
                throw new ArgumentNullException("kernel");
            }

            var converter = new WindsorConverter(kernel);
            Settings.Converters = new[] {converter};
        }
开发者ID:Codestellation,项目名称:DarkFlow,代码行数:11,代码来源:WindsorPersister.cs


示例13: mergeIndices

        static int[] mergeIndices(IMatcher[] matchers) {
            var indices = new int[matchers.Length];
            for (int i = 0, matchersLength = matchers.Length; i < matchersLength; i++) {
                var matcher = matchers[i];
                if (matcher.indices.Length != 1) {
                    throw new MatcherException(matcher);
                }
                indices[i] = matcher.indices[0];
            }

            return indices;
        }
开发者ID:Cotoff,项目名称:Entitas-CSharp,代码行数:12,代码来源:Matcher.cs


示例14: WithForwardSlashes

 public static IMatcher<string> WithForwardSlashes(IMatcher<string> matcher)
 {            
     return Matchers.Function((string actual,IMatchDiagnostics diag) =>
     {
         if (actual != null)
         {
             actual = actual.Replace("\\", "/");
         }
         return matcher.Matches(actual, diag);
     },
     "ignoring slash type, " + matcher
   );
 }
开发者ID:andreasetti,项目名称:TestFirst.Net,代码行数:13,代码来源:APath.cs


示例15: TaskRouter

        public TaskRouter(IMatcher matcher, IEnumerable<IExecutorImplementation> taskQueues)
        {
            if (matcher == null)
            {
                throw new ArgumentNullException("matcher");
            }

            if (taskQueues == null)
            {
                throw new ArgumentNullException("taskQueues");
            }

            _matcher = matcher;
            _executors = taskQueues.ToDictionary(x => x.Name, x => x);
        }
开发者ID:Codestellation,项目名称:DarkFlow,代码行数:15,代码来源:TaskRouter.cs


示例16: TestMatcher

        private static void TestMatcher(IOmsFactory orders, IMatcher matcher)
        {
            var trades1 = matcher.AddOrder(orders.CreateOrder(10,Side.Buy,100));
            var trades2 = matcher.AddOrder(orders.CreateOrder(10, Side.Sell, 100));

            var tests = new List<Tuple<decimal, Side, ulong>>
            {
                new Tuple<decimal, Side, ulong>(10,Side.Buy,100),
                new Tuple<decimal, Side, ulong>(10,Side.Buy,100),
                new Tuple<decimal, Side, ulong>(10,Side.Buy,100),
                new Tuple<decimal, Side, ulong>(10,Side.Buy,100),
                new Tuple<decimal, Side, ulong>(10,Side.Buy,100),
                new Tuple<decimal, Side, ulong>(10,Side.Buy,100),
            };
        }
开发者ID:colinhannah2000,项目名称:Code,代码行数:15,代码来源:Program.cs


示例17: As

        // TODO:convert to use a generic type converter? Put into CoreMatchers?

        /// <summary>
        /// Attempt to parse the string to an int and apply the given int matcher
        /// </summary>
        /// <param name="intMatcher">The int matcher to match against</param>
        /// <returns>A matcher on string</returns>
        public static IMatcher<string> As(IMatcher<int?> intMatcher)
        {
            return Matchers.Function(
                (string actual, IMatchDiagnostics diagnostics) =>
                {
                    int intActual;
                    if (int.TryParse(actual, out intActual))
                    {
                        return intMatcher.Matches(intActual, diagnostics);
                    }
                    diagnostics.MisMatched("Couldn't parse the string '{0}' as an int", actual);
                    return false;
                }, 
                "string of int matching " + intMatcher);
        }
开发者ID:activelylazy,项目名称:TestFirst.Net,代码行数:22,代码来源:AString.cs


示例18: RemoveJobListenerMatcher

        public bool RemoveJobListenerMatcher(string listenerName, IMatcher<JobKey> matcher)
        {
            if (matcher == null)
            {
                throw new ArgumentException("Non-null value not acceptable.");
            }

            lock (globalJobListeners)
            {
                IList<IMatcher<JobKey>> matchers = globalJobListenersMatchers.TryGetAndReturn(listenerName);
                if (matchers == null)
                {
                    return false;
                }
                return matchers.Remove(matcher);
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:17,代码来源:ListenerManagerImpl.cs


示例19: Equals

		public bool Equals(IMatcher other)
		{
			var paramsMatcher = other as ParamsMatcher;
			if (paramsMatcher == null)
				return false;

			if (paramsMatcher.matchers.Length != this.matchers.Length)
				return false;

			for(int i=0;i<this.matchers.Length;i++)
			{
				if(!this.matchers[i].Equals(paramsMatcher.matchers[i]))
					return false;
			}

			return true;
		}
开发者ID:BiBongNet,项目名称:JustMockLite,代码行数:17,代码来源:ParamsMatcher.cs


示例20: Find

        public static List<ResultItem> Find(string fileName, IMatcher matcher)
        {
            if (File.Exists(fileName) == false)
            {
                return null;
            }

            List<ResultItem> results = new List<ResultItem>();
            using (StreamReader sr = new StreamReader(fileName))
            {
                int lineNum = 0;
                string line = null;
                bool start = false;
                ResultItem result = null;
                while ((line = sr.ReadLine()) != null)
                {
                    lineNum++;
                    if (!start)
                    {
                        if (matcher.BeginMatch(line))
                        {
                            start = true;
                            result = new ResultItem(fileName);
                            result.LineNumber = lineNum;
                            result.AddContent(line);
                        }
                    }
                    else
                    {
                        if (matcher.EndMatch(line))
                        {
                            start = false;
                            results.Add(result);
                            result = null;
                        }
                        else
                        {
                            result.AddContent(line);
                        }
                    }
                }
                if (result != null) results.Add(result);
            }
            return results;
        }
开发者ID:howbigbobo,项目名称:DailyCode,代码行数:45,代码来源:FileContentFinder.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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