public CaptureControllerTests() { mediator = A.Fake <IMediator>(); this.auditService = A.Fake <IAuditService>(); this.authorizationService = A.Fake <AuthorizationService>(); controller = new CaptureController(mediator, authorizationService, auditService); }
public void Save(CaptureController capture) { if (!Capture) { Capture = capture; } StartCoroutine("WaitSave"); }
public void TestCapture_Failed_BadRequestAtException() { using (ShimsContext.Create()) { var controller = new CaptureController(); Actions.Fakes.ShimCaptureAction.SetTestModeDataContextGuidDataContextModeTreeViewModeBoolean = (g, da, tv, f) => throw new Exception(); var result = controller.Test(Guid.NewGuid()); Assert.IsTrue(result is BadRequestErrorMessageResult); } }
public void TestCapture_Succeeded_Modification() { using (ShimsContext.Create()) { var controller = new CaptureController(); Actions.Fakes.ShimCaptureAction.SetTestModeDataContextGuidDataContextModeTreeViewModeBoolean = (g, da, tv, f) => true; var result = controller.Test(Guid.NewGuid()); Assert.IsTrue(result is OkResult); } }
public void TestCapture_Succeeded_NoModification() { using (ShimsContext.Create()) { var controller = new CaptureController(); Actions.Fakes.ShimCaptureAction.SetTestModeDataContextGuidDataContextModeTreeViewModeBoolean = (g, da, tv, f) => false; var result = controller.Test(Guid.NewGuid()) as StatusCodeResult; Assert.AreEqual(HttpStatusCode.NotModified, result.StatusCode); } }
public void Constructor() { ////this.Container.RegisterSingleton<ICaptureView, CaptureView>(); ////CaptureView captureView = this.ServiceLocator.GetInstance<ICaptureView>() as CaptureView; CaptureController captureController = null; try { ////captureController = this.ServiceLocator.GetInstance<CaptureController>(); ////captureController.Initialize(); ////Assert.IsTrue(captureView.AllowGrab); ////Assert.IsFalse(captureView.LiveGrabRunning); } finally { if (captureController != null) { captureController.Close(); } } }
/************************************************************ * Event Handlers ************************************************************/ private void Awake() { _captureController = global::CaptureController.Instance; _spawnController = global::SpawnController.Instance; _teamMenuManager = global::TeamMenuManager.Instance; _userController = global::UserController.Instance; _weaponContainer = global::WeaponContainer.Instance; }
public void InitialVariables() { otherController = new OtherController(); ovalPictureBox.BackgroundImageLayout = ImageLayout.Zoom; serialPortController = new SerialPortController(true); serialPortController.PortOpen += () => { // System.Windows.MessageBox.Show("port open"); this.Dispatcher.Invoke(() => { imageSerialportStatus.Source = new BitmapImage(new Uri("/Resource/SerialPortSuccess.png", UriKind.Relative)); }); }; serialPortController.PortClose += () => { // System.Windows.MessageBox.Show("port closed"); this.Dispatcher.Invoke(() => { imageSerialportStatus.Source = new BitmapImage(new Uri("/Resource/SerialPortFail.png", UriKind.Relative)); }); }; serialPortController.NewDataReceived += (string data) => { if (data.Substring(data.Length - 1, 1) == "\r") { data = data.Substring(0, data.Length - 1); } //System.Windows.MessageBox.Show(data); switch (data) { case "LIVE": new Task(() => LivePreView()).Start(); break; case "SAVE": if (pedalController.SaveOnSave) { SaveToGallery(); } if (pedalController.SetImageRightOnSave) { SetImageRight(); } break; case "FREEZE": CaptureJpeg(); StopLivePreView(); if (pedalController.SaveOnFreeze) { SaveToGallery(); } break; } }; dvrControl = new DvrController(); galleryController = new GalleryController(); pedalController = new PedalController(); captureController = new CaptureController(); patientDbContext = new PatientDbContext(); dgTodayWorkBench.DataContext = patientDbContext.Patients.ToList(); pateintTodayForm.nowRefresh += LoadTodayPatientTable; pateintTodayForm.onSelectPatient += (int Id, string fullName) => { mainTabControl.SelectedIndex = 1; PatientId = Id; galleryController.CreateAndOpenGalley(Id); galleryControl.setGalleryId(Id); patientWorkBenchName.Text = fullName; //picCapture.Source = null; partBottom.Visibility = Visibility.Collapsed; }; galleryControl.onChangeSelectedItem += (BitmapImage bitmapImage) => { this.Dispatcher.Invoke(() => { //ellipseGeometry.Center = new Point(bitmapImage.Width / 2, bitmapImage.Height / 2); //int startX = (int)(bitmapImage.Width - bitmapImage.Height) / 2; //int endX = (int)(bitmapImage.Width + startX); ////CroppedBitmap croppedBitmap = new CroppedBitmap(bitmapImage, new Int32Rect(startX, 0, endX, (int)bitmapImage.Height)); //croppedBitmap.SourceRect = new Int32Rect(startX, 0, endX, (int)bitmapImage.Height); picCapture.Source = bitmapImage; }); }; }
public CaptureSetting() { InitializeComponent(); captureController = new CaptureController(); }
/************************************************************ * Event Handlers ************************************************************/ private void Awake() { _matchRoundMenuManager = global::MatchRoundMenuManager.Instance; _teamsController = global::TeamsController.Instance; _spawnController = global::SpawnController.Instance; _hudController = global::HUDController.Instance; _captureController = global::CaptureController.Instance; _userController = global::UserController.Instance; }
public static void Reset() { _instance = null; }
// Use this for initialization void Start() { capControl = area.GetComponent <CaptureController>(); }
public MainViewModel() { _saveFileInfo = new FileInfo(CaptureController.SavePath); // Initialize file watcher. _fileWatcher.Path = Path.GetDirectoryName(CaptureController.SavePath); _fileWatcher.Filter = Path.GetFileName(CaptureController.SavePath); _fileWatcher.Changed += (s, e) => OnPropertyChanged(nameof(Size)); _fileWatcher.EnableRaisingEvents = true; CaptureController.StateChanged += (s, e) => CaptureState = e.State; PlaybackController.StateChanged += (s, e) => PlaybackState = e.State; CaptureCommand = new Command(() => { if (CaptureState == State.Idle) { CaptureController.Start(); } else { CaptureController.Stop(); } }, () => PlaybackState == State.Idle); CapturePauseCommand = new Command(() => { if (CaptureState == State.Running) { CaptureController.Pause(); } else { CaptureController.Resume(); } UpdatePage(); }, () => CaptureState != State.Idle); PlaybackCommand = new Command(() => { if (PlaybackState == State.Idle) { PlaybackController.Start(); } else { PlaybackController.Stop(); } UpdatePage(); }, () => CaptureState == State.Idle && File.Exists(CaptureController.SavePath)); PlaybackPauseCommand = new Command(() => { if (PlaybackState == State.Running) { PlaybackController.Pause(); } else { PlaybackController.Resume(); } UpdatePage(); }, () => PlaybackState != State.Idle); }
public CaptureView(CaptureController captureController) { this.InitializeComponent(); this.captureController = captureController; }