コード例 #1
0
 private void OnStartNoodleDrag(StudioComponentEndpointViewModel output, float positionX, float positionY)
 {
     Output = output;
     TempNoodle.Connected = true;
     jsRuntime.InvokeAsync <object>("tempNoodle.startNoodleDrag", positionX, positionY);
     TempNoodle.Refresh();
 }
コード例 #2
0
        public void OnDropNoodle(StudioComponentEndpointViewModel input)
        {
            if (!IsEndpointValid(input) || input.IOType != VirtualStudio.Shared.EndpointIOType.Input)
            {
                throw new ArgumentException(nameof(input));
            }

            TempNoodle.Connected = false;
            Output = null;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 private bool IsEndpointValid(StudioComponentEndpointViewModel output)
 {
     return
         (output != null &&
          output.Position != null);
 }