/// <summary>ValueType factory method using enumeration.</summary>
        public static ValueType NewValueType(ValueTypeName type)
        {
            ValueType op = null;

            switch (type)
            {
            case ValueTypeName.Boolean:
                op = new BoolValueType();
                break;

            case ValueTypeName.Enum:
                op = new EnumValueType();
                break;

            case ValueTypeName.Number:
                op = new NumberValueType();
                break;

            case ValueTypeName.DateTime:
                op = new DateTimeValueType();
                break;

            case ValueTypeName.String:
            default:
                op = new StringValueType();
                break;
            }

            return(op);
        }
 /// <summary>
 /// Learns formatting data from source
 /// </summary>
 /// <param name="source">The source.</param>
 public void Learn(MetaTableProperty source)
 {
     if (ValueTypeName.isNullOrEmpty())
     {
         ValueTypeName = source.ValueTypeName;
     }
     if (ValueFormat.isNullOrEmpty())
     {
         ValueFormat = source.ValueFormat;
     }
     if (decimalDelimiter.isNullOrEmpty())
     {
         decimalDelimiter = source.decimalDelimiter;
     }
     if (thousantDelimiter.isNullOrEmpty())
     {
         thousantDelimiter = source.thousantDelimiter;
     }
     if (ContentType == CellContentType.unknown)
     {
         ContentType = source.ContentType;
     }
     if (AllContentTypes == CellContentType.unknown)
     {
         AllContentTypes = source.AllContentTypes;
     }
     factor = source.factor;
 }
示例#3
0
 public override int GetHashCode()
 {
     return(ValueTypeName.GetHashCode());
 }
示例#4
0
 public bool Equals(XValueTypeName other)
 {
     return(ValueTypeName.Equals(other.ValueTypeName));
 }
 public string ToLower()
 {
     return(ValueTypeName.ToLower());
 }
 public string FirstLower()
 {
     return(ValueTypeName.FirstLower());
 }