public ControlChangedCommand(IStudioControl control) { if (control == null) throw new ArgumentNullException(nameof(control)); Control = control; }
public ControlOpenedCommand(IStudioControl control, bool isMainWindow) { if (control == null) throw new ArgumentNullException(nameof(control)); Control = control; IsMainWindow = isMainWindow; }
public ControlChangedCommand(IStudioControl control) { if (control == null) { throw new ArgumentNullException(nameof(control)); } Control = control; }
public BindCommand(T source, IStudioControl control = null) { if (source == null) { throw new ArgumentNullException(nameof(source)); } Source = source; Control = control; }
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); }
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); }
public RequestBindSource(IStudioControl control) { Control = control; }
public BindConnectorCommand(IConnector source, IStudioControl control = null) : base(source, control) { }
public BindStrategyCommand(StrategyContainer source, IStudioControl control = null) : base(source, control) { }
public bool CheckControl(IStudioControl control) { //если не задан контрол, то считаем, что привязать страегию надо для всех контролов return(Control == control); }
public static void SetVisibility <T>(this Group group, IStudioControl ctrl) { group.Visibility = ctrl is T ? Visibility.Visible : Visibility.Collapsed; }
private void RaiseBindStrategy(IStudioControl control = null) { new BindStrategyCommand(Strategy, control).SyncProcess(Strategy); }