protected override void ProcessRecord()
        {
            var control = new PsDatePicker();

            SetControlProps(control);

            control.Label       = Label;
            control.Value       = Value;
            control.Placeholder = Placeholder;
            control.OnChange    = OnChange;

            if (AllowTextInput.IsPresent)
            {
                control.AllowTextInput = AllowTextInput.ToBool();
            }

            if (Required.IsPresent)
            {
                control.Required = Required.ToBool();
            }

            if (Underlined.IsPresent)
            {
                control.Underlined = Underlined.ToBool();
            }

            if (Borderless.IsPresent)
            {
                control.Borderless = Borderless.ToBool();
            }

            WriteObject(control);
        }
Example #2
0
        public override void Serialize(ref string xml, int indentLevel)
        {
            string indent = "";

            for (int indentIdx = 0; indentIdx < indentLevel; ++indentIdx)
            {
                indent += " ";
            }

            xml += string.Format("{0}{1}{2}", indent, "<Element>", Environment.NewLine);

            base.Serialize(ref xml, indentLevel + 1);

            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<GumpLink>", System.Web.HttpUtility.HtmlEncode(GumpLink), "</GumpLink>", Environment.NewLine);
            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<WebColor>", System.Web.HttpUtility.HtmlEncode(WebColor), "</WebColor>", Environment.NewLine);
            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<Text>", System.Web.HttpUtility.HtmlEncode(Text), "</Text>", Environment.NewLine);

            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<Underlined>", Underlined.ToString(), "</Underlined>", Environment.NewLine);
            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<Italicized>", Italicized.ToString(), "</Italicized>", Environment.NewLine);
            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<Bold>", Bold.ToString(), "</Bold>", Environment.NewLine);

            xml += string.Format("{0}{1}{2}{3}{4}", indent, "<FontSize>", (int)FontSize, "</FontSize>", Environment.NewLine);

            xml += string.Format("{0}{1}{2}", indent, "</Element>", Environment.NewLine);
        }
        protected override void ProcessRecord()
        {
            var control = new PsTextBox();

            SetControlProps(control);

            control.Label        = Label;
            control.Value        = Value;
            control.Placeholder  = Placeholder;
            control.ErrorMessage = ErrorMessage;
            control.Description  = Description;
            control.Prefix       = Prefix;
            control.Suffix       = Suffix;
            control.Icon         = Icon;
            control.IconColor    = IconColor;
            control.OnChange     = OnChange;

            if (Align.HasValue)
            {
                control.Align = Align.Value;
            }

            if (Multiline.IsPresent)
            {
                control.Multiline = Multiline.ToBool();
            }

            if (Password.IsPresent)
            {
                control.Password = Password.ToBool();
            }

            if (Required.IsPresent)
            {
                control.Required = Required.ToBool();
            }

            if (ReadOnly.IsPresent)
            {
                control.ReadOnly = ReadOnly.ToBool();
            }

            if (AutoAdjustHeight.IsPresent)
            {
                control.AutoAdjustHeight = AutoAdjustHeight.ToBool();
            }

            if (Underlined.IsPresent)
            {
                control.Underlined = Underlined.ToBool();
            }

            if (Borderless.IsPresent)
            {
                control.Borderless = Borderless.ToBool();
            }

            WriteObject(control);
        }
        protected override void ProcessRecord()
        {
            var control = new PsSearchBox();

            SetControlProps(control);

            control.Value       = Value;
            control.Placeholder = Placeholder;
            control.Icon        = Icon;
            control.IconColor   = IconColor;
            control.OnSearch    = OnSearch;
            control.OnClear     = OnClear;
            control.OnChange    = OnChange;

            if (Underlined.IsPresent)
            {
                control.Underlined = Underlined.ToBool();
            }

            WriteObject(control);
        }