Пример #1
0
        public int Compare(ActionBase x, ActionBase y)
        {
            if (x == null || y == null)
            {
                return(0);
            }

            return(ActionComparerHelper.CompareByIndexAndName(x, y));
        }
Пример #2
0
        public int Compare(ActionBase x, ActionBase y)
        {
            if (x == null || y == null)
            {
                return(0);
            }

            var xType        = GetContentType(x);
            var yType        = GetContentType(y);
            var xIsContainer = IsContainer(xType);
            var yIsContainer = IsContainer(yType);

            if (xIsContainer && !yIsContainer)
            {
                return(-1);
            }

            if (!xIsContainer && yIsContainer)
            {
                return(1);
            }

            return(ActionComparerHelper.CompareByIndexAndText(x, y));
        }