/// <inheritdoc/> protected override void RegisterTypes(IContainerRegistry containerRegistry) { _applicationSettings = ApplicationSettings.LoadFromFile(AppDomain.CurrentDomain.BaseDirectory + AppSettingsFileName); containerRegistry.RegisterInstance <IApplicationSettings>(_applicationSettings); _systemDialogService = new SystemDialogService(); containerRegistry.RegisterInstance <ISystemDialogService>(_systemDialogService); _scriptVideoService = new ScriptVideoService(_systemDialogService); containerRegistry.RegisterInstance <IScriptVideoService>(_scriptVideoService); _clipboardService = new ClipboardService(); containerRegistry.RegisterInstance <IClipboardService>(_clipboardService); containerRegistry.RegisterSingleton <IProjectService, ProjectService>(); containerRegistry.RegisterInstance <MonitoredUndo.IUndoService>(MonitoredUndo.UndoService.Current); containerRegistry.RegisterSingleton <MonitoredUndo.IChangeFactory, MonitoredUndo.ChangeFactory>(); containerRegistry.RegisterSingleton <IApplicationCommands, ApplicationCommands>(); containerRegistry.RegisterSingleton <ITimelineCommands, TimelineCommands>(); containerRegistry.RegisterDialog <Views.Dialogs.InputValuePromptDialog, ViewModels.Dialogs.InputValuePromptDialogViewModel>(); containerRegistry.RegisterDialog <Views.Dialogs.OutputVideoPropertiesDialog, ViewModels.Dialogs.OutputVideoPropertiesDialogViewModel>(); containerRegistry.RegisterForNavigation <Views.Cropping.CroppingVideoOverlayView>(); containerRegistry.RegisterForNavigation <Views.Cropping.CroppingRibbonGroupView>(); containerRegistry.RegisterForNavigation <Views.Cropping.CroppingDetailsView>(); containerRegistry.RegisterForNavigation <Views.Masking.MaskingVideoOverlayView>(); containerRegistry.RegisterForNavigation <Views.Masking.MaskingRibbonGroupView>(); containerRegistry.RegisterForNavigation <Views.Masking.MaskingDetailsView>(); }
/// <summary> /// Ensures that all local service instances /// are safely disposed. /// </summary> private void DisposeServiceInstances() { _scriptVideoService?.Dispose(); _scriptVideoService = null; _systemDialogService = null; _clipboardService?.Dispose(); _clipboardService = null; }
public ScriptVideoServiceTests() { _projectService = new ProjectService(); _systemDialogServiceMock = new Mock <ISystemDialogService>(); _systemDialogServiceMock.Setup(sds => sds.ShowErrorDialog(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <Exception>())) .Callback <string, string, Exception>((dialogTextParam, dialogCaptionParam, exceptionParam) => { throw exceptionParam ?? new Exception(dialogTextParam); }); _scriptVideoService = new ScriptVideoService(_systemDialogServiceMock.Object); _scriptVideoContext = _scriptVideoService.GetContextReference(); }
public void Dispose() { _scriptVideoContext = null; if (_scriptVideoService != null) { _scriptVideoService.Dispose(); _scriptVideoService = null; } if (_project != null) { _projectService.CloseProject(); _project = null; } }