示例#1
0
        public SearchUpdateDescriptor(byte[] buffer, int offset)
        {
            wFlags   = (SearchUpdateDescriptorFlags)LittleEndianConverter.ToUInt16(buffer, offset + 0);
            wSUDType = (SearchUpdateDescriptorType)LittleEndianConverter.ToUInt16(buffer, offset + 2);
            switch (wSUDType)
            {
            case SearchUpdateDescriptorType.SUDT_FLD_ADD:
            case SearchUpdateDescriptorType.SUDT_FLD_MOV:
                SUDData = new SearchUpdateDescriptorFolderAdded(buffer, offset + 4);
                break;

            case SearchUpdateDescriptorType.SUDT_FLD_MOD:
            case SearchUpdateDescriptorType.SUDT_FLD_DEL:
                SUDData = new SearchUpdateDescriptorFolderModified(buffer, offset + 4);
                break;

            case SearchUpdateDescriptorType.SUDT_MSG_ADD:
            case SearchUpdateDescriptorType.SUDT_MSG_MOD:
            case SearchUpdateDescriptorType.SUDT_MSG_DEL:
                SUDData = new SearchUpdateDescriptorMessageAdded(buffer, offset + 4);
                break;

            default:
                throw new NotImplementedException("Unsupported SUD type");
            }
        }
示例#2
0
 public SearchUpdateDescriptor(SearchUpdateDescriptorFlags flags, SearchUpdateDescriptorType type, SearchUpdateDescriptorData data)
 {
     wFlags   = flags;
     wSUDType = type;
     SUDData  = data;
 }