Пример #1
0
		public ControlChangedCommand(IStudioControl control)
		{
			if (control == null)
				throw new ArgumentNullException(nameof(control));

			Control = control;
		}
Пример #2
0
		public ControlOpenedCommand(IStudioControl control, bool isMainWindow)
		{
			if (control == null)
				throw new ArgumentNullException(nameof(control));

			Control = control;
			IsMainWindow = isMainWindow;
		}
Пример #3
0
        public ControlChangedCommand(IStudioControl control)
        {
            if (control == null)
            {
                throw new ArgumentNullException(nameof(control));
            }

            Control = control;
        }
Пример #4
0
        public BindCommand(T source, IStudioControl control = null)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            Source  = source;
            Control = control;
        }
Пример #5
0
        public ControlOpenedCommand(IStudioControl control, bool isMainWindow)
        {
            if (control == null)
            {
                throw new ArgumentNullException(nameof(control));
            }

            Control      = control;
            IsMainWindow = isMainWindow;
        }
        private IStudioControl OpenControl(StrategyInfo info)
        {
            IStudioControl ctrl = null;

            switch (StrategyInfo.Type)
            {
            case StrategyInfoTypes.SourceCode:
            case StrategyInfoTypes.Analytics:
                ctrl = OpenControl(info.Id.To <string>(), typeof(StrategyInfoCodeContent), info, () =>
                {
                    var c = new StrategyInfoCodeContent {
                        StrategyInfo = info
                    };

                    ConfigManager
                    .GetService <IStudioCommandService>()
                    .Bind(info.GetKey(), c);

                    return(c);
                });
                break;

            case StrategyInfoTypes.Diagram:
                ctrl = OpenControl(info.Id.To <string>(), typeof(DiagramPanel), info, () =>
                {
                    var c = new DiagramPanel {
                        StrategyInfo = info
                    };

                    ConfigManager
                    .GetService <IStudioCommandService>()
                    .Bind(info.GetKey(), c);

                    return(c);
                });
                break;

            case StrategyInfoTypes.Assembly:
            case StrategyInfoTypes.Terminal:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(ctrl);
        }
Пример #7
0
        public static object GetKey(this IStudioControl control)
        {
            var infoContent = control as StrategyInfoContent;

            if (infoContent != null)
            {
                return(infoContent.StrategyInfo);
            }

            var codeContent = control as StrategyInfoCodeContent;

            if (codeContent != null)
            {
                return(codeContent.StrategyInfo.GetKey());
            }

            var diagramContent = control as DiagramPanel;

            if (diagramContent != null)
            {
                return(diagramContent.StrategyInfo == null ? (object)diagramContent.Composition : diagramContent.StrategyInfo.GetKey());
            }

            var optimizatorContent = control as OptimizatorContent;

            if (optimizatorContent != null)
            {
                return(optimizatorContent.Strategy);
            }

            var strategyContent = control as StrategyContent;

            if (strategyContent != null)
            {
                return(strategyContent.Strategy);
            }

            return(null);
        }
Пример #8
0
		public RequestBindSource(IStudioControl control)
		{
			Control = control;
		}
Пример #9
0
 public RequestBindSource(IStudioControl control)
 {
     Control = control;
 }
Пример #10
0
 public BindConnectorCommand(IConnector source, IStudioControl control = null)
     : base(source, control)
 {
 }
Пример #11
0
 public BindStrategyCommand(StrategyContainer source, IStudioControl control = null)
     : base(source, control)
 {
 }
Пример #12
0
 public bool CheckControl(IStudioControl control)
 {
     //если не задан контрол, то считаем, что привязать страегию надо для всех контролов
     return(Control == control);
 }
Пример #13
0
 public static void SetVisibility <T>(this Group group, IStudioControl ctrl)
 {
     group.Visibility = ctrl is T ? Visibility.Visible : Visibility.Collapsed;
 }
Пример #14
0
 private void RaiseBindStrategy(IStudioControl control = null)
 {
     new BindStrategyCommand(Strategy, control).SyncProcess(Strategy);
 }