Beispiel #1
0
        public static string UpdateFormatString(
            string formatString,
            bool doubleQuote,
            bool forceChange)
        {
            string str = (string)null;

            switch (GridGroupByField.ValidateFormatString(formatString))
            {
            case 0:
                str = string.Format("'{0}'", (object)formatString);
                break;

            case 1:
                str = doubleQuote || !forceChange?string.Format("'{0}'", (object)formatString) : string.Format("\"{0}\"", (object)formatString.Replace('"', '\''));

                break;

            case 2:
                str = !doubleQuote || !forceChange?string.Format("\"{0}\"", (object)formatString) : string.Format("'{0}'", (object)formatString.Replace('\'', '"'));

                break;

            case 3:
                str = !doubleQuote?string.Format("\"{0}\"", (object)formatString.Replace('"', '\'')) : string.Format("'{0}'", (object)formatString.Replace('\'', '"'));

                break;
            }
            return(str);
        }
Beispiel #2
0
 public virtual int ValidateFormatString()
 {
     return(GridGroupByField.ValidateFormatString(this.formatString));
 }