Beispiel #1
0
 public JOperateNum(string fieldName, JFieldType valueType)
     : this()
 {
     this.FieldName = fieldName;
     this.ValueType = valueType;
     this.Values    = new List <object>();
 }
Beispiel #2
0
 /// <summary>
 /// Read a single field from JMP.
 /// </summary>
 /// <param name="br">Binary Reader to use.</param>
 public JField(DhBinaryReader br)
 {
     Hash    = br.ReadU32();
     Bitmask = br.ReadU32();
     Offset  = br.ReadU16();
     Shift   = br.ReadS8();
     Type    = (JFieldType)br.ReadU8();
     Name    = JMPUtils.HashToName(Hash);
 }
Beispiel #3
0
 /// <summary>
 /// Initialize a new empty field.
 /// </summary>
 public JField()
 {
     Hash    = 0;
     Bitmask = 0;
     Offset  = 0;
     Shift   = 0;
     Type    = JFieldType.INTEGER;
     Name    = "";
 }
Beispiel #4
0
        private string GetFileValueFormat(JFieldType valueType)
        {
            switch (valueType)
            {
            case JFieldType.Numeric: return(NumericFieldValueFormat + ",");

            case JFieldType.String: return(StringFieldValueFormat + ",");

            case JFieldType.DateTime: return(DateTimeFieldValueFormat + ",");

            default: return(StringFieldValueFormat);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Read a single field from JMP.
        /// </summary>
        /// <param name="br">Binary Reader to use.</param>
        public JField(DhBinaryReader br)
        {
            // Read field's hash.
            Hash = br.ReadU32();

            // Read field's bitmask.
            Bitmask = br.ReadU32();

            // Read field's offset.
            Offset = br.ReadU16();

            // Read field's shift.
            Shift = br.ReadS8();

            // Read field's type.
            Type = (JFieldType)br.ReadU8();

            // Resolve field's hash to get field name.
            Name = JMPUtils.HashToName(Hash);
        }
Beispiel #6
0
 public FieldValueTypeNotSupportOperatorException(string filedName, JFieldType valueType, string operate)
     : base(string.Format("{0}不支持{1},Filed:{2}", valueType.ToString(), operate, filedName))
 {
 }
Beispiel #7
0
 public FieldValueTypeNotSupportValueCategroyException(string filedName, JFieldType valueType, JValueCategroy sourceValueCategroy)
     : base(string.Format("{0}不支持{1},Filed:{2}", valueType.ToString(), sourceValueCategroy.ToString(), filedName))
 {
 }
Beispiel #8
0
 private NotSupportedException GetException(string filedName, JFieldType valueType, JValueCategroy sourceValueCategroy)
 {
     throw new NotSupportedException(string.Format("{0}不支持{1},Filed:{2}", valueType.ToString(), sourceValueCategroy.ToString(), filedName));
 }
Beispiel #9
0
 public FieldValueTypeNotSupportValueCategroyException(string filedName, JFieldType valueType, JValueCategroy sourceValueCategroy)
     : base(string.Format("{0}不支持{1},Filed:{2}", valueType.ToString(), sourceValueCategroy.ToString(), filedName))
 {
 }
Beispiel #10
0
 private string GetFileValueFormat(JFieldType valueType)
 {
     switch (valueType)
     {
         case JFieldType.Numeric: return NumericFieldValueFormat + ",";
         case JFieldType.String: return StringFieldValueFormat + ",";
         case JFieldType.DateTime: return DateTimeFieldValueFormat + ",";
         default: return StringFieldValueFormat;
     }
 }
Beispiel #11
0
 private NotSupportedException GetException(string filedName, JFieldType valueType, JValueCategroy sourceValueCategroy)
 {
     throw new NotSupportedException(string.Format("{0}不支持{1},Filed:{2}", valueType.ToString(), sourceValueCategroy.ToString(), filedName));
 }
Beispiel #12
0
 public FieldValueTypeNotSupportOperatorException(string filedName, JFieldType valueType, string operate)
     : base(string.Format("{0}不支持{1},Filed:{2}", valueType.ToString(), operate, filedName))
 {
 }
Beispiel #13
0
 public JOperateNum(string fieldName, JFieldType valueType)
     : this()
 {
     this.FieldName = fieldName;
     this.ValueType = valueType;
     this.Values = new List<object>();
 }