Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommentsBarPresenter"/> class.
        /// </summary>
        /// <param name="view">Instance of the <see cref="ICommentsBarView"/> interface.</param>
        /// <param name="eventAggregator">Instance of the <see cref="IEventAggregator"/> interface.</param>
        /// <param name="timelineModel">Instance of the <see cref="ITimelineModel"/> interface.</param>
        public CommentsBarPresenter(ICommentsBarView view, IEventAggregator eventAggregator, ITimelineModel timelineModel, ITimelineBarRegistry timelineBarRegistry)
        {
            this.eventAggregator = eventAggregator;
            this.timelineModel   = timelineModel;
            this.timelineModel.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == "Duration")
                {
                    this.View.SetDuration(this.timelineModel.Duration);
                }
            };

            this.timelineBarRegistry = timelineBarRegistry;
            this.View = view;
            this.timelineBarElements = new List <ITimelineBarElementModel>();

            this.Options = new List <string>();
            this.OptionSelectedCommand = new DelegateCommand <string>(this.AddSelectedOption);
            this.CloseCommand          = new DelegateCommand <object>(this.CloseOptionsMenu);
            this.View.SetDuration(this.timelineModel.Duration);

            this.eventAggregator.GetEvent <PositionDoubleClickedEvent>().Subscribe(this.AddPreview, true);
            this.eventAggregator.GetEvent <RefreshElementsEvent>().Subscribe(this.RefreshPreviews, true);
            this.eventAggregator.GetEvent <AddPreviewEvent>().Subscribe(this.AddPreview, true);

            this.View.Model = this;
        }
Exemple #2
0
 public SubClipCommentsBarPresenter(ICommentsBarView view, IEventAggregator eventAggregator, ISequenceRegistry sequenceRegistry, ITimelineBarRegistry timelineBarRegistry)
     : base(view, eventAggregator, sequenceRegistry, timelineBarRegistry)
 {
     eventAggregator.GetEvent <DurationChangedEvent>().Subscribe(this.OnDurationChanged, ThreadOption.PublisherThread, false);
     this.View.SetEditBoxMargins(0, -93, 0, 0);
     this.View.SetEditBoxZeeIndex(1000);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseCommentsBarPresenter"/> class.
        /// </summary>
        /// <param name="view">Instance of the <see cref="ICommentsBarView"/> interface.</param>
        /// <param name="eventAggregator">Instance of the <see cref="IEventAggregator"/> interface.</param>
        /// <param name="sequenceRegistry">Instance of the <see cref="ISequenceRegistry"/> interface.</param>
        /// /// <param name="timelineBarRegistry">Instance of the <see cref="ITimelineBarRegistry"/> interface.</param>
        protected BaseCommentsBarPresenter(ICommentsBarView view, IEventAggregator eventAggregator, ISequenceRegistry sequenceRegistry, ITimelineBarRegistry timelineBarRegistry)
        {
            this.eventAggregator  = eventAggregator;
            this.sequenceRegistry = sequenceRegistry;
            this.sequenceRegistry.CurrentSequenceChanged += this.HandleCurrentSequenceChanged;


            this.timelineBarRegistry = timelineBarRegistry;
            this.View = view;

            if (this.sequenceRegistry.CurrentSequenceModel != null)
            {
                this.sequenceRegistry.CurrentSequenceModel.PropertyChanged += this.OnCurrentSequenceOnPropertyChanged;
                this.View.SetDuration(this.sequenceRegistry.CurrentSequenceModel.Duration);
            }

            this.timelineBarElements = new List <ITimelineBarElementModel>();

            this.Options = new List <string>();
            this.OptionSelectedCommand = new DelegateCommand <string>(this.AddSelectedOption);
            this.CloseCommand          = new DelegateCommand <object>(this.CloseOptionsMenu);

            this.eventAggregator.GetEvent <PositionDoubleClickedEvent>().Subscribe(this.AddPreview, ThreadOption.PublisherThread, true, this.FilterPositionDoubleClickedEvent);
            this.eventAggregator.GetEvent <RefreshElementsEvent>().Subscribe(this.RefreshPreviews, ThreadOption.PublisherThread, true, this.FilterRefreshElements);
            this.eventAggregator.GetEvent <AddPreviewEvent>().Subscribe(
                this.AddPreview, ThreadOption.UIThread, true, this.FilterAddPreviewEvent);
            this.eventAggregator.GetEvent <RemovePreviewEvent>().Subscribe(this.RemovePreview, ThreadOption.UIThread, true, this.FilterRemovePreviewEvent);
            this.eventAggregator.GetEvent <DeleteAllPreviewsEvent>().Subscribe(this.DeleteAllPreviews, ThreadOption.PublisherThread, true, this.FilterDeleteAllPreviewsEvent);

            this.View.Model = this;
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommentsBarPresenter"/> class.
        /// </summary>
        /// <param name="view">Instance of the <see cref="ICommentsBarView"/> interface.</param>
        /// <param name="eventAggregator">Instance of the <see cref="IEventAggregator"/> interface.</param>
        /// <param name="timelineModel">Instance of the <see cref="ISequenceModel"/> interface.</param>
        public CommentsBarPresenter(ICommentsBarView view, IEventAggregator eventAggregator, ISequenceRegistry sequenceRegistry, ITimelineBarRegistry timelineBarRegistry)
        {
            this.eventAggregator  = eventAggregator;
            this.sequenceRegistry = sequenceRegistry;
            this.sequenceRegistry.CurrentSequenceChanged += this.HandleCurrentSequenceChanged;
            this.sequenceRegistry.CurrentSequenceModel.PropertyChanged += this.OnCurrentSequenceOnPropertyChanged;

            this.timelineBarRegistry = timelineBarRegistry;
            this.View = view;

            this.View.SetDuration(this.sequenceRegistry.CurrentSequenceModel.Duration);
            this.timelineBarElements = new List <ITimelineBarElementModel>();

            this.Options = new List <string>();
            this.OptionSelectedCommand = new DelegateCommand <string>(this.AddSelectedOption);
            this.CloseCommand          = new DelegateCommand <object>(this.CloseOptionsMenu);


            this.eventAggregator.GetEvent <PositionDoubleClickedEvent>().Subscribe(this.AddPreview, true);
            this.eventAggregator.GetEvent <RefreshElementsEvent>().Subscribe(this.RefreshPreviews, true);
            this.eventAggregator.GetEvent <AddPreviewEvent>().Subscribe(this.AddPreview, true);

            this.View.Model = this;
        }
Exemple #5
0
 public TimelineCommentsBarPresenter(ICommentsBarView view, IEventAggregator eventAggregator, ISequenceRegistry sequenceRegistry, ITimelineBarRegistry timelineBarRegistry)
     : base(view, eventAggregator, sequenceRegistry, timelineBarRegistry)
 {
 }