コード例 #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);
        }