Exemple #1
0
        public Group ToSDKGroup()
        {
            if (sdkGroup != null)
            {
                return(sdkGroup);
            }
            else
            {
                GroupBuilder builder = GroupBuilder.NewGroup(apiGroup.Name)
                                       .WithEmail(apiGroup.Email);

                if (apiGroup.EmailMembers)
                {
                    builder.WithIndividualMemberEmailing();
                }
                else
                {
                    builder.WithoutIndividualMemberEmailing();
                }

                if (apiGroup.Id != null)
                {
                    builder.WithId(new GroupId(apiGroup.Id));
                }

                foreach (Silanis.ESL.API.GroupMember apiGroupMember in apiGroup.Members)
                {
                    GroupMember sdkGroupMember = new GroupMemberConverter(apiGroupMember).ToSDKGroupMember();
                    builder.WithMember(sdkGroupMember);
                }

                return(builder.Build());
            }
        }
        public Group ToSDKGroup()
        {
            if (sdkGroup != null)
            {
                return sdkGroup;
            }
            else
            {
                GroupBuilder builder = GroupBuilder.NewGroup(apiGroup.Name)
                    .WithEmail(apiGroup.Email);

                if (apiGroup.EmailMembers.HasValue)
                {
                    if (apiGroup.EmailMembers.Value)
                        builder.WithIndividualMemberEmailing();
                    else
                        builder.WithoutIndividualMemberEmailing();
                }

                if (apiGroup.Id != null)
                {
                    builder.WithId(new GroupId(apiGroup.Id));
                }

                foreach (Silanis.ESL.API.GroupMember apiGroupMember in apiGroup.Members)
                {
                    GroupMember sdkGroupMember = new GroupMemberConverter(apiGroupMember).ToSDKGroupMember();
                    builder.WithMember(sdkGroupMember);
                }

                return builder.Build();
            }
        }