예제 #1
0
        protected override void ProcessRecord()
        {
            var ctl = new PsLink();

            SetControlProps(ctl);

            ctl.Value   = Value;
            ctl.Url     = Url;
            ctl.Title   = Title;
            ctl.Size    = Size;
            ctl.OnClick = OnClick;

            if (NewWindow.IsPresent)
            {
                ctl.NewWindow = NewWindow.ToBool();
            }

            if (Bold.IsPresent)
            {
                ctl.Bold = Bold.ToBool();
            }

            if (Italic.IsPresent)
            {
                ctl.Italic = Italic.ToBool();
            }

            if (Pre.IsPresent)
            {
                ctl.Pre = Pre.ToBool();
            }

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

            if (Controls != null)
            {
                foreach (var control in Controls)
                {
                    ctl.Controls.Add(control);
                }
            }

            WriteObject(ctl);
        }
예제 #2
0
        protected override void ProcessRecord()
        {
            var control = new Text
            {
                Value        = Value,
                Color        = Color,
                BgColor      = BgColor,
                Border       = Border,
                BorderWidth  = BorderWidth,
                BorderColor  = BorderColor,
                BorderRadius = BorderRadius,
                BorderLeft   = BorderLeft,
                BorderRight  = BorderRight,
                BorderTop    = BorderTop,
                BorderBottom = BorderBottom,
            };

            SetControlProps(control);

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

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

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

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

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

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

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

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

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

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

            WriteObject(control);
        }