コード例 #1
0
        private void Drop(ChannelNode channelNode, Point point)
        {
            var channel         = channelNode.Parents.FirstOrDefault(x => x.IsRgbNode()) ?? channelNode;
            var channelLocation = new ChannelLocation {
                LeftOffset = point.X, TopOffset = point.Y, ChannelId = channel.Id
            };

            ChannelLocations.Add(channelLocation);
        }
コード例 #2
0
 public void UpdateChannelColors(Dictionary <ChannelNode, Color> colorsByChannel)
 {
     foreach (var colorByChannel in colorsByChannel)
     {
         var channelId       = colorByChannel.Key.Id;
         var channelLocation = ChannelLocations.FirstOrDefault(x => x.ChannelId == channelId);
         if (channelLocation != null)
         {
             var color = colorByChannel.Value;
             channelLocation.ChannelColor = color == Colors.Black ? Colors.Transparent : color;
         }
     }
 }
コード例 #3
0
        public DisplayItem Clone()
        {
            var item = new DisplayItem
            {
                Width            = Width,
                Height           = Height,
                LeftOffset       = LeftOffset,
                TopOffset        = TopOffset,
                ChannelLocations =
                    new ObservableCollection <ChannelLocation>(
                        ChannelLocations.Select(channelLocation => channelLocation.Clone()).ToList()),
                IsUnlocked = IsUnlocked
            };

            return(item);
        }
コード例 #4
0
 private void RemoveChannel()
 {
     ChannelLocations.Remove(SelectedChannelLocation);
 }