Пример #1
0
        public override void SetParamters(byte[] objParamters)
        {
            BinaryReader pParameter = new BinaryReader(new MemoryStream(objParamters));

            if (m_pLayerPara != null)
            {
                m_pLayerPara = null;
            }
            m_pLayerPara = new RuleExpression.LRLayerCheckPara();

            pParameter.BaseStream.Position = 0;

            int nCount1 = pParameter.ReadInt32();

            m_pLayerPara.bIsNull        = Convert.ToBoolean(pParameter.ReadInt32());
            m_pLayerPara.bAttrubuteName = Convert.ToBoolean(pParameter.ReadInt32());
            m_pLayerPara.bLayerName     = Convert.ToBoolean(pParameter.ReadInt32());

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

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

            para_str.Trim();

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

            int i = 0;

            m_pLayerPara.strAlias  = strResult[i++];
            m_pLayerPara.strRemark = strResult[i++];

            m_pLayerPara.strLyrList = new List <string>();

            for (int j = i; j < strResult.Length; j++)
            {
                m_pLayerPara.strLyrList.Add(strResult[j]);
            }
        }
Пример #2
0
        public override void SetParamters(byte[] objParamters)
        {
            BinaryReader pParameter = new BinaryReader(new MemoryStream(objParamters));
            if (m_pLayerPara != null)
            {
                m_pLayerPara = null;
            }
            m_pLayerPara = new RuleExpression.LRLayerCheckPara();

            pParameter.BaseStream.Position = 0;

            int nCount1 = pParameter.ReadInt32();
            m_pLayerPara.bIsNull = Convert.ToBoolean(pParameter.ReadInt32());
            m_pLayerPara.bAttrubuteName = Convert.ToBoolean(pParameter.ReadInt32());
            m_pLayerPara.bLayerName = Convert.ToBoolean(pParameter.ReadInt32());

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

            para_str.Trim();

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

            int i = 0;
            m_pLayerPara.strAlias = strResult[i++];
            m_pLayerPara.strRemark = strResult[i++];

            m_pLayerPara.strLyrList = new List<string>();

            for (int j = i; j < strResult.Length; j++)
            {
                m_pLayerPara.strLyrList.Add(strResult[j]);
            }
        }