示例#1
0
        public bool CloneFrom(CSmartStruct Value)
        {
            if (Value.GetData() == null)
            {
                return(false);
            }

            Destory();
            m_pData      = new byte[Value.m_DataLen];
            m_StartIndex = 0;
            m_DataLen    = Value.m_DataLen;
            Array.Copy(Value.m_pData, Value.m_StartIndex, m_pData, m_StartIndex, m_DataLen);
            return(true);
        }
示例#2
0
        public bool AddMember(ushort ID, CSmartStruct Value)
        {
            uint BufferSize = 0;
            int  StartIndex = PrepareMember(ref BufferSize);

            if (StartIndex >= 0)
            {
                CSmartValue SmartValue = new CSmartValue();
                if (SmartValue.Attach(m_pData, (uint)StartIndex, BufferSize, CSmartValue.SMART_VALUE_TYPE.VT_STRUCT))
                {
                    if (SmartValue.SetValue(Value))
                    {
                        return(FinishMember(ID, SmartValue.GetDataLen()));
                    }
                }
            }
            return(false);
        }
示例#3
0
 public CSmartStruct(CSmartStruct Struct)
 {
     m_StartIndex = 0;
     m_DataLen    = 0;
     Attach(Struct.m_pData, Struct.m_StartIndex, Struct.m_DataLen, false);
 }