public ConnectionDragBuild(DragControllerBuilder builder, int priority, ConnectionItemsControl creatingConnectionItemsControl) { Priority = priority; _builder = builder; CreatingConnectionItemsControl = creatingConnectionItemsControl; // クリックしたノードの中でプラグがクリックされているものを集める _clickedPlugs = get_mouse_over_plugs(_builder.SelectedNodes, out _sourcePlugType); }
public ConnectionCreateControllerSetupArgs( INodeControl[] nodes, IPlugControl[] sourcePlugs, ConnectionItemsControl connectionItemsControl, ICommand connectionCreated, ICommand startConnectionCreated, ICommand cancelConnectionCreated, SourcePlugType sourcePlugType) { Nodes = nodes; SourcePlugs = sourcePlugs; CreatingConnectionItemsControl = connectionItemsControl; ConnectionCreated = connectionCreated; StartConnectionCreated = startConnectionCreated; CancelConnectionCreated = cancelConnectionCreated; SourcePlugType = sourcePlugType; }
public ConnectionCreateControllerSetupArgs( IInputElement baseControl, MouseEventArgs args, NodeControl[] nodes, PlugControl[] sourcePlugs, ConnectionItemsControl connectionItemsControl, ICommand connectionCreated, ICommand startConnectionCreated, SourcePlugType sourcePlugType) { Args = args; BaseControl = baseControl; Nodes = nodes; SourcePlugs = sourcePlugs; CreatingConnectionItemsControl = connectionItemsControl; ConnectionCreated = connectionCreated; StartConnectionCreated = startConnectionCreated; SourcePlugType = sourcePlugType; }
//! コンストラクタ / ドラッグ開始 public ConnectionCreateController(ConnectionCreateControllerSetupArgs setupArgs) { _nodes = setupArgs.Nodes; _sourcePlugs = setupArgs.SourcePlugs .Select(x => x.DataContext) .OfType <IPlugDataContext>() .ToArray(); _plugToConnectionDataContexts = _sourcePlugs .ToDictionary(x => x, x => x.StartConnection()); _connections = _plugToConnectionDataContexts .Select(x => x.Value) .ToArray(); _connectionItemsControl = setupArgs.CreatingConnectionItemsControl; _connectionCreated = setupArgs.ConnectionCreated; _connectionCreateCancel = setupArgs.CancelConnectionCreated; _sourcePlugType = setupArgs.SourcePlugType; _connectionStart = setupArgs.StartConnectionCreated; }
//! コンストラクタ / ドラッグ開始 public ConnectionCreateController(ConnectionCreateControllerSetupArgs setupArgs) { _nodes = setupArgs.Nodes; _inputElement = setupArgs.BaseControl; _sourcePlugs = setupArgs.SourcePlugs .Select(x => x.DataContext) .OfType <IPlugDataContext>() .ToArray(); _plugToConnectionDataContexts = _sourcePlugs .ToDictionary(x => x, x => x.StartConnection()); _connections = _plugToConnectionDataContexts .Select(x => x.Value) .ToArray(); _connectionItemsControl = setupArgs.CreatingConnectionItemsControl; _connectionCreated = setupArgs.ConnectionCreated; _sourcePlugType = setupArgs.SourcePlugType; setupArgs.StartConnectionCreated?.Execute(new StartCreateConnectionEventArgs(_sourcePlugs)); }