Пример #1
0
        private SourceInfo getSourceInfo(FileInfo fileInfo)
        {
            string     type       = DataSourceUtil.GetSourceType(fileInfo);
            SourceInfo sourceInfo = new SourceInfo(new MsDataFilePath(fileInfo.FullName))
            {
                type       = type,
                imageIndex = (DataSourceUtil.IsUnknownType(type) ? ImageIndex.UnknownFile : ImageIndex.MassSpecFile),
                name       = fileInfo.Name
            };

            if (!sourceInfo.isUnknown)
            {
                if (listView.View != View.Details ||
                    (sourceTypeComboBox.SelectedIndex > 0 &&
                     sourceTypeComboBox.SelectedItem.ToString() != sourceInfo.type))
                {
                    return(sourceInfo);
                }
                sourceInfo.size         = (UInt64)fileInfo.Length;
                sourceInfo.dateModified = GetSafeDateModified(fileInfo);
                return(sourceInfo);
            }
            return(null);
        }