Ejemplo n.º 1
0
        private static int CompareCore(object x, object y)
        {
            ModelPropertyEntry j = x as ModelPropertyEntry;
            ModelPropertyEntry k = y as ModelPropertyEntry;

            if (j == null && k == null)
            {
                return(0);
            }
            if (j == null)
            {
                return(-1);
            }
            if (k == null)
            {
                return(1);
            }

            PropertyOrder a = j.PropertyOrder ?? DefaultOrder;
            PropertyOrder b = k.PropertyOrder ?? DefaultOrder;

            int result = a.CompareTo(b);

            return(result != 0 ? result : string.Compare(j.DisplayName, k.DisplayName, StringComparison.CurrentCulture));
        }
Ejemplo n.º 2
0
            public override int Compare(PropertyEntry x, PropertyEntry y)
            {
                SceneNodeProperty sceneNodeProperty1 = (SceneNodeProperty)x;
                SceneNodeProperty sceneNodeProperty2 = (SceneNodeProperty)y;
                PropertyOrder     propertyOrder1     = (PropertyOrder)sceneNodeProperty1.PropertyOrder;
                PropertyOrder     propertyOrder2     = (PropertyOrder)sceneNodeProperty2.PropertyOrder;
                int num = !((OrderToken)propertyOrder1 == (OrderToken)propertyOrder2) ? propertyOrder1.CompareTo((OrderToken)propertyOrder2) : 0;

                if (num != 0)
                {
                    return(num);
                }
                return(x.PropertyName.CompareTo(y.PropertyName));
            }