/// <summary> /// Constructor /// /// Create a StealthNetLink from a shared file. /// Use this contructor to display this link with method /// </summary> /// <param name="sharedFile">sharedFile object to construct the link from</param> /// <param name="htmlLink">true, if the string representation of this link should contain a html link</param> public StealthNetLink(SharedFile sharedFile, bool htmlLink) { m_FileHash = sharedFile.FileHash; m_FileName = sharedFile.FileName; m_FileSize = sharedFile.FileSize; m_htmlLink = htmlLink; }
public SharedFileInformationControl(SharedFile sharedFile) { InitializeComponent(); m_SharedFile = sharedFile; try { // 2008-10-21 Eroli: Mono-Fix if (!UtilitiesForMono.IsRunningOnMono) iconPictureBox.Image = ShellIcon.GetLargeSystemIcon(sharedFile.FileName); } catch { } fileNameTextBox.Text = m_SharedFile.FileName; fileSizeTextBox.Text = m_SharedFile.FileSizeString; fileHashTextBox.Text = m_SharedFile.FileHashString; commentTextBox.Text = sharedFile.Comment; switch (m_SharedFile.Rating) { case 1: ratingGoodRadioButton.Checked = true; break; case 2: ratingNeutralRadioButton.Checked = true; break; case 3: ratingBadRadioButton.Checked = true; break; default: ratingUnknownRadioButton.Checked = true; break; } }
private void Skip(int selectedIndex) { toolStripContainer.ContentPanel.Controls.Clear(); if (Core.SharedFiles.ContainsKey(((RandomTag <string>)m_DataGridView.Rows[selectedIndex].Tag).Tag)) { SharedFile sharedFile = Core.SharedFiles[((RandomTag <string>)m_DataGridView.Rows[selectedIndex].Tag).Tag]; if (m_InformationControl != null) { m_InformationControl.Dispose(); } m_InformationControl = new SharedFileInformationControl(sharedFile); m_InformationControl.Dock = DockStyle.Fill; informationToolStripButton.PerformClick(); } }
private Image GetRatingImage(SharedFile sharedFile) { if (sharedFile == null) { throw new ArgumentNullException("sharedFile"); } switch (sharedFile.Rating) { case 1: return(Properties.Resources.rating1_16x16); case 2: return(Properties.Resources.rating2_16x16); case 3: return(Properties.Resources.rating3_16x16); default: return(Properties.Resources.rating0_16x16); } }
public SharedFileInformationControl(SharedFile sharedFile) { InitializeComponent(); m_SharedFile = sharedFile; try { // 2008-10-21 Eroli: Mono-Fix if (!UtilitiesForMono.IsRunningOnMono) { iconPictureBox.Image = ShellIcon.GetLargeSystemIcon(sharedFile.FileName); } } catch { } fileNameTextBox.Text = m_SharedFile.FileName; fileSizeTextBox.Text = m_SharedFile.FileSizeString; fileHashTextBox.Text = m_SharedFile.FileHashString; commentTextBox.Text = sharedFile.Comment; switch (m_SharedFile.Rating) { case 1: ratingGoodRadioButton.Checked = true; break; case 2: ratingNeutralRadioButton.Checked = true; break; case 3: ratingBadRadioButton.Checked = true; break; default: ratingUnknownRadioButton.Checked = true; break; } }
private Image GetRatingImage(SharedFile sharedFile) { if (sharedFile == null) throw new ArgumentNullException("sharedFile"); switch (sharedFile.Rating) { case 1: return Properties.Resources.rating1_16x16; case 2: return Properties.Resources.rating2_16x16; case 3: return Properties.Resources.rating3_16x16; default: return Properties.Resources.rating0_16x16; } }