Exemple #1
0
 private static bool isFilterItem(CoCServerConfigData.OptionItem OIpt)
 {
     return(
         ((OIpt.collection != null) && (OIpt.collection.Count > 0)) ?
         true : false
         );
 }
Exemple #2
0
        private static string _ValueToString(SettingsProperty sp, CoCServerConfigData.OptionItem oi)
        {
            if ((sp == null) || (oi == null))
            {
                return(String.Empty);
            }
            switch (sp.PropertyType.ToString())
            {
            case "System.String":
            {
                return(oi.value);
            }

            case "System.Boolean":
            {
                return(oi.bval.ToString());
            }

            case "System.Decimal":
            case "System.Int32":
            case "System.Int64":
            case "System.Double":
            case "System.Single":
            {
                return(oi.num.ToString());
            }

            case "System.Collections.Specialized.StringCollection":
            {
                if ((oi.collection == null) && (!string.IsNullOrWhiteSpace(oi.value)))
                {
                    return(oi.value);
                }
                else if (oi.collection == null)
                {
                    break;
                }

                System.Collections.Specialized.StringCollection sc = oi.collection;

                if ((sc != null) && (sc.Count > 0))
                {
                    return(string.Join(",", sc));
                }
                break;
            }

            default:
            {
                break;
            }
            }
            return(String.Empty);
        }