private static void AddRuleCondition(IList<TaggedPropertyValue> list, string mailSubjectContent)
{
TaggedPropertyValue pidTagRuleCondition = new TaggedPropertyValue();
PropertyTag pidTagRuleConditionPropertyTag = new PropertyTag
{
PropertyId = (ushort)PropertyId.PidTagRuleCondition,
PropertyType = (ushort)PropertyType.PtypRestriction
};
pidTagRuleCondition.PropertyTag = pidTagRuleConditionPropertyTag;
TaggedPropertyValue taggedProperty = new TaggedPropertyValue();
PropertyTag taggedPropertyPropertyTag = new PropertyTag
{
PropertyId = (ushort)PropertyId.PidTagSubject,
PropertyType = (ushort)PropertyType.PtypString
};
taggedProperty.PropertyTag = taggedPropertyPropertyTag;
taggedProperty.Value = Encoding.Unicode.GetBytes(mailSubjectContent + "\0");
pidTagRuleCondition.Value = GenerateContentRestriction(taggedProperty);
list.Add(pidTagRuleCondition);
}