Exemple #1
0
 public ByteStreamParserAttribute(
     string param_field_type,
     string length_field_name,
     bool bh = false,
     string customer_function = "")
 {
     bHead      = bh;
     field_type = param_field_type;
     field_customer_function = customer_function;
     how_to_set_len          = eHowtoSetLen.Accord_Property;
     property_name           = length_field_name;
 }
Exemple #2
0
 public ByteStreamParserAttribute(
     string param_field_type,
     eHowtoSetLen string_length_type,
     uint param_field_len = 0,
     bool bh = false,
     string customer_function = "")
 {
     bHead      = bh;
     field_type = param_field_type;
     field_len  = param_field_len;
     field_customer_function = customer_function;
     how_to_set_len          = string_length_type;
 }
Exemple #3
0
        private string property_name;           // 当通过属性指定占用字节长度是,需要指定属性名称,需要说明的一点是,对于Class这种可以是表达式,表达式是最简单的四则运算

        /// <summary>
        /// 指定特定长度
        /// </summary>
        /// <param name="param_field_type"></param>
        /// <param name="param_field_len"></param>
        /// <param name="bh"></param>
        /// <param name="customer_function"></param>
        public ByteStreamParserAttribute(
            string param_field_type,
            uint param_field_len = 0,
            bool bh = false,
            string customer_function = "")
        {
            bHead      = bh;
            field_type = param_field_type;
            field_len  = param_field_len;
            field_customer_function = customer_function;
            if (param_field_type == FieldType.Field_String)
            {
                how_to_set_len = eHowtoSetLen.Accord_0X7F;
            }
            else
            {
                how_to_set_len = eHowtoSetLen.Accord_Number;
            }
        }