コード例 #1
0
ファイル: ContactService.cs プロジェクト: feimorpheusma/MWS
        private void GetGroupContact(listType listGroup, ContactItem contctParent)
        {
            IContactService cntService = this.serviceManager.ContactService;
            Group           group      = null;

            if (listGroup != null && listGroup.name != null)
            {
                string strGroupDisName = listGroup.name;
                if (listGroup.displayname != null)
                {
                    strGroupDisName = listGroup.displayname.Value;
                }
                string strUil = UriUtils.GetValidSipUri(listGroup.name);
                group = new Group(listGroup.name, strGroupDisName, strUil, false, contctParent);
                cntService.AddGroup(group, contctParent);
                foreach (entryType entry in listGroup.EntryTypes)
                {
                    Person psContact = this.EntryToContact(entry, group);
                    cntService.AddPerson2Group(group, psContact);
                }
            }
            foreach (listType list in listGroup.ListTypeLists)
            {
                if (list != null && list.name != null)
                {
                    if (group != null)
                    {
                        this.GetGroupContact(list, group);
                    }
                }
            }
        }