private IStudioControl OpenControl(string id, Type ctrlType, object tag, Func <IStudioControl> getControl)
        {
            if (ctrlType == null)
            {
                throw new ArgumentNullException(nameof(ctrlType));
            }

            if (getControl == null)
            {
                throw new ArgumentNullException(nameof(getControl));
            }

            id = id.ToLowerInvariant();

            var wnd = _contents.SafeAdd(Tuple.Create(id, ctrlType), key =>
            {
                var docWnd = new ContentDocumentWindow
                {
                    Tag      = tag,
                    Control  = getControl(),
                    Name     = "Pane" + id.Replace("-", "") + ctrlType.Name,
                    CanClose = !(tag is StrategyInfo)
                };
                DockSite.DocumentWindows.Add(docWnd);

                return(docWnd);
            });

            ((DockingWindow)wnd).Activate();

            return(wnd.Control);
        }
예제 #2
0
        private TaskVisualSecurity ToVisualSecurity(HydraTaskSecurity security)
        {
            if (security == null)
            {
                throw new ArgumentNullException(nameof(security));
            }

            return(_visualSecurities.SafeAdd(security, key => new TaskVisualSecurity(key)));
        }