public ClipboardWriter(ISystemTray SystemTray, LanguageManager Loc) { _systemTray = SystemTray; _loc = Loc; Loc.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public ScreenShotModel(VideoSourcesViewModel videoSourcesViewModel, ISystemTray systemTray, IRegionProvider regionProvider, IMainWindow mainWindow, IVideoSourcePicker sourcePicker, IAudioPlayer audioPlayer, IEnumerable <IImageWriterItem> imageWriters, Settings.Settings settings, LanguageManager loc, IPlatformServices platformServices) { _videoSourcesViewModel = videoSourcesViewModel; _systemTray = systemTray; _regionProvider = regionProvider; _mainWindow = mainWindow; _sourcePicker = sourcePicker; _audioPlayer = audioPlayer; _settings = settings; _loc = loc; _platformServices = platformServices; AvailableImageWriters = imageWriters.ToList(); if (!AvailableImageWriters.Any(imageWriterItem => imageWriterItem.Active)) { AvailableImageWriters[0].Active = true; } }
public RecordingViewModel(Settings Settings, LanguageManager LanguageManager, CustomOverlaysViewModel CustomOverlays, CustomImageOverlaysViewModel CustomImageOverlays, CensorOverlaysViewModel CensorOverlays, ISystemTray SystemTray, IRegionProvider RegionProvider, WebcamOverlay WebcamOverlay, IMainWindow MainWindow, IPreviewWindow PreviewWindow, VideoViewModel VideoViewModel, AudioSource AudioSource, RecentViewModel RecentViewModel, IWebCamProvider WebCamProvider) : base(Settings, LanguageManager) { this.CustomOverlays = CustomOverlays; this.CustomImageOverlays = CustomImageOverlays; this.CensorOverlays = CensorOverlays; _systemTray = SystemTray; _regionProvider = RegionProvider; _webcamOverlay = WebcamOverlay; _mainWindow = MainWindow; _previewWindow = PreviewWindow; _videoViewModel = VideoViewModel; _audioSource = AudioSource; _recentViewModel = RecentViewModel; _webCamProvider = WebCamProvider; RecordCommand = new DelegateCommand(OnRecordExecute); PauseCommand = new DelegateCommand(OnPauseExecute, false); SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; }
public ScreenShotModel(VideoSourcesViewModel VideoSourcesViewModel, ISystemTray SystemTray, IRegionProvider RegionProvider, IMainWindow MainWindow, IVideoSourcePicker SourcePicker, IAudioPlayer AudioPlayer, IEnumerable <IImageWriterItem> ImageWriters, Settings Settings, LanguageManager Loc) { _videoSourcesViewModel = VideoSourcesViewModel; _systemTray = SystemTray; _regionProvider = RegionProvider; _mainWindow = MainWindow; _sourcePicker = SourcePicker; _audioPlayer = AudioPlayer; _settings = Settings; _loc = Loc; AvailableImageWriters = ImageWriters.ToList(); if (!AvailableImageWriters.Any(M => M.Active)) { AvailableImageWriters[0].Active = true; } }
public ScreenShotModel(VideoSourcesViewModel VideoSourcesViewModel, ISystemTray SystemTray, IRegionProvider RegionProvider, IMainWindow MainWindow, IVideoSourcePicker SourcePicker, IAudioPlayer AudioPlayer, IEnumerable <IImageWriterItem> ImageWriters, Settings Settings, ILocalizationProvider Loc, IPlatformServices PlatformServices, WebcamModel WebcamModel) { _videoSourcesViewModel = VideoSourcesViewModel; _systemTray = SystemTray; _regionProvider = RegionProvider; _mainWindow = MainWindow; _sourcePicker = SourcePicker; _audioPlayer = AudioPlayer; _settings = Settings; _loc = Loc; _platformServices = PlatformServices; _webcamModel = WebcamModel; AvailableImageWriters = ImageWriters.ToList(); if (!AvailableImageWriters.Any(M => M.Active)) { AvailableImageWriters[0].Active = true; } }
public RecordingViewModel(RecordingModel RecordingModel, Settings Settings, TimerModel TimerModel, VideoSourcesViewModel VideoSourcesViewModel, VideoWritersViewModel VideoWritersViewModel, ISystemTray SystemTray, IMainWindow MainWindow, IAudioPlayer AudioPlayer, IRecentList RecentList, AudioSourceViewModel AudioSourceViewModel) : base(Settings) { _recordingModel = RecordingModel; _timerModel = TimerModel; _videoSourcesViewModel = VideoSourcesViewModel; _videoWritersViewModel = VideoWritersViewModel; _systemTray = SystemTray; _mainWindow = MainWindow; _audioPlayer = AudioPlayer; _recentList = RecentList; _audioSourceViewModel = AudioSourceViewModel; this.RecordingModel = RecordingModel; TimerModel.DurationElapsed += () => { _syncContext.Run(async() => await StopRecording(), true); }; }
public ScreenShotViewModel(VideoViewModel VideoViewModel, RecentViewModel RecentViewModel, ISystemTray SystemTray, LanguageManager Loc, Settings Settings, IRegionProvider RegionProvider, IMainWindow MainWindow, DiskWriter DiskWriter, ClipboardWriter ClipboardWriter, ImgurWriter ImgurWriter, IVideoSourcePicker SourcePicker) : base(Settings, Loc) { _videoViewModel = VideoViewModel; _recentViewModel = RecentViewModel; _systemTray = SystemTray; _regionProvider = RegionProvider; _mainWindow = MainWindow; _sourcePicker = SourcePicker; this.DiskWriter = DiskWriter; this.ClipboardWriter = ClipboardWriter; this.ImgurWriter = ImgurWriter; ScreenShotCommand = new DelegateCommand(() => CaptureScreenShot()); ScreenShotActiveCommand = new DelegateCommand(async() => await SaveScreenShot(ScreenShotWindow(Window.ForegroundWindow))); ScreenShotDesktopCommand = new DelegateCommand(async() => await SaveScreenShot(ScreenShotWindow(Window.DesktopWindow))); ScreenshotRegionCommand = new DelegateCommand(async() => await ScreenshotRegion()); ScreenshotWindowCommand = new DelegateCommand(async() => await ScreenshotWindow()); ScreenshotScreenCommand = new DelegateCommand(async() => await ScreenshotScreen()); }
public RecordingViewModel(Settings Settings, LanguageManager LanguageManager, ISystemTray SystemTray, IRegionProvider RegionProvider, WebcamOverlay WebcamOverlay, IMainWindow MainWindow, IPreviewWindow PreviewWindow, VideoSourcesViewModel VideoSourcesViewModel, VideoWritersViewModel VideoWritersViewModel, AudioSource AudioSource, IWebCamProvider WebCamProvider, KeymapViewModel Keymap, IAudioPlayer AudioPlayer, IRecentList RecentList) : base(Settings, LanguageManager) { _systemTray = SystemTray; _regionProvider = RegionProvider; _webcamOverlay = WebcamOverlay; _mainWindow = MainWindow; _previewWindow = PreviewWindow; _videoSourcesViewModel = VideoSourcesViewModel; _videoWritersViewModel = VideoWritersViewModel; _audioSource = AudioSource; _webCamProvider = WebCamProvider; _keymap = Keymap; _audioPlayer = AudioPlayer; _recentList = RecentList; RecordCommand = new DelegateCommand(OnRecordExecute); PauseCommand = new DelegateCommand(OnPauseExecute, false); SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; }
public RecordingModel(Settings Settings, ILocalizationProvider Loc, ISystemTray SystemTray, WebcamOverlay WebcamOverlay, IPreviewWindow PreviewWindow, IAudioSource AudioSource, WebcamModel WebcamModel, KeymapViewModel Keymap, TimerModel TimerModel, IMessageProvider MessageProvider, IFFmpegViewsProvider FFmpegViewsProvider) : base(Settings, Loc) { _systemTray = SystemTray; _webcamOverlay = WebcamOverlay; _previewWindow = PreviewWindow; _audioSource = AudioSource; _webcamModel = WebcamModel; _keymap = Keymap; _timerModel = TimerModel; _messageProvider = MessageProvider; _ffmpegViewsProvider = FFmpegViewsProvider; SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; TimerModel.CountdownElapsed += InternalStartRecording; }
public DiskWriter(ISystemTray SystemTray, Settings Settings, IRecentList RecentList) { _systemTray = SystemTray; _settings = Settings; _recentList = RecentList; }
public Handler(IMediator mediator, ISystemTray sysTray, IDispatcher dispatcher, ITelemetry telemetry, ILogger logger) { _logger = logger; _sysTray = sysTray; _mediator = mediator; _telemetry = telemetry; _dispatcher = dispatcher; }
public DiskWriter(ISystemTray SystemTray, IMessageProvider MessageProvider, Settings Settings) { _systemTray = SystemTray; _messageProvider = MessageProvider; _settings = Settings; LanguageManager.Instance.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public DiskWriter(ISystemTray SystemTray, IMessageProvider MessageProvider, Settings Settings, LanguageManager Loc) { _systemTray = SystemTray; _messageProvider = MessageProvider; _settings = Settings; _loc = Loc; Loc.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public ClipboardWriter(ISystemTray systemTray, LanguageManager loc, IClipboardService clipboard) { _systemTray = systemTray; _loc = loc; _clipboard = clipboard; loc.LanguageChanged += cultureInfo => RaisePropertyChanged(nameof(Display)); }
public ClipboardWriter(ISystemTray SystemTray, ILocalizationProvider Loc, IClipboardService Clipboard) { _systemTray = SystemTray; _loc = Loc; _clipboard = Clipboard; Loc.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public void SetUp() { var resourceServcie = MockRepository.GenerateStub<IResourceService>(); resourceServcie.Stub(x=>x.LoadIcon(FlowMate.TrayIconFileName)).Return(_trayIcon); _application = MockRepository.GenerateStub<IApplication>(); _systemTray = MockRepository.GenerateStub<ISystemTray>(); var flowMate = new FlowMate(_application, resourceServcie, _systemTray); flowMate.Run(); }
public DiskWriter(ISystemTray systemTray, IMessageProvider messageProvider, Settings.Settings settings, LanguageManager loc, IRecentList recentList) { _systemTray = systemTray; _messageProvider = messageProvider; _settings = settings; _loc = loc; _recentList = recentList; loc.LanguageChanged += cultureInfo => RaisePropertyChanged(nameof(Display)); }
public DiskWriter(ISystemTray SystemTray, IMessageProvider MessageProvider, Settings Settings, ILocalizationProvider Loc, IRecentList RecentList) { _systemTray = SystemTray; _messageProvider = MessageProvider; _settings = Settings; _loc = Loc; _recentList = RecentList; Loc.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public ImgurWriter(DiskWriter DiskWriter, ISystemTray SystemTray, IMessageProvider MessageProvider, Settings Settings, LanguageManager LanguageManager) { _diskWriter = DiskWriter; _systemTray = SystemTray; _messageProvider = MessageProvider; _settings = Settings; _loc = LanguageManager; LanguageManager.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public RecordingModel(Settings Settings, ILocalizationProvider Loc, ISystemTray SystemTray, WebcamOverlay WebcamOverlay, IMainWindow MainWindow, IPreviewWindow PreviewWindow, VideoSourcesViewModel VideoSourcesViewModel, VideoWritersViewModel VideoWritersViewModel, AudioSource AudioSource, WebcamModel WebcamModel, KeymapViewModel Keymap, IAudioPlayer AudioPlayer, IRecentList RecentList, TimerModel TimerModel, IMessageProvider MessageProvider, IFFmpegViewsProvider FFmpegViewsProvider) : base(Settings, Loc) { _systemTray = SystemTray; _webcamOverlay = WebcamOverlay; _mainWindow = MainWindow; _previewWindow = PreviewWindow; _videoSourcesViewModel = VideoSourcesViewModel; _videoWritersViewModel = VideoWritersViewModel; _audioSource = AudioSource; _webcamModel = WebcamModel; _keymap = Keymap; _audioPlayer = AudioPlayer; _recentList = RecentList; _timerModel = TimerModel; _messageProvider = MessageProvider; _ffmpegViewsProvider = FFmpegViewsProvider; SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; TimerModel.CountdownElapsed += InternalStartRecording; TimerModel.DurationElapsed += async() => { if (_syncContext != null) { _syncContext.Post(async State => await StopRecording(), null); } else { await StopRecording(); } }; }
public RecordingModel(Settings.Settings settings, LanguageManager languageManager, ISystemTray systemTray, IRegionProvider regionProvider, WebCamOverlay webcamOverlay, IMainWindow mainWindow, IPreviewWindow previewWindow, VideoSourcesViewModel videoSourcesViewModel, VideoWritersViewModel videoWritersViewModel, AudioSource audioSource, IWebCamProvider webCamProvider, KeymapViewModel keymap, IAudioPlayer audioPlayer, IRecentList recentList, TimerModel timerModel) : base(settings, languageManager) { _systemTray = systemTray; _regionProvider = regionProvider; _webcamOverlay = webcamOverlay; _mainWindow = mainWindow; _previewWindow = previewWindow; _videoSourcesViewModel = videoSourcesViewModel; _videoWritersViewModel = videoWritersViewModel; _audioSource = audioSource; _webCamProvider = webCamProvider; _keymap = keymap; _audioPlayer = audioPlayer; _recentList = recentList; _timerModel = timerModel; SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; timerModel.CountdownElapsed += InternalStartRecording; timerModel.DurationElapsed += async() => { if (_syncContext != null) { _syncContext.Post(async state => await StopRecording(), null); } else { await StopRecording(); } }; }
public ImgurWriter(DiskWriter DiskWriter, ISystemTray SystemTray, IMessageProvider MessageProvider, Settings Settings, LanguageManager LanguageManager, IRecentList RecentList, IIconSet Icons) { _diskWriter = DiskWriter; _systemTray = SystemTray; _messageProvider = MessageProvider; _settings = Settings; _loc = LanguageManager; _recentList = RecentList; _icons = Icons; LanguageManager.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public MasterViewModel(ISystemTray systemTray) { _systemTray = systemTray; _settingsManager = new SettingsManager("eup", "EasyFarm User Preference"); _systemTray.ConfigureSystemTray(SendToSystemTray, SendToTaskBar); AppServices.RegisterEvent <Events.StatusBarEvent>(e => StatusBarText = e.Message); AppServices.RegisterEvent <Events.PauseEvent>(x => StopEngine()); AppServices.RegisterEvent <Events.ResumeEvent>(x => StartEngine()); StartCommand = new DelegateCommand(Start); ExitCommand = new DelegateCommand(Exit); SaveCommand = new DelegateCommand(Save); LoadCommand = new DelegateCommand(Load); SelectProcessCommand = new DelegateCommand(SelectProcess); OnLoad(); }
public RecordingModel(Settings Settings, ISystemTray SystemTray, IPreviewWindow PreviewWindow, IAudioSource AudioSource, KeymapViewModel Keymap, TimerModel TimerModel, IFpsManager FpsManager) : base(Settings) { _systemTray = SystemTray; _previewWindow = PreviewWindow; _audioSource = AudioSource; _keymap = Keymap; _timerModel = TimerModel; _fpsManager = FpsManager; SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; TimerModel.CountdownElapsed += InternalStartRecording; }
public MasterViewModel(ISystemTray systemTray) { _systemTray = systemTray; _settingsManager = new SettingsManager("eup", "EasyFarm User Preference"); _systemTray.ConfigureSystemTray(SendToSystemTray, SendToTaskBar); AppServices.RegisterEvent<Events.StatusBarEvent>(e => StatusBarText = e.Message); AppServices.RegisterEvent<Events.PauseEvent>(x => StopEngine()); AppServices.RegisterEvent<Events.ResumeEvent>(x => StartEngine()); StartCommand = new DelegateCommand(Start); ExitCommand = new DelegateCommand(Exit); SaveCommand = new DelegateCommand(Save); LoadCommand = new DelegateCommand(Load); SelectProcessCommand = new DelegateCommand(SelectProcess); OnLoad(); }
public ImageUploadWriter(DiskWriter DiskWriter, ISystemTray SystemTray, IMessageProvider MessageProvider, Settings Settings, ILocalizationProvider Loc, IRecentList RecentList, IImageUploader ImgUploader) { _imgUploader = ImgUploader; _diskWriter = DiskWriter; _systemTray = SystemTray; _messageProvider = MessageProvider; _settings = Settings; _loc = Loc; _recentList = RecentList; Loc.LanguageChanged += L => RaisePropertyChanged(nameof(Display)); }
public ImageUploadWriter(DiskWriter diskWriter, ISystemTray systemTray, IMessageProvider messageProvider, Settings.Settings settings, LanguageManager languageManager, IRecentList recentList, IImageUploader imgUploader) { _imgUploader = imgUploader; _diskWriter = diskWriter; _systemTray = systemTray; _messageProvider = messageProvider; _settings = settings; _loc = languageManager; _recentList = recentList; languageManager.LanguageChanged += cultureInfo => RaisePropertyChanged(nameof(Display)); }
public ScreenShotViewModel(VideoViewModel VideoViewModel, RecentViewModel RecentViewModel, ISystemTray SystemTray, LanguageManager Loc, Settings Settings, IRegionProvider RegionProvider, IMainWindow MainWindow) : base(Settings, Loc) { _videoViewModel = VideoViewModel; _recentViewModel = RecentViewModel; _systemTray = SystemTray; _regionProvider = RegionProvider; _mainWindow = MainWindow; ScreenShotCommand = new DelegateCommand(() => CaptureScreenShot()); ScreenShotActiveCommand = new DelegateCommand(async() => await SaveScreenShot(ScreenShotWindow(Window.ForegroundWindow))); ScreenShotDesktopCommand = new DelegateCommand(async() => await SaveScreenShot(ScreenShotWindow(Window.DesktopWindow))); }
// If DI is about removing all "new" operators from your logic to enable a plugin architecture where // every component can be changed in one place and that we must rely on abstraction rather than concretions // then everything must implement an interface and be passed in on the constructor (even other windows) // Thiscould be useful as for instance: if you wanted to replace the Expression builder then we change it // when we load our Ninject Kernel in App.xaml (Via IExpressionBuilderWindowFactory). Then if we called // that screen from other windows (such as we do in Find) later on in the stack the change is only in one place // I fully intend to remove all "new" operators from this code file as a test to see how plausible it is to do! // I have left += new event handlers and any temporary news like StringBuilder public MainWindow(RecentFileList recentFileList, ILastOpenFilesData lastOpenFilesData, IHighlightItemData highlightItemData, IWindowFactory windowFactory, IFindWindowFactory findWindowFactory, ISystemTray systemTray, System.Windows.Forms.NotifyIcon notifyIcon, ISaveExpressionMessageWindowFactory saveExpressionMessageWindowFactory, IExpressionBuilderWindowFactory expressionBuilderWindowFactory, IFileFactory fileFactory, ITabItemFactory tabItemFactory, ISettingsHelper settingsHelper, IHighlightWindowFactory highlightWindowFactory, IHighlightsHelper highlightsHelper) { this.SettingsHelper = settingsHelper; this.LastOpenFilesData = lastOpenFilesData; this.recentFileList = recentFileList; this.WindowFactory = windowFactory; this.FindWindowFactory = findWindowFactory; this.HighlightItemData = highlightItemData; this.SaveExpressionMessageWindowFactory = saveExpressionMessageWindowFactory; this.ExpressionBuilderWindowFactory = expressionBuilderWindowFactory; this.SystemTray = systemTray; this.FileFactory = fileFactory; this.TabItemFactory = tabItemFactory; this.HighlightWindowFactory = highlightWindowFactory; this.HighlightHelper = highlightsHelper; InitializeComponent(); this.recentFileList.SubMenuClick +=new EventHandler<EventArgs>(recentFileList_SubMenuClick); this.MenuItemFile.Items.Insert(2, this.recentFileList); // Null Object pattern (http://en.wikipedia.org/wiki/Null_Object_pattern) this.OpenWindows = new List<IWindow>(0); this.LastOpenFiles = new List<IFile>(0); this.Notify = notifyIcon; this.Notify.Icon = this.SystemTray.Icon; this.Notify.DoubleClick += new EventHandler(Notify_DoubleClick); this.Notify.ContextMenu = this.SystemTray.ContextMenu; this.Notify.ContextMenu.MenuItems[0].Click += new EventHandler(disableSoundsMenuItem_Click); this.Notify.ContextMenu.MenuItems[1].Click += new EventHandler(minimuseToTrayItem_Click); this.Notify.ContextMenu.MenuItems[3].Click += new EventHandler(exitItem_Click); this.Notify.Visible = true; }
// If DI is about removing all "new" operators from your logic to enable a plugin architecture where // every component can be changed in one place and that we must rely on abstraction rather than concretions // then everything must implement an interface and be passed in on the constructor (even other windows) // Thiscould be useful as for instance: if you wanted to replace the Expression builder then we change it // when we load our Ninject Kernel in App.xaml (Via IExpressionBuilderWindowFactory). Then if we called // that screen from other windows (such as we do in Find) later on in the stack the change is only in one place // I fully intend to remove all "new" operators from this code file as a test to see how plausible it is to do! // I have left += new event handlers and any temporary news like StringBuilder public MainWindow(RecentFileList recentFileList, ILastOpenFilesData lastOpenFilesData, IHighlightItemData highlightItemData, IWindowFactory windowFactory, IFindWindowFactory findWindowFactory, ISystemTray systemTray, System.Windows.Forms.NotifyIcon notifyIcon, ISaveExpressionMessageWindowFactory saveExpressionMessageWindowFactory, IExpressionBuilderWindowFactory expressionBuilderWindowFactory, IFileFactory fileFactory, ITabItemFactory tabItemFactory, ISettingsHelper settingsHelper, IHighlightWindowFactory highlightWindowFactory, IHighlightsHelper highlightsHelper) { this.SettingsHelper = settingsHelper; this.LastOpenFilesData = lastOpenFilesData; this.recentFileList = recentFileList; this.WindowFactory = windowFactory; this.FindWindowFactory = findWindowFactory; this.HighlightItemData = highlightItemData; this.SaveExpressionMessageWindowFactory = saveExpressionMessageWindowFactory; this.ExpressionBuilderWindowFactory = expressionBuilderWindowFactory; this.SystemTray = systemTray; this.FileFactory = fileFactory; this.TabItemFactory = tabItemFactory; this.HighlightWindowFactory = highlightWindowFactory; this.HighlightHelper = highlightsHelper; InitializeComponent(); this.recentFileList.SubMenuClick += new EventHandler <EventArgs>(recentFileList_SubMenuClick); this.MenuItemFile.Items.Insert(2, this.recentFileList); // Null Object pattern (http://en.wikipedia.org/wiki/Null_Object_pattern) this.OpenWindows = new List <IWindow>(0); this.LastOpenFiles = new List <IFile>(0); this.Notify = notifyIcon; this.Notify.Icon = this.SystemTray.Icon; this.Notify.DoubleClick += new EventHandler(Notify_DoubleClick); this.Notify.ContextMenu = this.SystemTray.ContextMenu; this.Notify.ContextMenu.MenuItems[0].Click += new EventHandler(disableSoundsMenuItem_Click); this.Notify.ContextMenu.MenuItems[1].Click += new EventHandler(minimuseToTrayItem_Click); this.Notify.ContextMenu.MenuItems[3].Click += new EventHandler(exitItem_Click); this.Notify.Visible = true; }
public ScreenShotViewModel(VideoSourcesViewModel VideoSourcesViewModel, ISystemTray SystemTray, LanguageManager Loc, Settings Settings, IRegionProvider RegionProvider, IMainWindow MainWindow, DiskWriter DiskWriter, ClipboardWriter ClipboardWriter, ImageUploadWriter ImgurWriter, IVideoSourcePicker SourcePicker, IAudioPlayer AudioPlayer, IEnumerable <IImageWriterItem> ImageWriters) : base(Settings, Loc) { _videoSourcesViewModel = VideoSourcesViewModel; _systemTray = SystemTray; _regionProvider = RegionProvider; _mainWindow = MainWindow; _sourcePicker = SourcePicker; _audioPlayer = AudioPlayer; this.DiskWriter = DiskWriter; this.ClipboardWriter = ClipboardWriter; this.ImgurWriter = ImgurWriter; AvailableImageWriters = ImageWriters.ToList(); if (!AvailableImageWriters.Any(M => M.Active)) { AvailableImageWriters[0].Active = true; } ScreenShotCommand = new DelegateCommand(() => CaptureScreenShot()); ScreenShotActiveCommand = new DelegateCommand(async() => await SaveScreenShot(ScreenShotWindow(Window.ForegroundWindow))); ScreenShotDesktopCommand = new DelegateCommand(async() => await SaveScreenShot(ScreenShotWindow(Window.DesktopWindow))); ScreenshotRegionCommand = new DelegateCommand(async() => await ScreenshotRegion()); ScreenshotWindowCommand = new DelegateCommand(async() => await ScreenshotWindow()); ScreenshotScreenCommand = new DelegateCommand(async() => await ScreenshotScreen()); }
public RecordingViewModel(RecordingModel RecordingModel, Settings Settings, TimerModel TimerModel, WebcamModel WebcamModel, VideoSourcesViewModel VideoSourcesViewModel, VideoWritersViewModel VideoWritersViewModel, ISystemTray SystemTray, IMainWindow MainWindow, ILocalizationProvider Loc, IAudioPlayer AudioPlayer, IRecentList RecentList, IMessageProvider MessageProvider, AudioSourceViewModel AudioSourceViewModel, IFFmpegViewsProvider FFmpegViewsProvider) : base(Settings, Loc) { _recordingModel = RecordingModel; _timerModel = TimerModel; _videoSourcesViewModel = VideoSourcesViewModel; _videoWritersViewModel = VideoWritersViewModel; _systemTray = SystemTray; _mainWindow = MainWindow; _audioPlayer = AudioPlayer; _recentList = RecentList; _messageProvider = MessageProvider; _audioSourceViewModel = AudioSourceViewModel; _ffmpegViewsProvider = FFmpegViewsProvider; var hasAudio = new[] { Settings .Audio .ObserveProperty(M => M.RecordMicrophone), Settings .Audio .ObserveProperty(M => M.RecordSpeaker) } .CombineLatest(M => M[0] || M[1]); RecordCommand = new[] { hasAudio, VideoSourcesViewModel .ObserveProperty(M => M.SelectedVideoSourceKind) .Select(M => M is NoVideoSourceProvider), VideoSourcesViewModel .ObserveProperty(M => M.SelectedVideoSourceKind) .Select(M => M is WebcamSourceProvider), WebcamModel .ObserveProperty(M => M.SelectedCam) .Select(M => M is NoWebcamItem), Settings .Video .ObserveProperty(M => M.RecorderMode) .Select(M => M == RecorderMode.Steps), VideoSourcesViewModel .ObserveProperty(M => M.SelectedVideoSourceKind) .Select(M => M.SupportsStepsMode), } .CombineLatest(M => { var audioEnabled = M[0]; var audioOnlyMode = M[1]; var webcamMode = M[2]; var noWebcam = M[3]; var stepsMode = M[4]; var supportsStepsMode = M[5]; if (stepsMode) { return(supportsStepsMode); } if (audioOnlyMode) { return(audioEnabled); } if (webcamMode) { return(!noWebcam); } return(true); }) .ToReactiveCommand() .WithSubscribe(OnRecordExecute); PauseCommand = new[] { TimerModel .ObserveProperty(M => M.Waiting), RecordingModel .ObserveProperty(M => M.RecorderState) .Select(M => M != Models.RecorderState.NotRecording) } .CombineLatest(M => !M[0] && M[1]) .ToReactiveCommand() .WithSubscribe(() => { _audioPlayer.Play(SoundKind.Pause); RecordingModel.OnPauseExecute(); }); RecorderState = RecordingModel .ObserveProperty(M => M.RecorderState) .ToReadOnlyReactivePropertySlim(); TimerModel.DurationElapsed += () => { _syncContext.Run(async() => await StopRecording(), true); }; }
internal FlowMate(IApplication application, IResourceService resourceService, ISystemTray systemTray) { _resourceService = resourceService; _systemTray = systemTray; _application = application; }
public RootStatusChangedNotificationHandler(ISystemTray sysTray) => _sysTray = sysTray;