Пример #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////////

        #region IComparer<IScriptLocation> Members
        public int Compare(
            IScriptLocation x,
            IScriptLocation y
            )
        {
            if ((x == null) && (y == null))
            {
                return(0);
            }
            else if (x == null)
            {
                return(-1);
            }
            else if (y == null)
            {
                return(1);
            }
            else
            {
                int result = PathOps.CompareFileNames(x.FileName,
                                                      y.FileName);

                if (result != 0)
                {
                    return(result);
                }

                result = LogicOps.Compare(x.StartLine, y.StartLine);

                if (result != 0)
                {
                    return(result);
                }

                return(LogicOps.Compare(x.EndLine, y.EndLine));
            }
        }