Exemplo n.º 1
0
            public IEnumerable <T> Visit(Merge <T> disjointUnion)
            {
                var a = InMemory.Get(disjointUnion.InputA);
                var b = InMemory.Get(disjointUnion.InputB);

                return(a.Concat(b));
            }
Exemplo n.º 2
0
            public IEnumerable <T> Visit <A, B>(Product <T, A, B> product)
            {
                var a = InMemory.Get(product.InputA);
                var b = InMemory.Get(product.InputB);

                return(a.SelectMany(ai => b.SelectMany(bi => product.Func(ai, bi))));
            }
Exemplo n.º 3
0
 public IEnumerable <T> Visit <I>(GroupBy <T, I> groupBy)
 => InMemory
 .Get(groupBy.Input)
 .GroupBy(
     v => v.Item1,
     v => v.Item2,
     (key, list) => (key, list.Aggregate(groupBy.Reduce)))
 .SelectMany(groupBy.GetResult);
Exemplo n.º 4
0
        private void OnSelected()
        {
            InMemory.Set("SelectedVideo", Video);

            Mediator.NotifyColleagues("OnPlayVideo", Video);
            if (InMemory.Can("tag"))
            {
                Mediator.NotifyColleagues("OnChangeTag", InMemory.Get("tag"));
            }
            else
            {
                Mediator.NotifyColleagues("OnChangeTag", string.Empty);
            }
        }
Exemplo n.º 5
0
        private void OnSelectMeta()
        {
            if (InMemory.Can("SelectedVideo"))
            {
                if (InMemory.Get("SelectedVideo") is Video video)
                {
                    int      fps      = video.Fps;
                    TimeSpan duration = video.Duration;
                    long     frame    = (long)BeginFrame;

                    double time = ((double)frame / fps);
                    Mediator.NotifyColleagues("SetPosition", time);
                    Mediator.NotifyColleagues("OnProgress", time);
                }
            }
        }
Exemplo n.º 6
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (InMemory.Can("SelectedVideo"))
            {
                if (InMemory.Get("SelectedVideo") is Video video)
                {
                    int      fps      = video.Fps;
                    TimeSpan duration = video.Duration;
                    long     frame    = (long)value;

                    int time = (int)(frame / fps);

                    return(new TimeSpan(0, 0, time));
                }
            }

            return(value);
        }
Exemplo n.º 7
0
 public IEnumerable <T> Visit <I>(SelectMany <T, I> selectMany)
 {
     return(InMemory
            .Get(selectMany.Input)
            .SelectMany(selectMany.Func));
 }