protected Bus GetVerifyBus(CommandReference busReference) { Bus bus = System.GetBus(busReference.Index); LazyVerify(bus.InstanceId, busReference.InstanceId); return(bus); }
protected Signal GetVerifySignal(CommandReference signalReference) { Signal signal = System.GetSignal(signalReference.Index); LazyVerify(signal.InstanceId, signalReference.InstanceId); return(signal); }
public void ForwardCanExecuteChangedEvent() { bool canExecuteChangedCalled = false; TestCommand testCommand = new TestCommand(); CommandReference commandReference = new CommandReference { Command = testCommand }; commandReference.CanExecuteChanged += ((sender, eventArgs) => canExecuteChangedCalled = true); object canExecuteParameter = new object(); bool canExecute = commandReference.CanExecute(canExecuteParameter); Assert.IsTrue(canExecute); Assert.AreSame(canExecuteParameter, testCommand.CanExecuteParameter); testCommand.CanExecuteValue = false; testCommand.FireCanExecuteChanged(); Assert.IsTrue(canExecuteChangedCalled); canExecuteParameter = new object(); canExecute = commandReference.CanExecute(canExecuteParameter); Assert.IsFalse(canExecute); Assert.AreSame(canExecuteParameter, testCommand.CanExecuteParameter); commandReference.Command = null; }
public virtual void ReadXml(XmlReader reader) { reader.ReadStartElement("PortSignalCommand", Context.YttriumNamespace); _portRef = CommandReference.Deserialize("Port", reader); _signalRef = CommandReference.Deserialize("Signal", reader); reader.ReadEndElement(); }
public void Execute() { if(!BeginExecute()) return; _ref = Action(); EndExecute(); }
public virtual void ReadXml(XmlReader reader) { reader.ReadStartElement("PortIndexCommand", Context.YttriumNamespace); _index = int.Parse(reader.ReadElementString("Index")); _portRef = CommandReference.Deserialize("Port", reader); reader.ReadEndElement(); }
public virtual void ReadXml(XmlReader reader) { reader.ReadStartElement("PortBusCommand", Config.YttriumNamespace); _portRef = CommandReference.Deserialize("Port", reader); _busRef = CommandReference.Deserialize("Bus", reader); reader.ReadEndElement(); }
public virtual void PostCommandRemoveBus(CommandReference reference) { RemoveBusCommand cmd = new RemoveBusCommand(); cmd.BusReference = reference; PostCommand(cmd); }
protected Port GetVerifyPort(CommandReference portReference) { Port port = System.GetPort(portReference.Index); LazyVerify(port.InstanceId, portReference.InstanceId); return(port); }
public void CanExecuteShouldReturnFalseWhenEmpty() { CommandReference commandReference = new CommandReference(); bool canExecute = commandReference.CanExecute(null); Assert.IsFalse(canExecute); }
public virtual void PostCommandRemovePort(CommandReference reference, bool isolate) { RemovePortCommand cmd = new RemovePortCommand(); cmd.PortReference = reference; cmd.Isolate = isolate; PostCommand(cmd); }
public virtual void PostCommandPortDrivesSignalNoLonger(CommandReference port, int index) { PortUndriveSignalCommand cmd = new PortUndriveSignalCommand(); cmd.PortReference = port; cmd.Index = index; PostCommand(cmd); }
public virtual void PostCommandSignalDrivesPortNoLonger(CommandReference port, int index) { SignalUndrivePortCommand cmd = new SignalUndrivePortCommand(); cmd.PortReference = port; cmd.Index = index; PostCommand(cmd); }
public virtual void PostCommandBusDetachedFromPort(CommandReference port, int index) { BusUndrivePortCommand cmd = new BusUndrivePortCommand(); cmd.PortReference = port; cmd.Index = index; PostCommand(cmd); }
public virtual void PostCommandRemoveSignal(CommandReference reference, bool isolate) { RemoveSignalCommand cmd = new RemoveSignalCommand(); cmd.SignalReference = reference; cmd.Isolate = isolate; PostCommand(cmd); }
/// <summary> /// Initializes a new instance of the <see cref="T:SimpleRectangle"/> class. /// </summary> public PortShape(CommandReference reference) : base() { this.sysRef = reference; cIn = new List <Connector>(); cOut = new List <Connector>(); cBus = new List <Connector>(); Initialize(); }
public virtual void PostCommandSignalDrivesPort(CommandReference signal, CommandReference port, int index) { SignalDrivePortCommand cmd = new SignalDrivePortCommand(); cmd.SignalReference = signal; cmd.PortReference = port; cmd.Index = index; PostCommand(cmd); }
public virtual void PostCommandPortDrivesSignal(CommandReference signal, CommandReference port, int index) { PortDriveSignalCommand cmd = new PortDriveSignalCommand(); cmd.SignalReference = signal; cmd.PortReference = port; cmd.Index = index; PostCommand(cmd); }
public void Execute() { if (!BeginExecute()) { return; } _ref = Action(); EndExecute(); }
public virtual void PostCommandBusAttachedToPort(CommandReference bus, CommandReference port, int index) { BusDrivePortCommand cmd = new BusDrivePortCommand(); cmd.BusReference = bus; cmd.PortReference = port; cmd.Index = index; PostCommand(cmd); }
/// <summary> /// Initializes a new instance of the <see cref="T:SimpleRectangle"/> class. /// </summary> public PortShape(IModel model, CommandReference reference, IFlyweightShape <PortShape> fly) : base(model) { this.sysRef = reference; cIn = new List <YttriumConnector>(); cOut = new List <YttriumConnector>(); cBus = new List <YttriumConnector>(); AssignFly(fly); }
public BusShape(IModel model, CommandReference reference, IFlyweightShape<BusShape> fly) : base(model) { this.sysRef = reference; busConnector = new YttriumConnector(Model, ConnectorType.BusConnector); //new Point((int)(Rectangle.Left + Rectangle.Width / 2), Rectangle.Bottom), busConnector.Name = "Bus"; busConnector.Parent = this; Connectors.Add(busConnector); AssignFly(fly); }
public BusShape(IModel model, CommandReference reference, IFlyweightShape <BusShape> fly) : base(model) { this.sysRef = reference; busConnector = new YttriumConnector(Model, ConnectorType.BusConnector); //new Point((int)(Rectangle.Left + Rectangle.Width / 2), Rectangle.Bottom), busConnector.Name = "Bus"; busConnector.Parent = this; Connectors.Add(busConnector); AssignFly(fly); }
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CommandReference commandReference = d as CommandReference; ICommand oldCommand = e.OldValue as ICommand; ICommand newCommand = e.NewValue as ICommand; if (oldCommand != null) { oldCommand.CanExecuteChanged -= commandReference.CanExecuteChanged; } if (newCommand != null) { newCommand.CanExecuteChanged += commandReference.CanExecuteChanged; } }
public SignalShape(IModel model, CommandReference reference, IFlyweightShape <SignalShape> fly) : base(model) { this.sysRef = reference; outConnector = new YttriumConnector(Model, ConnectorType.SignalOutputConnector); outConnector.Name = "Output"; outConnector.Parent = this; Connectors.Add(outConnector); inConnector = new YttriumConnector(Model, ConnectorType.SignalInputConnector); inConnector.Name = "Input"; inConnector.Parent = this; Connectors.Add(inConnector); AssignFly(fly); }
public SignalShape(IModel model, CommandReference reference, IFlyweightShape<SignalShape> fly) : base(model) { this.sysRef = reference; outConnector = new YttriumConnector(Model, ConnectorType.SignalOutputConnector); outConnector.Name = "Output"; outConnector.Parent = this; Connectors.Add(outConnector); inConnector = new YttriumConnector(Model, ConnectorType.SignalInputConnector); inConnector.Name = "Input"; inConnector.Parent = this; Connectors.Add(inConnector); AssignFly(fly); }
public void ShouldExecuteReferencedCommand() { bool canExecuteChangedCalled = false; TestCommand testCommand = new TestCommand(); CommandReference commandReference = new CommandReference { Command = testCommand }; commandReference.CanExecuteChanged += ((sender, eventArgs) => canExecuteChangedCalled = true); object canExecuteParameter = new object(); bool canExecute = commandReference.CanExecute(canExecuteParameter); Assert.IsTrue(canExecute); Assert.AreSame(canExecuteParameter, testCommand.CanExecuteParameter); object executeParameter = new object(); commandReference.Execute(executeParameter); Assert.AreSame(executeParameter, testCommand.ExecuteParameter); Assert.IsFalse(canExecuteChangedCalled); }
protected PortBusIndexCommand(SerializationInfo info, StreamingContext context) { _index = info.GetInt32("idx"); _portRef = CommandReference.Deserialize("port", info); _busRef = CommandReference.Deserialize("bus", info); }
protected PortSignalCommand(SerializationInfo info, StreamingContext context) { _portRef = CommandReference.Deserialize("port", info); _signalRef = CommandReference.Deserialize("signal", info); }
public CommandReferenceTypeDescriptor(ICustomTypeDescriptor parent, CommandReference commandReference) : base(parent) { this.parent = parent; }
protected AbstractPortCommand(SerializationInfo info, StreamingContext context) { _portRef = CommandReference.Deserialize("port", info); }
protected PortBusCommand(SerializationInfo info, StreamingContext context) { _portRef = CommandReference.Deserialize("port", info); _busRef = CommandReference.Deserialize("bus", info); }
public virtual void ReadXml(XmlReader reader) { reader.ReadStartElement("NewCommand", Config.YttriumNamespace); _ref = CommandReference.Deserialize("New", reader); reader.ReadEndElement(); }
protected NewCommand(SerializationInfo info, StreamingContext context) { _ref = CommandReference.Deserialize("new", info); }
protected AbstractBusCommand(SerializationInfo info, StreamingContext context) { _busRef = CommandReference.Deserialize("bus", info); }
public virtual void ReadXml(XmlReader reader) { reader.ReadStartElement("BusCommand", Context.YttriumNamespace); _busRef = CommandReference.Deserialize("Bus", reader); reader.ReadEndElement(); }
protected Signal GetVerifySignal(CommandReference signalReference) { Signal signal = System.GetSignal(signalReference.Index); LazyVerify(signal.InstanceId, signalReference.InstanceId); return signal; }
protected Bus GetVerifyBus(CommandReference busReference) { Bus bus = System.GetBus(busReference.Index); LazyVerify(bus.InstanceId, busReference.InstanceId); return bus; }
protected Port GetVerifyPort(CommandReference portReference) { Port port = System.GetPort(portReference.Index); LazyVerify(port.InstanceId, portReference.InstanceId); return port; }
protected AbstractPortSignalIndexCommand(SerializationInfo info, StreamingContext context) { _index = info.GetInt32("idx"); _portRef = CommandReference.Deserialize("port", info); _signalRef = CommandReference.Deserialize("signal", info); }
protected AbstractSignalCommand(SerializationInfo info, StreamingContext context) { _signalRef = CommandReference.Deserialize("signal", info); }