public Recipient(TCRowMatrixData row) { foreach (var exProp in row) { switch (exProp.ID) { case 0x0c15: this.Type = (RecipientType)BitConverter.ToUInt32(exProp.Data, 0); break; case 0x0e0f: this.Responsibility = exProp.Data[0] == 0x01; break; case 0x0ff9: this.Tag = exProp.Data; break; case 0x0ffe: this.ObjType = (PSTEnums.ObjectType)BitConverter.ToUInt32(exProp.Data, 0); break; case 0x0fff: this.EntryID = new EntryID(exProp.Data); break; case 0x3001: this.DisplayName = Encoding.Unicode.GetString(exProp.Data); break; case 0x3002: this.EmailAddressType = Encoding.Unicode.GetString(exProp.Data); break; case 0x3003: this.EmailAddress = Encoding.Unicode.GetString(exProp.Data); break; default: break; } } }
public Attachment(bool unicode, TCRowMatrixData row) { foreach (var prop in row) { SetProperty(unicode, prop); } }
public Attachment(TCRowMatrixData row) { foreach (var exProp in row) { switch (exProp.ID) { case 0x0e20: this.Size = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3704: if (exProp.Data != null) { this.Filename = Encoding.Unicode.GetString(exProp.Data); } break; case 0x3705: this.Method = (AttachmentMethod)BitConverter.ToUInt32(exProp.Data, 0); break; case 0x370b: this.RenderingPosition = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3714: var flags = BitConverter.ToUInt32(exProp.Data, 0); this.InvisibleInHTML = (flags & 0x1) != 0; this.InvisibleInRTF = (flags & 0x02) != 0; this.RenderedInBody = (flags & 0x04) != 0; break; case 0x67F2: this.LTPRowID = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x67F3: this.LTPRowVer = BitConverter.ToUInt32(exProp.Data, 0); break; default: break; } } }
public Recipient(TCRowMatrixData row) { foreach (var exProp in row) { var data = exProp.Data ?? new byte[0]; switch (exProp.ID) { case MessageProperty.RecipientType: Type = (RecipientType)BitConverter.ToUInt32(data, 0); break; case MessageProperty.RecipientResponsibility: Responsibility = data.Any() ? data[0] == 0x01 : false; break; case MessageProperty.RecordKey: Tag = data; break; case MessageProperty.RecipientObjType: ObjType = (PSTEnums.ObjectType)BitConverter.ToUInt32(data, 0); break; case MessageProperty.RecipientEntryID: EntryID = new EntryID(data); break; case MessageProperty.DisplayName: DisplayName = Encoding.Unicode.GetString(data); break; case MessageProperty.AddressType: EmailAddressType = Encoding.Unicode.GetString(data); break; case MessageProperty.AddressName: EmailAddress = Encoding.Unicode.GetString(data); break; default: break; } } }
public Recipient(bool unicode, TCRowMatrixData row) { foreach (var exProp in row) { if (exProp.Data == null) { continue; } switch (exProp.ID) { case MessageProperty.RecipientType: Type = exProp.Data.Length > 0 ? (RecipientType)BitConverter.ToUInt32(exProp.Data, 0) : RecipientType.FROM; break; case MessageProperty.RecipientResponsibility: Responsibility = exProp.Data.Length > 0 ? exProp.Data[0] == 0x01 : false; break; case MessageProperty.RecipientObjType: ObjType = exProp.Data.Length >= 4 ? (PSTEnums.ObjectType)BitConverter.ToUInt32(exProp.Data, 0) : PSTEnums.ObjectType.MAIL_USER; break; case MessageProperty.RecipientEntryID: EntryID = exProp.Data != null && (exProp.Data.Length >= EntryID.Size) ? new EntryID(exProp.Data) : null; break; case MessageProperty.DisplayName: DisplayName = unicode ? Encoding.Unicode.GetString(exProp.Data) : Encoding.ASCII.GetString(exProp.Data); break; case MessageProperty.AddressType: EmailAddressType = unicode ? Encoding.Unicode.GetString(exProp.Data) : Encoding.ASCII.GetString(exProp.Data); break; case MessageProperty.AddressName: EmailAddress = unicode ? Encoding.Unicode.GetString(exProp.Data) : Encoding.ASCII.GetString(exProp.Data); break; default: break; } } }
public Attachment(TCRowMatrixData row) { foreach (var exProp in row) { switch (exProp.ID) { case 0x0e20: this.Size = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3704: if (exProp.Data != null) this.Filename = Encoding.Unicode.GetString(exProp.Data); break; case 0x3705: this.Method = (AttachmentMethod) BitConverter.ToUInt32(exProp.Data, 0); break; case 0x370b: this.RenderingPosition = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3714: var flags = BitConverter.ToUInt32(exProp.Data, 0); this.InvisibleInHTML = (flags & 0x1) != 0; this.InvisibleInRTF = (flags & 0x02) != 0; this.RenderedInBody = (flags & 0x04) != 0; break; case 0x67F2: this.LTPRowID = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x67F3: this.LTPRowVer = BitConverter.ToUInt32(exProp.Data, 0); break; default: break; } } }
public TCRowMatrix(TableContext tableContext, BTH heap) { this.Rows = new List<TCRowMatrixData>(); this.RowXREF = new Dictionary<uint, TCRowMatrixData>(); this.TableContext = tableContext; var rowMatrixHNID = this.TableContext.TCHeader.RowMatrixLocation; if (rowMatrixHNID == 0) return; if ((rowMatrixHNID & 0x1F) == 0)//HID { this.TCRMData = new List<BlockDataDTO>{ new BlockDataDTO { Data = this.TableContext.HeapNode.GetHIDBytes(new HID(BitConverter.GetBytes(rowMatrixHNID))).Data }}; } else { if (this.TableContext.HeapNode.HeapSubNode.ContainsKey(rowMatrixHNID)) this.TCRMData = this.TableContext.HeapNode.HeapSubNode[rowMatrixHNID].NodeData; else { var tempSubNodes = new Dictionary<ulong, NodeDataDTO>(); foreach(var nod in this.TableContext.HeapNode.HeapSubNode) tempSubNodes.Add(nod.Key & 0xffffffff, nod.Value); this.TCRMData = tempSubNodes[rowMatrixHNID].NodeData; } } //this.TCRMSubNodeData = this.TableContext.HeapNode.HeapSubNode[]; var rowSize = this.TableContext.TCHeader.EndOffsetCEB; //var rowPerBlock = (8192 - 16)/rowSize; foreach(var row in this.TableContext.RowIndexBTH.Properties) { var rowIndex = BitConverter.ToUInt32(row.Value.Data, 0); var blockTrailerSize = 16; var maxBlockSize = 8192 - blockTrailerSize; var recordsPerBlock = maxBlockSize/rowSize; var blockIndex = (int)rowIndex/recordsPerBlock; var indexInBlock = rowIndex%recordsPerBlock; var curRow = new TCRowMatrixData(this.TCRMData[blockIndex].Data, this.TableContext, heap, (int) indexInBlock*rowSize); this.RowXREF.Add(BitConverter.ToUInt32(row.Key, 0), curRow); this.Rows.Add(curRow); } /* uint curIndex = 0; foreach (var dataBlock in this.TCRMData) { for(int i = 0;i + rowSize < dataBlock.Data.Length; i += rowSize) { var curRow = new TCRowMatrixData(dataBlock.Data, this.TableContext, i); this.RowXREF.Add(this.TableContext.ReverseRowIndex[curIndex], curRow); this.Rows.Add(curRow); curIndex++; } }*/ }