Ejemplo n.º 1
0
        protected override void ProcessRecord()
        {
            var ctl = new PsDialog();

            SetControlProps(ctl);

            ctl.OnDismiss = OnDismiss;
            ctl.Title     = Title;
            ctl.SubText   = SubText;
            ctl.MaxWidth  = MaxWidth;

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

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

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

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

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

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

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

            WriteObject(ctl);
        }
Ejemplo n.º 2
0
        protected override void ProcessRecord()
        {
            var control = new PsPanel();

            SetControlProps(control);

            control.OnDismiss = OnDismiss;
            control.Title     = Title;

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

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

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

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

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

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

            if (FooterControls != null)
            {
                foreach (var childControl in FooterControls)
                {
                    control.FooterControls.Add(childControl);
                }
            }

            WriteObject(control);
        }