Exemplo n.º 1
0
        protected override void CreateChildControls()
        {
            this.Controls.Add(this.parametersPanel);
            RulePhrase[] phrases  = this.FilterConditions(this.RuleService.SupportedConditions);
            RulePhrase[] phrases2 = this.FilterActions(this.RuleService.SupportedActions);
            RulePhrase[] phrases3 = this.FilterExceptions(this.RuleService.SupportedExceptions);
            List <Type>  list     = new List <Type>();

            RuleEditor.GetRequiredFormlets(phrases, list);
            RuleEditor.GetRequiredFormlets(phrases2, list);
            RuleEditor.GetRequiredFormlets(phrases3, list);
            Panel panel = new Panel();

            panel.Style.Add(HtmlTextWriterStyle.Display, "none");
            foreach (Type type in list)
            {
                if (string.Equals(type.Name, "PeoplePicker", StringComparison.Ordinal))
                {
                    PeoplePicker peoplePicker = (PeoplePicker)Activator.CreateInstance(type);
                    peoplePicker.PreferOwaPicker = this.PreferOwaPicker;
                    peoplePicker.AllowTyping     = this.AllowTypingInPicker;
                    panel.Controls.Add(peoplePicker);
                }
                else
                {
                    panel.Controls.Add((Control)Activator.CreateInstance(type));
                }
            }
            this.Controls.Add(panel);
            this.Controls.Add(this.staticOptionsPanel);
            Panel panel2 = new Panel();

            panel2.CssClass         = "MoreOptionDiv";
            this.lnkMoreOption      = new HtmlAnchor();
            this.lnkMoreOption.HRef = "javascript:void(0);";
            this.lnkMoreOption.ID   = "btnMoreOption";
            this.lnkMoreOption.Attributes.Add("class", "MoreOptionLnk");
            this.lnkMoreOption.Controls.Add(new LiteralControl(Strings.RuleMoreOptions));
            panel2.Controls.Add(this.lnkMoreOption);
            this.Controls.Add(panel2);
            this.evenMoreOptionsPanel.CssClass = "hidden";
            this.Controls.Add(this.evenMoreOptionsPanel);
            base.CreateChildControls();
        }