コード例 #1
0
 public bool IsCompatibleWith(FluentModelMemberVariables other)
 {
     if (other.FluentMethod == null || this.FluentMethod == null)
     {
         return(true);
     }
     else
     {
         var thisArmUri  = new ARMUri(this.FluentMethod.InnerMethod);
         var otherArmUri = new ARMUri(other.FluentMethod.InnerMethod);
         return(thisArmUri.IsSame(otherArmUri));
     }
 }
コード例 #2
0
        public bool IsCompatibleWith(FluentModelMemberVariables other)
        {
            if (other.FluentMethod == null ||
                this.FluentMethod == null)
            {
                return(true);
            }

            string url1 = other.FluentMethod.InnerMethod.Url;
            string url2 = this.FluentMethod.InnerMethod.Url;

            var itr1 = url1.Split(new char[] { '/' })
                       .Select(p => p)
                       .Where(p => !string.IsNullOrEmpty(p))
                       .GetEnumerator();

            var itr2 = url2.Split(new char[] { '/' })
                       .Select(p => p)
                       .Where(p => !string.IsNullOrEmpty(p))
                       .GetEnumerator();

            while (itr1.MoveNext() && itr2.MoveNext())
            {
                if (itr1.Current.StartsWith("{"))
                {
                    if (itr2.Current.StartsWith("{"))
                    {
                        continue;
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    if (itr1.Current.EqualsIgnoreCase(itr2.Current))
                    {
                        continue;
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(itr1.MoveNext() == false &&
                   itr2.MoveNext() == false);
        }