Beispiel #1
0
        public override void SetParamters(byte[] objParamters)
        {
            m_structAreaPara = new RuleExpression.AreaParameter();

            BinaryReader pParameter = new BinaryReader(new MemoryStream(objParamters));

            pParameter.BaseStream.Position = 0;

            int nCount1 = pParameter.ReadInt32();

            //解析字符串
            int nSize = sizeof(int);

            Byte[] bb = new byte[nCount1];
            pParameter.Read(bb, 0, nCount1);
            string para_str = Encoding.Default.GetString(bb);

            para_str.Trim();

            string[] strResult = para_str.Split('|');

            int i = 0;

            m_structAreaPara.strAlias  = strResult[i++];
            m_structAreaPara.strScript = strResult[i++];
            m_structAreaPara.strFtName = strResult[i++];

            m_structAreaPara.dbThreshold = pParameter.ReadDouble();

            int fieldLength = pParameter.ReadInt32();

            //解析字段名
            m_structAreaPara.fieldArray = new List <string>();
            if (fieldLength > 0)
            {
                Byte[] bb1 = new byte[fieldLength];
                pParameter.Read(bb1, 0, fieldLength);
                string strFields = Encoding.Default.GetString(bb1);

                strFields.Trim();

                string[] strResult1 = strFields.Split('|');


                for (int j = 0; j < strResult1.Length; j++)
                {
                    m_structAreaPara.fieldArray.Add(strResult1[j]);
                }
            }

            //取字段类型
            m_structAreaPara.fieldTypeArray = new ArrayList();
            int fieldNum = pParameter.ReadInt32();
            int fType    = -1;

            if (fieldNum > 0)
            {
                for (int f = 0; f < fieldNum; f++)
                {
                    fType = pParameter.ReadInt32();
                    m_structAreaPara.fieldTypeArray.Add(fType);
                }
            }
        }
Beispiel #2
0
        public override void SetParamters(byte[] objParamters)
        {
            m_structAreaPara = new RuleExpression.AreaParameter();

            BinaryReader pParameter = new BinaryReader(new MemoryStream(objParamters));
            pParameter.BaseStream.Position = 0;

            int nCount1 = pParameter.ReadInt32();

            //�����ַ���
            int nSize = sizeof(int);
            Byte[] bb = new byte[nCount1];
            pParameter.Read(bb, 0, nCount1);
            string para_str = Encoding.Default.GetString(bb);
            para_str.Trim();

            string[] strResult = para_str.Split('|');

            int i = 0;
            m_structAreaPara.strAlias = strResult[i++];
            m_structAreaPara.strScript = strResult[i++];
            m_structAreaPara.strFtName = strResult[i++];

            m_structAreaPara.dbThreshold = pParameter.ReadDouble();

            int fieldLength = pParameter.ReadInt32();

            //�����ֶ���
            m_structAreaPara.fieldArray = new List<string>();
            if (fieldLength > 0)
            {
                Byte[] bb1 = new byte[fieldLength];
                pParameter.Read(bb1, 0, fieldLength);
                string strFields = Encoding.Default.GetString(bb1);

                strFields.Trim();

                string[] strResult1 = strFields.Split('|');

                for (int j = 0; j < strResult1.Length; j++)
                {
                    m_structAreaPara.fieldArray.Add(strResult1[j]);
                }
            }

            //ȡ�ֶ�����
            m_structAreaPara.fieldTypeArray = new ArrayList();
            int fieldNum = pParameter.ReadInt32();
            int fType = -1;
            if (fieldNum > 0)
            {
                for (int f = 0; f < fieldNum; f++)
                {
                    fType = pParameter.ReadInt32();
                    m_structAreaPara.fieldTypeArray.Add(fType);
                }
            }
        }