public void CreateAttachmentTableIfNotExist() { CreateSubnodeBTreeIfNotExist(); Subnode subnode = SubnodeBTree.GetSubnode((uint)InternalNodeName.NID_ATTACHMENT_TABLE); if (subnode == null) { PSTNode template = this.File.GetNode(InternalNodeName.NID_ATTACHMENT_TABLE); NodeID nodeID = new NodeID((uint)InternalNodeName.NID_ATTACHMENT_TABLE); SubnodeBTree.InsertSubnodeEntry(nodeID, template.DataTree, null); File.BlockBTree.IncrementBlockEntryReferenceCount(template.DataTree.RootBlock.BlockID); } }
public static AttachmentObject CreateNewAttachmentObject(PSTFile file, SubnodeBTree subnodeBTree) { PropertyContext pc = PropertyContext.CreateNewPropertyContext(file); pc.SaveChanges(); NodeID pcNodeID = file.Header.AllocateNextNodeID(NodeTypeName.NID_TYPE_ATTACHMENT); subnodeBTree.InsertSubnodeEntry(pcNodeID, pc.DataTree, pc.SubnodeBTree); Subnode subnode = new Subnode(file, pcNodeID, pc.DataTree, pc.SubnodeBTree); return(new AttachmentObject(subnode)); }
private void CreateSubnodeForRows() { if (m_subnodeBTree == null) { m_subnodeBTree = new SubnodeBTree(this.File); } // We don't have to use a unique node ID for a subnode, but we can. NodeID nodeID = File.Header.AllocateNextNodeID(NodeTypeName.NID_TYPE_LTP); // Data tree will be created when first row will be added m_subnodeRows = new Subnode(File, nodeID, null, null); m_subnodeBTree.InsertSubnodeEntry(nodeID, null, null); // update the Table Context Info structure to point to the new rows m_tcInfo.hnidRows = new HeapOrNodeID(m_subnodeRows.SubnodeID); UpdateTableContextInfo(); }
public void CreateRecipientsTableIfNotExist() { CreateSubnodeBTreeIfNotExist(); Subnode subnode = SubnodeBTree.GetSubnode((uint)InternalNodeName.NID_RECIPIENT_TABLE); if (subnode == null) { PSTNode template = this.File.GetNode(InternalNodeName.NID_RECIPIENT_TABLE); NodeID nodeID = new NodeID((uint)InternalNodeName.NID_RECIPIENT_TABLE); SubnodeBTree.InsertSubnodeEntry(nodeID, template.DataTree, null); File.BlockBTree.IncrementBlockEntryReferenceCount(template.DataTree.RootBlock.BlockID); this.RecipientsTable.AddPropertyColumnIfNotExist(PropertyID.PidTagRecipientDisplayName, PropertyTypeName.PtypString); this.RecipientsTable.AddPropertyColumnIfNotExist(PropertyID.PidTagRecipientEntryId, PropertyTypeName.PtypBinary); this.RecipientsTable.AddPropertyColumnIfNotExist(PropertyID.PidTagRecipientFlags, PropertyTypeName.PtypInteger32); this.RecipientsTable.AddPropertyColumnIfNotExist(PropertyID.PidTagRecipientTrackStatus, PropertyTypeName.PtypInteger32); } }
public static ModifiedAppointmentInstance CreateNewModifiedInstance(PSTFile file, SubnodeBTree attachmentSubnodeBTree) { PropertyContext pc = PropertyContext.CreateNewPropertyContext(file); pc.SetStringProperty(PropertyID.PidTagMessageClass, RecurringAppointmentExceptionMessageClass); pc.SetDateTimeProperty(PropertyID.PidTagCreationTime, DateTime.UtcNow); pc.SetDateTimeProperty(PropertyID.PidTagLastModificationTime, DateTime.UtcNow); // PidTagSearchKey is apparently a GUID pc.SetBytesProperty(PropertyID.PidTagSearchKey, LittleEndianConverter.GetBytes(Guid.NewGuid())); pc.SaveChanges(); NodeID subnodeID = file.Header.AllocateNextNodeID(NodeTypeName.NID_TYPE_NORMAL_MESSAGE); attachmentSubnodeBTree.InsertSubnodeEntry(subnodeID, pc.DataTree, pc.SubnodeBTree); Subnode subnode = new Subnode(file, subnodeID, pc.DataTree, pc.SubnodeBTree); return(new ModifiedAppointmentInstance(subnode)); }