Exemple #1
0
        private static int SmartTagComparer(ISmartTagAction x, ISmartTagAction y)
        {
            var left  = x as ImportSmartTagAction;
            var right = y as ImportSmartTagAction;

            if (left == null)
            {
                return(right == null ? 0 : 1);
            }
            else if (right == null)
            {
                return(-1);
            }

            if (left.FromName == null)
            {
                if (right.FromName != null)
                {
                    // left is import <fob>, order it first
                    return(-1);
                }

                // two imports, order by name
                return(String.Compare(left.Name, right.Name));
            }
            else if (right.FromName == null)
            {
                // left is from import, right is import, import comes first
                return(1);
            }

            // two from imports, order by from names, shorter names will come first
            return(String.Compare(left.FromName, right.FromName));
        }
Exemple #2
0
 public SmartTagActionWrapper(ISmartTagAction action)
 {
     _action = action;
 }
Exemple #3
0
        private static int SmartTagComparer(ISmartTagAction x, ISmartTagAction y) {
            var left = x as ImportSmartTagAction;
            var right = y as ImportSmartTagAction;
            if (left == null) {
                return right == null ? 0 : 1;
            } else if (right == null) {
                return -1;
            }

            if (left.FromName == null) {
                if (right.FromName != null) {
                    // left is import <fob>, order it first
                    return -1;
                }

                // two imports, order by name
                return String.Compare(left.Name, right.Name);
            } else if (right.FromName == null) {
                // left is from import, right is import, import comes first
                return 1;
            }

            // two from imports, order by from names, shorter names will come first
            return String.Compare(left.FromName, right.FromName);
        }