Exemple #1
0
        public bool Equals(StringKeySequence other)
        {
            if (!IsEmpty && other.IsEmpty)
            {
                return(false);
            }
            if (IsEmpty && !other.IsEmpty)
            {
                return(false);
            }
            if (IsEmpty && other.IsEmpty)
            {
                return(true);
            }

            if (mSegments.Length != other.mSegments.Length)
            {
                return(false);
            }

            for (var i = 0; i < mSegments.Length; i++)
            {
                if (!Equals(mSegments[i], other.mSegments[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
        public StringKeySequence Concat(StringKeySequence keySequence)
        {
            var segments = new[] { this }.Concat(keySequence.Segments).Where(x => !x.IsEmpty).ToArray();

            if (segments.Length == 0)
            {
                return(new StringKeySequence());
            }

            return(new StringKeySequence(segments));
        }
Exemple #3
0
 public StringKeySequence Concat(StringKeySequence keySequence) => new StringKeySequence((mSegments ?? new StringKey[0]).Concat(keySequence.mSegments ?? new StringKey[0]).ToArray());