Microsoft.Protocols.TestSuites.MS_OXORULE.AdapterHelper.AddRuleCondition C# (CSharp) Method

AddRuleCondition() private static method

Add ruleCondition to the properties list.
private static AddRuleCondition ( IList list, string mailSubjectContent ) : void
list IList The properties list of a rule.
mailSubjectContent string The mail subject of the content restriction.
return void
        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);
        }