Beispiel #1
0
        protected override void EndProcessing()
        {
            var windowProps = Helpers.ToDictionary(WindowProperties);
            var tabProps    = Helpers.ToDictionary(TabControlProperties);

            var w = new TabbedCanvas(windowProps, tabProps);

            CanvasManager.Instance.Add(w);

            WriteObject(w);
        }
Beispiel #2
0
        internal ICanvas OpenCanvas()
        {
            var active = CanvasManager.Instance.GetActiveCanvas();

            if (!OpenNewCanvas && active != null)
            {
                return(active);
            }

            var windowProps = new Dictionary <string, object>();

            if (CanvasWidth.HasValue)
            {
                windowProps["Width"] = CanvasWidth.Value;
            }

            if (CanvasHeight.HasValue)
            {
                windowProps["Height"] = CanvasHeight.Value;
            }

            if (Topmost)
            {
                windowProps["Topmost"] = Topmost;
            }

            switch (CanvasStyle)
            {
            case CanvasStyle.Single:
                active = new SingleCanvas(windowProps);
                break;

            case CanvasStyle.Multiple:
                active = new MultipleCanvas(windowProps);
                break;

            case CanvasStyle.Tabbed:
                active = new TabbedCanvas(windowProps);
                break;

            default:
                throw new ApplicationException("Invalid CanvasStyle");
            }

            CanvasManager.Instance.Add(active);

            return(active);
        }