private void OnStartNoodleDrag(StudioComponentEndpointViewModel output, float positionX, float positionY) { Output = output; TempNoodle.Connected = true; jsRuntime.InvokeAsync <object>("tempNoodle.startNoodleDrag", positionX, positionY); TempNoodle.Refresh(); }
public void OnDropNoodle(StudioComponentEndpointViewModel input) { if (!IsEndpointValid(input) || input.IOType != VirtualStudio.Shared.EndpointIOType.Input) { throw new ArgumentException(nameof(input)); } TempNoodle.Connected = false; Output = null; }
public void OnStartNoodleDrag(StudioComponentEndpointViewModel output) { if (!IsEndpointValid(output) || output.IOType != VirtualStudio.Shared.EndpointIOType.Output) { throw new ArgumentException(nameof(output)); } var position = output.Position.Value; OnStartNoodleDrag(output, position.x, position.y); }
public void Fires_event_on_Name_change() { var vm = new StudioComponentEndpointViewModel(null, new StudioComponentEndpointDto()); bool eventFired = false; System.ComponentModel.PropertyChangedEventArgs args = null; vm.PropertyChanged += (s, e) => { args = e; eventFired = true; }; vm.Name = "ajgkdls"; Assert.IsTrue(eventFired); Assert.AreEqual(nameof(vm.Name), args.PropertyName); }
public void Creates_the_ViewModel_from_DTO() { StudioComponentEndpointDto dto = new StudioComponentEndpointDto() { ConnectionType = "sdfdsgdfgd", DataKind = Shared.DataKind.Video, Id = 25, IOType = Shared.EndpointIOType.Output, Name = "rgjepaesfeü" }; var vm = new StudioComponentEndpointViewModel(null, dto); Assert.AreEqual(dto.Name, vm.Name); Assert.AreEqual(dto.IOType, vm.IOType); Assert.AreEqual(dto.Id, vm.Id); Assert.AreEqual(dto.DataKind, vm.DataKind); Assert.AreEqual(dto.ConnectionType, vm.ConnectionType); }
private bool IsEndpointValid(StudioComponentEndpointViewModel output) { return (output != null && output.Position != null); }