示例#1
0
 public SmallVideoPresenter(ISmallView view, Action <ICameraModel> handler)
 {
     ComposContainer.Instance().Compose(this);
     if ((view != null) && (handler != null))
     {
         _view       = view;
         FullScreen += handler;
     }
 }
 public SmallSearchPresenter(ISmallSearchView view, IMainPresenter presToAdd)
 {
     ComposContainer.Instance().Compose(this);
     _view                  = view;
     _presToAdd             = presToAdd;
     _view.CreatePresenter += () => CreatePresenter();
     _view.GetCameras      += SetCameraList;
     SetCameraList();
 }
示例#3
0
        private void ActiveXComponent_Load(object sender, EventArgs e)
        {
            ComposContainer.Instance().Compose(this);

            _initModel.Init();

            _loginPresenter            = new LoginPresenter(new LoginControl());
            _loginPresenter.Connected += ConnectionCompleted;

            LoadLoginView(_loginPresenter.GetView());
            //_loginPresenter.Connect();

            _videoPresenter = new VideoPresenter(new CameraViewer(), CloseVideoControl);
        }
示例#4
0
 public VideoPresenter(IVideoView view, Action backHandler)
 {
     ComposContainer.Instance().Compose(this);
     if (view != null)
     {
         _view                    = view;
         _backHandler             = backHandler;
         _view.Back              += Back;
         _view.CreatePrintScreen += CreateScreen;
         BindMoveCommandHandler();
         _printScreenModel.SendMessage += ErrorMessage;
         _printScreenModel.Created     += PrintScreenCreated;
         _printScreenModel.Progress    += Progress;
     }
 }
示例#5
0
        public MainPresenter(IMainView view, Action <ICameraModel> handler)
        {
            ComposContainer.Instance().Compose(this);
            if ((view != null) && (handler != null))
            {
                this._view                  = view;
                _handler                    = handler;
                _view.GroupsEditClick      += EditGroups;
                _view.GroupSelected        += SetActiveGroup;
                _view.ActivatedPlaybackTab += ActivatedPlayBackTab;
                _view.InitiateSearch       += () => InitiateSearch();

                _groups             = new Dictionary <Guid, Group>();
                _smallPresenters    = new List <ISmallVideoPresenter>();
                _playbackPresenters = new List <IPlaybackPresenter>();
                LoadGroups();
            }
            else
            {
                throw new NullReferenceException();
            }
        }
示例#6
0
 public PlaybackPresenter(IPlaybackView view /*,IAudioModel audioModel*/)
 {
     ComposContainer.Instance().Compose(this);
     if (view != null)
     {
         _view = view;
         //_audioModel = audioModel;
         _playbackModel.TimeLine             = view.TimeLine;
         _view.PlayButtonPressed            += () => Play();
         _view.SlowDownButtonPressed        += () => SlowDown();
         _view.SpeedUpButtonPressed         += () => SpeedUp();
         _view.ChangeDirectionButtonPressed += () => ChangeDirection();
         _view.ResetSpeedButtonPressed      += () => ResetSpeed();
         _playbackModel.SpeedChanged        += () => UpdateSpeed();
         _view.CreateComment     += () => throw new NotImplementedException();
         _view.CreateBookMarker  += () => throw new NotImplementedException();
         _view.CreatePrintScreen += () => throw new NotImplementedException();
     }
     else
     {
         throw new NullReferenceException();
     }
 }
示例#7
0
 public CommentService(ICommentModel commentModel)
 {
     ComposContainer.Instance().Compose(this);
     _commentModel = commentModel;
 }
示例#8
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using View.Interfaces;
using Contract;
using Presenter.Interfaces;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Windows.Forms;

namespace Presenter
{
    /// <summary>
    ///  Презентер авторизации. 
    ///  Управляет контролом авторизации и объектом соединения.
    /// </summary>
    public class LoginPresenter : ILoginPresenter
    {
        private ILoginView _view;
        [Import(typeof(ILoginModel))]
        public ILoginModel _loginModel;
        public event Action Connected;

        public LoginPresenter(ILoginView view)
        {
            ComposContainer.Instance().Compose(this);
            if (view != null)
            {
                this._view = view;
                _view.Login += Login;
                _loginModel.Done += Done;
            }
            else
            {
                throw new Exception("Null point");
            }
            
        }


        private void Login()
        {
            if (_view.Server != null)
            {
                _view.StartProgress();
                Connect();
            }
                
        }


        private void Done()
        {
            _view.StopProgress();
            switch(_loginModel.Status)
            {
                case Contract.ConnectStatus.Ok:
                    ((UserControl) _view.GetView()).Invoke((Action) delegate
                    {
                        Connected();
示例#9
0
 public BookMarkerService()
 {
     ComposContainer.Instance().Compose(this);
 }