private void MenuItemCS_Click(object sender, RoutedEventArgs e) { MenuItem menuItem = e.OriginalSource as MenuItem; if (menuItem == null) { return; } var fileDialog = new Microsoft.Win32.OpenFileDialog() { Multiselect = false, Title = "Content Sharing" }; if (menuItem == this.MenuItemCS_SendFile) { if (fileDialog.ShowDialog() == true) { this.SendFile(fileDialog.FileName); } } else if (menuItem == this.MenuItemCS_ShareImage) { fileDialog.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG"; // From IR.79 if (fileDialog.ShowDialog() == true) { this.SendFile(fileDialog.FileName); } } else if (menuItem == this.MenuItemCS_ShareVideo) { } else if (menuItem == this.MenuItemCS_ShareApp) { if (this.AVSession != null && this.AVSession.IsConnected) { if ((this.AVSession.MediaType & MediaType.Videobfcp) == MediaType.Videobfcp) { this.StopSharingApp(); } else { runningAppsWindow = new RunningAppsWindow(); runningAppsWindow.Owner = this; runningAppsWindow.onAppSelectedEvent += (_sender, _e) => { runningAppToShare = (_sender as RunningApp); this.StartSharingApp(); }; runningAppsWindow.ShowDialog(); runningAppsWindow = null; } } } }
private void MenuItemCS_Click(object sender, RoutedEventArgs e) { MenuItem menuItem = e.OriginalSource as MenuItem; if (menuItem == null) return; var fileDialog = new Microsoft.Win32.OpenFileDialog() { Multiselect = false, Title = "Content Sharing" }; if (menuItem == this.MenuItemCS_SendFile) { if (fileDialog.ShowDialog() == true) { this.SendFile(fileDialog.FileName); } } else if (menuItem == this.MenuItemCS_ShareImage) { fileDialog.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG"; // From IR.79 if (fileDialog.ShowDialog() == true) { this.SendFile(fileDialog.FileName); } } else if (menuItem == this.MenuItemCS_ShareVideo) { } else if (menuItem == this.MenuItemCS_ShareApp) { if (this.AVSession != null && this.AVSession.IsConnected) { if ((this.AVSession.MediaType & MediaType.Videobfcp) == MediaType.Videobfcp) { this.StopSharingApp(); } else { runningAppsWindow = new RunningAppsWindow(); runningAppsWindow.Owner = this; runningAppsWindow.onAppSelectedEvent += (_sender, _e) => { runningAppToShare = (_sender as RunningApp); this.StartSharingApp(); }; runningAppsWindow.ShowDialog(); runningAppsWindow = null; } } } }