public FileTabPage Create(FileDetails fileDetails, IContainer components, ContextMenuStrip contextMenuStrip) { var result = new FileTabPage(fileWriter); result.Initialize(fileDetails); contextMenuStrip.Items[0].Enabled = fileDetails != null; result.TextBox.ContextMenuStrip = contextMenuStrip; return(result); }
private void InitializeViews() { projectPage = new FileTabPage { Text = @"Project", Enabled = false }; tabViews.TabPages.Add(projectPage); hierarchyPage = new FileTabPage { Text = @"Hierarchy", Enabled = false }; tabViews.TabPages.Add(hierarchyPage); }
private void CloseTabPage(FileTabPage fileTabPage) { tabControl.TabPages.Remove(fileTabPage); if (fileTabPage.FileDetails != null) { if (options.OpenedFiles == fileTabPage.FileDetails.FileName) { options.OpenedFiles = String.Empty; } else { options.OpenedFiles = options.OpenedFiles.EndsWith($";{fileTabPage.FileDetails.FileName}") ? options.OpenedFiles.Replace($";{fileTabPage.FileDetails.FileName}", String.Empty) : options.OpenedFiles.Replace($"{fileTabPage.FileDetails.FileName};", String.Empty); } } }
private void CloseTabPage(FileTabPage fileTabPage) { tabControl.TabPages.Remove(fileTabPage); //if (fileTabPage.FileDetails != null) //{ // if (options.OpenedFiles == fileTabPage.FileDetails.FileName) // { // options.OpenedFiles = String.Empty; // } // else // { // options.OpenedFiles = options.OpenedFiles.EndsWith($";{fileTabPage.FileDetails.FileName}") // ? options.OpenedFiles.Replace($";{fileTabPage.FileDetails.FileName}", String.Empty) // : options.OpenedFiles.Replace($"{fileTabPage.FileDetails.FileName};", String.Empty); // } //} }