Ejemplo n.º 1
0
        internal MatchResult Match(MethodUrlsSubset group, GenBinding newBinding)
        {
            #region MatchPart



            #endregion


            #region NoMatchPart



            #endregion


            return MatchResult.BothOptions;

            
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="methodUrlsSubset"></param>
        /// <returns></returns>
        /// 
        internal bool MatchWithSubset(MethodUrlsSubset methodUrlsSubset)
        {
            List<GenBinding> newList = new List<GenBinding>(methodUrlsSubset.BindingsList);
            IEnumerable<GenBinding> matchBindings = newList.Where(binding => binding.MatchStatus);
            IEnumerable<GenBinding> noMatchBindings = newList.Where(binding => !binding.MatchStatus);
            
            if (this.MatchStatus)
            {
                foreach (GenBinding binding in matchBindings)
                {
                    if (!CompareWithMatch(binding))
                        return false;
                }

                foreach (GenBinding binding in noMatchBindings)
                {
                    if (!CompareMatchAndNoMatch(this, binding))
                        return false;
                }

            }
            else
            {
                foreach (GenBinding binding in matchBindings)
                {
                    if (!CompareMatchAndNoMatch(binding, this))
                        return false;
                }

            }

            return true;


        }
Ejemplo n.º 3
0
        private List<MethodUrlsSubset> CreateGroups(BindVerb verb)
        {
            MethodUrlsSubset firstGroup = new MethodUrlsSubset();
            List<MethodUrlsSubset> allGroups = new List<MethodUrlsSubset>();

            List<MethodUrlsSubset> newBindingGroups;
            allGroups.Add(firstGroup);
            List<IEnumerable<GenBinding>> bindingsForVerb = allBindings[verb];
            foreach (IEnumerable<GenBinding> bindingsPair in bindingsForVerb)
            {

                newBindingGroups = new List<MethodUrlsSubset>();

                foreach (MethodUrlsSubset group in allGroups)
                {
                    foreach (GenBinding binding in bindingsPair)
                    {
                        MethodUrlsSubset newGroup = group.ApplyBinding(binding);
                        if (newGroup != null)
                            newBindingGroups.Add(newGroup);
                    }
                }

                allGroups = newBindingGroups;

            }

            return allGroups;

        }