System.Xml.Xsl.XsltOld.TemplateManager.TemplateComparer.Compare C# (CSharp) Method

Compare() public method

public Compare ( object x, object y ) : int
x object
y object
return int
            public int Compare(object x, object y) {
                Debug.Assert(x != null && x is TemplateAction);
                Debug.Assert(y != null && y is TemplateAction);

                TemplateAction tx = (TemplateAction) x;
                TemplateAction ty = (TemplateAction) y;

                Debug.Assert(! Double.IsNaN(tx.Priority));
                Debug.Assert(! Double.IsNaN(ty.Priority));

                if (tx.Priority == ty.Priority) {
                    Debug.Assert(tx.TemplateId != ty.TemplateId || tx == ty);
                    return tx.TemplateId - ty.TemplateId;
                }
                else {
                    return tx.Priority > ty.Priority ? 1 : -1;
                }
            }
        }
TemplateManager.TemplateComparer