コード例 #1
0
        //ATTENDEE;MEMBER="mailto:[email protected]":mailto:[email protected]
        //ATTENDEE;DELEGATED-FROM="mailto:[email protected]":mailto:[email protected]
        //ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Henry Cabot:mailto:[email protected]
        //ATTENDEE;ROLE=REQ-PARTICIPANT;DELEGATED-FROM="mailto:[email protected]";PARTSTAT=ACCEPTED;CN=Jane Doe:mailto:[email protected]
        //ATTENDEE;CN=John Smith;DIR="ldap://example.com:6666/o=ABC%20Industries,c=US???(cn=Jim%20Dolittle)"(cn=Jim%20Dolittle)":mailto:[email protected]
        //ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;DELEGATED-FROM="mailto:[email protected]";CN=Henry Cabot:mailto:[email protected]
        //ATTENDEE;ROLE=NON-PARTICIPANT;PARTSTAT=DELEGATED;DELEGATED-TO="mailto:[email protected]";CN=The Big Cheese:mailto:[email protected]
        //ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Jane Doe:mailto:[email protected]
        //ATTENDEE;SENT-BY=mailto:[email protected];CN=John Smith:mailto:[email protected]

        public override ComponentLine BuildLine()
        {
            List <ElementPart> parts = new List <ElementPart>();

            parts.Add(UserType.BuildElementPart());
            parts.Add(UserType.BuildElementPart());
            parts.Add(Role.BuildElementPart());
            parts.Add(PartStat.BuildElementPart());
            if (MemberGroup == null)
            {
                parts.Add(new ElementPart("MEMBER", @"""" + MemberGroup + @""""));
            }
            parts.Add(new ElementPart("SENT-BY", SendBy));
            parts.Add(new ElementPart("DELEGATED-FROM", DelegatedFrom));
            parts.Add(new ElementPart("RSVP", ReplyRequested));
            parts.Add(new ElementPart("DIR", @"""" + DirUrl + @""""));
            parts.Add(new ElementPart("", AttendeeMailAddress, true));

            var filtered = parts.Where(w => !string.IsNullOrEmpty(w.Value)).Select(h => h.ToString()).Join(";");


            return(new ComponentLine("ATTENDEE;", filtered));
        }