コード例 #1
0
            public static int Compare(
                VariableSymbol left,
                VariableSymbol right,
                INamedTypeSymbol cancellationTokenType)
            {
                // CancellationTokens always go at the end of method signature.
                var leftIsCancellationToken  = left.OriginalType.Equals(cancellationTokenType);
                var rightIsCancellationToken = right.OriginalType.Equals(cancellationTokenType);

                if (leftIsCancellationToken && !rightIsCancellationToken)
                {
                    return(1);
                }
                else if (!leftIsCancellationToken && rightIsCancellationToken)
                {
                    return(-1);
                }

                if (left.DisplayOrder == right.DisplayOrder)
                {
                    return(left.CompareTo(right));
                }

                return(left.DisplayOrder - right.DisplayOrder);
            }
コード例 #2
0
            public static int Compare(VariableSymbol left, VariableSymbol right)
            {
                if (left.DisplayOrder == right.DisplayOrder)
                {
                    return(left.CompareTo(right));
                }

                return(left.DisplayOrder - right.DisplayOrder);
            }