/// ------------------------------------------------------------------------------------ /// <summary> /// Called when views is activated. /// </summary> /// ------------------------------------------------------------------------------------ public override void ViewActivated(bool firstTime) { base.ViewActivated(firstTime); if (_refreshNeeded || firstTime) { RefreshSessionList(); _refreshNeeded = false; } if (firstTime) { if (Settings.Default.SessionVwSplitterPos > 0) { splitOuter.SplitterDistance = Settings.Default.SessionVwSplitterPos; } Sponge.SetGridColumnWidthsFromString(gridFiles, Settings.Default.SessionFileCols); // Setting up drap/drop crashes when there is no hosting form, // so make sure we're being hosted before doing so. if (FindForm() != null) { splitFileTab.AllowDrop = true; splitFileTab.DragOver += FileListDragOver; splitFileTab.DragDrop += FileListDragDrop; } } }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ public NewSessionsFromFilesDlg(NewSessionsFromFileDlgViewModel viewModel) { InitializeComponent(); _instructionsLabel.Text = string.Format(_instructionsLabel.Text, Application.ProductName); _progressPanel.Visible = false; _noFilesSelectedCreateButtonText = LocalizationManager.LocalizeString( "NewSessionsFromFilesDlg.NoFilesSelectedCreateButtonText", "Create Sessions", "Text in create button when no files are selected.", "Dialog Boxes", LocalizationCategory.Button, LocalizationPriority.High); _filesSelectedCreateButtonText = LocalizationManager.LocalizeString( "NewSessionsFromFilesDlg.FilesSelectedCreateButtonText", "Create {0} Sessions", "Format text in create button when one or more files are selected.", "Dialog Boxes", LocalizationCategory.Button, LocalizationPriority.High); var rc = Settings.Default.NewSessionsFromFilesDlgBounds; if (rc.Height < 0) { StartPosition = FormStartPosition.CenterScreen; } else { Bounds = rc; } Sponge.SetGridColumnWidthsFromString(_filesGrid, Settings.Default.NewSessionsFromFilesDlgCols); _folderMissingMsgCtrl = new NewSessionsFromFilesDlgFolderNotFoundMsg(); _filesPanel.Controls.Add(_folderMissingMsgCtrl); _folderMissingMsgCtrl.BringToFront(); _mediaPlayerPanel.BorderStyle = BorderStyle.None; #if !MONO _winMediaPlayer = new AxWindowsMediaPlayer(); ((ISupportInitialize)(_winMediaPlayer)).BeginInit(); _winMediaPlayer.Dock = DockStyle.Fill; _winMediaPlayer.Name = "_winMediaPlayer"; _mediaPlayerPanel.Controls.Add(_winMediaPlayer); ((ISupportInitialize)(_winMediaPlayer)).EndInit(); _winMediaPlayer.settings.autoStart = false; #endif DialogResult = DialogResult.Cancel; new CheckBoxColumnHeaderHandler(_selectedCol); _viewModel = viewModel; }