コード例 #1
0
        protected override void ProcessRecord()
        {
            var ctl = new NavItem
            {
                Key       = Key,
                Text      = Text,
                Url       = Url,
                Icon      = Icon,
                IconColor = IconColor
            };

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

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

            if (SubItems != null)
            {
                foreach (var subItem in SubItems)
                {
                    ctl.SubItems.Add(subItem);
                }
            }

            SetControlProps(ctl);

            WriteObject(ctl);
        }
コード例 #2
0
        protected override void ProcessRecord()
        {
            var ctl = new PsButton();

            SetControlProps(ctl);

            ctl.Text          = Text;
            ctl.SecondaryText = SecondaryText;
            ctl.Url           = Url;
            ctl.Title         = Title;
            ctl.Icon          = Icon;
            ctl.IconColor     = IconColor;
            ctl.OnClick       = OnClick;

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

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

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

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

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

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

            if (MenuItems != null)
            {
                foreach (var menuItem in MenuItems)
                {
                    ctl.MenuItems.Add(menuItem);
                }
            }

            WriteObject(ctl);
        }
コード例 #3
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);
        }
コード例 #4
0
        protected override void ProcessRecord()
        {
            var ctl = new PsMenuItem();

            SetControlProps(ctl);

            ctl.Text          = Text;
            ctl.SecondaryText = SecondaryText;
            ctl.Url           = Url;
            ctl.Icon          = Icon;
            ctl.IconColor     = IconColor;
            ctl.OnClick       = OnClick;

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

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

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

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

            if (SubMenuItems != null)
            {
                foreach (var subMenuItem in SubMenuItems)
                {
                    ctl.SubMenuItems.Add(subMenuItem);
                }
            }

            WriteObject(ctl);
        }