public void GetFileExtension_StandardFile() { ResourceLink extCS = new DesktopFileSystemResourceLink("C:/Blub/Blub.cs"); ResourceLink extC = new DesktopFileSystemResourceLink("C:/Blub/Blub.c"); ResourceLink extNull = new DesktopFileSystemResourceLink("C:/Club/Blub"); ResourceLink extVB = new DesktopFileSystemResourceLink("C:/Club/Blub.cs.vb"); Assert.True(extCS.FileExtension == "cs"); Assert.True(extC.FileExtension == "c"); Assert.True(extNull.FileExtension == ""); Assert.True(extVB.FileExtension == "vb"); }
/// <summary> /// Updates the state of the dialog. /// </summary> private void UpdateDialogState() { // Information about currently opened file DesktopFileSystemResourceLink fileResourceLink = m_sceneManager.CurrentFile as DesktopFileSystemResourceLink; string fileName = string.Empty; if (fileResourceLink != null) { fileName = fileResourceLink.FileName; m_lblCurrentFile.Text = fileName; } else { m_lblCurrentFile.Text = "-"; } // Title string titleString = $"{SeeingSharpApplication.Current.ProductName} - {SeeingSharpApplication.Current.ProductVersion}"; if (!string.IsNullOrEmpty(fileName)) { titleString += $" ({fileName})"; } this.Text = titleString; // Handle import options m_propertiesImporter.SelectedObject = m_sceneManager.CurrentImportOptions; // Set enables / disables states m_propertiesImporter.Enabled = m_loadingTask == null; m_cmdReloadObject.Enabled = (m_sceneManager.CurrentImportOptions != null) && (m_loadingTask == null); m_cmdOpen.Enabled = m_loadingTask == null; m_cmdClose.Enabled = m_loadingTask == null; m_lblProgress.Visible = m_loadingTask != null; m_barProgress.Visible = m_loadingTask != null; }