예제 #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);
 }