using System; using System.Collections.Generic; using System.Drawing; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Uestc.Auto6.Dso.ComModel; using Uni_Trend.MSO7000X.UserControls; namespace Uestc.Auto6.Dso.U2 { public partial class FileBrowserForm : Uni_Trend.MSO7000X.UserControls.FileBrowserForm { public static FileBrowserForm Instance { get; } = new FileBrowserForm(); private FileBrowserForm() { StartPosition = FormStartPosition.CenterScreen; CanClose = false; IsShowPin = false; this.IsShowPin = FixedToolIconInfos[2].IsShow = false; SetFileTypeExtensionDelegate(new Func(x => x.GetAlias())); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); HeadBackColor = Color.FromArgb(62, 62, 62); } public override void SetFileFilter(IEnumerable fts) { if (!fts.Any()) { EventBus.EventBroker.Instance.GetEvent().Publish(new Object(), new EventBus.LogEventArgs($"The arugmant '{nameof(fts)}' is empty or null in the function '{nameof(SetFileFilter)}'", EventBus.LogLevel.Error)); #if DEBUG throw new ArgumentException(null, nameof(fts)); #else return; #endif } ComboBoxEx cbxfiletype = base.GetFileTypeCb(); cbxfiletype.DataSource = fts.Select(x => new KeyValuePair(x.ToString() + $"(.{x.GetAlias()})", x)).ToList(); cbxfiletype.DisplayMember = "Key"; cbxfiletype.ValueMember = "Value"; } } }