private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (!IsPreferenceVisible) ListGridView.Columns.Remove(PreferenceColumn); if (!IsIntensityVisible) ListGridView.Columns.Remove(IntensityColumn); if (!IsCustomVisible) ListGridView.Columns.Remove(CustomColumn); if (!AllowMultiSelect) ListGridView.Columns.Remove(SelectionColumn); if (!IsStatusVisible) ListGridView.Columns.Remove(StatusColumn); VideosView.SelectionMode = AllowMultiSelect ? SelectionMode.Multiple : SelectionMode.Single; // Grid column width does not include zoom. double ColWidth = ListGridView.Columns.Where(c => c != TitleColumn).Sum(c => c.ActualWidth); TitleColumn.Width = (this.ActualWidth / Business.Settings.Zoom) - ColWidth - 28 * Business.Settings.Zoom; if (DesignerProperties.GetIsInDesignMode(this)) return; lastHeaderClicked = ((GridView)VideosView.View).Columns[0]; Window.GetWindow(this).Closed += MediaGrid_Closed; if (IsolatedPlayer) { player = SessionCore.Instance.GetNewPlayer(); player.SetPath(); player.AllowClose = true; } // Bind PreviewKeyDown to every TextBox on the page. foreach (TextBox item in Window.GetWindow(this).FindVisualChildren<TextBox>()) { item.PreviewKeyDown += SearchTextControl_PreviewKeyDown; } }
public SetupWizard() { InitializeComponent(); helper = new WindowHelper(this); Player = SessionCore.Instance.GetNewPlayer(); Player.SetPath(); Player.AllowClose = true; }
/// <summary> /// Uses specified player business object to play the session. /// </summary> /// <param name="player">The player business object through which to play the session.</param> public void SetPlayer(IMediaPlayerBusiness player) { player.SetPath(); if (this.player != null) { player.AllowClose = this.player.AllowClose; if (this.player.CurrentVideo != null) { player.CurrentVideo = this.player.CurrentVideo; } } // If changing player, close the previous one. if (this.player != null) { this.player.Close(); } this.player = player; player.PlayNext += player_PlayNext; player.NowPlaying += player_NowPlaying; player.Pause += player_Pause; player.Resume += player_Resume; if (player.CurrentVideo != null) { player.PlayVideoAsync(player.CurrentVideo, false); } }
/// <summary> /// Displays a window to edit specified video. /// </summary> public static EditVideoWindow Instance(Guid? videoId, string fileName, IMediaPlayerBusiness player, ClosingCallback callback) { EditVideoWindow NewForm = new EditVideoWindow(); if (videoId != null && videoId != Guid.Empty) NewForm.videoId = videoId; else NewForm.fileName = fileName; NewForm.player = player; NewForm.callback = callback; SessionCore.Instance.Windows.Show(NewForm); return NewForm; }
private async void Window_Loaded(object sender, RoutedEventArgs e) { timerChangeFilters = new DispatcherTimer(); timerChangeFilters.Interval = TimeSpan.FromSeconds(1); timerChangeFilters.Tick += timerChangeFilters_Tick; lastHeaderClicked = ((GridView)VideosView.View).Columns[0]; this.DataContext = settings; player = SessionCore.Instance.GetNewPlayer(); player.SetPath(); player.AllowClose = true; RatingCategoryCombo.ItemsSource = await business.GetRatingCategoriesAsync(true); await LoadDataAsync(); }
public PlayerBusiness(IMediaPlayerBusiness player) { FilterSettings = new SearchSettings(); FilterSettings.MediaType = MediaType.Video; timerSession = new DispatcherTimer(); timerSession.Interval = TimeSpan.FromSeconds(1); timerSession.Tick += sessionTimer_Tick; timerChangeConditions = new DispatcherTimer(); timerChangeConditions.Interval = TimeSpan.FromSeconds(1); timerChangeConditions.Tick += timerChangeConditions_Tick; if (player != null) SetPlayer(player); }
/// <summary> /// Displays a popup containing the FileBinding menu features. /// </summary> public static EditVideoWindow InstancePopup(UIElement target, PlacementMode placement, Guid? videoId, string fileName, IMediaPlayerBusiness player, ClosingCallback callback) { EditVideoWindow NewForm = new EditVideoWindow(); NewForm.isPopup = true; NewForm.videoId = videoId; if (videoId != null && videoId != Guid.Empty) NewForm.videoId = videoId; else NewForm.fileName = fileName; NewForm.player = player; NewForm.callback = callback; WindowHelper.SetScale(NewForm.FileBindingButton.ContextMenu); NewForm.Window_Loaded(null, null); NewForm.ShowFileBindingMenu(target, placement); return NewForm; }
public PlayerBusiness(IMediaPlayerBusiness player) { FilterSettings = new SearchSettings(); FilterSettings.MediaType = MediaType.Video; timerSession = new DispatcherTimer(); timerSession.Interval = TimeSpan.FromSeconds(1); timerSession.Tick += sessionTimer_Tick; timerChangeConditions = new DispatcherTimer(); timerChangeConditions.Interval = TimeSpan.FromSeconds(1); timerChangeConditions.Tick += timerChangeConditions_Tick; if (player != null) { SetPlayer(player); } }
private async void UserControl_Loaded(object sender, RoutedEventArgs e) { StoryboardOpenDetail = (Storyboard)FindResource("StoryboardOpenDetail"); StoryboardCloseDetail = (Storyboard)FindResource("StoryboardCloseDetail"); if (!IsPreferenceVisible) ListGridView.Columns.Remove(PreferenceColumn); if (!IsIntensityVisible) ListGridView.Columns.Remove(IntensityColumn); if (!IsCustomVisible) ListGridView.Columns.Remove(CustomColumn); if (!AllowMultiSelect) ListGridView.Columns.Remove(SelectionColumn); if (!IsStatusVisible) ListGridView.Columns.Remove(StatusColumn); VideosView.SelectionMode = AllowMultiSelect ? SelectionMode.Multiple : SelectionMode.Single; if (DesignerProperties.GetIsInDesignMode(this)) return; lastHeaderClicked = ((GridView)VideosView.View).Columns[0]; Window.GetWindow(this).Closed += MediaGrid_Closed; if (IsolatedPlayer) { player = SessionCore.Instance.GetNewPlayer(); player.SetPath(); player.AllowClose = true; } // Bind to parent window Window.GetWindow(this).PreviewKeyDown += Window_PreviewKeyDown; // Bind to search box. var ParentBoxes = Window.GetWindow(this).FindVisualChildren<TextBox>(); if (FocusControl == null && ParentBoxes.Count() > 0) FocusControl = ParentBoxes.First(); // Bind PreviewKeyDown to every TextBox on the page. foreach (TextBox item in ParentBoxes) { item.PreviewKeyDown += SearchTextControl_PreviewKeyDown; } await LoadCategoriesAsync(); isFormLoaded = true; }
/// <summary> /// Uses specified player business object to play the session. /// </summary> /// <param name="player">The player business object through which to play the session.</param> public void SetPlayer(IMediaPlayerBusiness player) { player.SetPath(); if (this.player != null) { player.AllowClose = this.player.AllowClose; if (this.player.CurrentVideo != null) player.CurrentVideo = this.player.CurrentVideo; } // If changing player, close the previous one. if (this.player != null) this.player.Close(); this.player = player; player.PlayNext += player_PlayNext; player.NowPlaying += player_NowPlaying; player.Pause += player_Pause; player.Resume += player_Resume; if (player.CurrentVideo != null) player.PlayVideoAsync(player.CurrentVideo); }