Ejemplo n.º 1
0
        public void Save()
        {
            bool flag = base.IsParameterSet("Id");

            using (DistributionList distributionList = this.GetDistributionList(new PropertyDefinition[0]))
            {
                if (base.IsParameterSet("dn"))
                {
                    string text = ((string)base.GetParameter("dn")).Trim();
                    if (text.Length > 256)
                    {
                        text = text.Substring(0, 256);
                    }
                    if (!string.Equals(distributionList.DisplayName, text))
                    {
                        distributionList.DisplayName = text;
                    }
                }
                if (base.IsParameterSet("notes"))
                {
                    string text2 = (string)base.GetParameter("notes");
                    if (text2 != null)
                    {
                        BodyConversionUtilities.SetBody(distributionList, text2, Markup.PlainText, base.UserContext);
                    }
                }
                distributionList.Clear();
                RecipientInfo[] array = (RecipientInfo[])base.GetParameter("Itms");
                EditDistributionListEventHandler.AddMembersToDL(distributionList, array, this.CheckDuplicateItems(array));
                Utilities.SaveItem(distributionList, flag);
                distributionList.Load();
                if (!flag)
                {
                    this.Writer.Write("<div id=itemId>");
                    this.Writer.Write(Utilities.GetIdAsString(distributionList));
                    this.Writer.Write("</div>");
                }
                this.Writer.Write("<div id=ck>");
                this.Writer.Write(distributionList.Id.ChangeKeyAsBase64String());
                this.Writer.Write("</div>");
                string text3 = EditDistributionListEventHandler.GetTextPropertyValue(distributionList, ContactBaseSchema.FileAs);
                if (string.IsNullOrEmpty(text3))
                {
                    text3 = LocalizedStrings.GetNonEncoded(-1576800949);
                }
                this.Writer.Write("<div id=fa>");
                Utilities.HtmlEncode(text3, this.Writer);
                this.Writer.Write("</div>");
                base.MoveItemToDestinationFolderIfInScratchPad(distributionList);
            }
        }