Example #1
0
        public static PSTFolder GetFolder(PSTNode node)
        {
            if (node.NodeID.nidType == NodeTypeName.NID_TYPE_NORMAL_FOLDER)
            {
                PropertyContext pc = node.PC;
                if (pc != null)
                {
                    string             containerClass = pc.GetStringProperty(PropertyID.PidTagContainerClass);
                    FolderItemTypeName itemType       = GetItemType(containerClass);
                    switch (itemType)
                    {
                    case FolderItemTypeName.Appointment:
                        return(new CalendarFolder(node));

                    case FolderItemTypeName.Note:
                        return(new MailFolder(node));

                    default:
                        return(new PSTFolder(node));
                    }
                }
                else
                {
                    throw new Exception("PC is null");
                }
            }
            else
            {
                throw new Exception("Node ID does not belong to a folder");
            }
        }
Example #2
0
        public static void CopyStringProperty(PropertyContext pc, TableContext tc, int rowIndex, PropertyID propertyID)
        {
            string value = pc.GetStringProperty(propertyID);

            if (value != null && tc.ContainsPropertyColumn(propertyID, PropertyTypeName.PtypString))
            {
                tc.SetStringProperty(rowIndex, propertyID, value);
            }
        }