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(); }
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); }
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; } }
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(); } }
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(); } }
public CommentService(ICommentModel commentModel) { ComposContainer.Instance().Compose(this); _commentModel = commentModel; }
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();
public BookMarkerService() { ComposContainer.Instance().Compose(this); }