Example #1
0
    public void SetValue(Object val)
    {
        if (val == null)
        {
            return;
        }
        switch (val.GetType().ToString())
        {
        case "System.Decimal":
        case "System.Double":
        case "System.Single":
            m_StrValue = val.ToString(); m_ValueType = CommonValueType.CommonValueType_Float; break;

        case "System.Char":
            SetValue(System.Convert.ToChar(val)); m_ValueType = CommonValueType.CommonValueType_Char; break;

        case "System.Int16":    //short
        case "System.UInt16":   //ushort
        case "System.Int32":    //int
        case "System.UInt32":   //uint
        case "System.Int64":    //long
        case "System.UInt64":   //ulong
        case "System.Byte":
        case "System.SByte":
            m_StrValue = val.ToString(); m_ValueType = CommonValueType.CommonValueType_Int; break;

        case "System.String":    //string
            m_StrValue = val as string; m_ValueType = CommonValueType.CommonValueType_String; break;
        }
    }
Example #2
0
 public void SetValue(string val)
 {
     m_StrValue = val; m_ValueType = CommonValueType.CommonValueType_String;
 }
Example #3
0
 public void SetValue(double val)
 {
     m_StrValue = val.ToString(); m_ValueType = CommonValueType.CommonValueType_Float;
 }
Example #4
0
 public void SetValue(ulong val)
 {
     m_StrValue = val.ToString(); m_ValueType = CommonValueType.CommonValueType_Int;
 }
Example #5
0
 public void SetValue(bool val)
 {
     m_StrValue = val ? "1" : "0"; m_ValueType = CommonValueType.CommonValueType_Int;
 }
Example #6
0
 public void Reset()
 {
     m_ValueType = CommonValueType.CommonValueType_None;
     m_StrValue  = "";
 }