private void FilesCtx_Opening(object sender, System.ComponentModel.CancelEventArgs e) { var hasItems = Files.SelectedItems.Count != 0; CtxOpenDirectory.Enabled = hasItems; if (!hasItems) { return; } var item = Files.SelectedItems[0] as ArchiveItem; if (item == null) { CtxOpenDirectory.Enabled = false; return; } CtxOpenDirectory.Image = FileIcon.GetIcon(item.BaseDirectory.FullName, FileIconSize.Small); }
public ArchiveItem(string aFileName, Guid aFormat, bool aNested) { format = aFormat; nested = aNested; SubItems.Add(string.Empty); SubItems.Add("Ready..."); file = new FileInfo(aFileName); parts.Add(aFileName, file); if (!Icons.Images.ContainsKey(file.Extension)) { Icons.Images.Add(file.Extension, FileIcon.GetIcon(file.FullName, FileIconSize.Small)); } ImageKey = file.Extension; StateImageIndex = 0; Invalidate(); }
public Main(bool autoProcess, string dir, string[] args) { auto = autoProcess; InitializeComponent(); Files.SmallImageList = Files.LargeImageList = ArchiveItem.Icons; StateIcons.Images.Add(Properties.Resources.idle); StateIcons.Images.Add(Properties.Resources.done); StateIcons.Images.Add(Properties.Resources.error); StateIcons.Images.Add(Properties.Resources.run); StateIcons.Images.Add(Properties.Resources.warning); Text = String.Format(CultureInfo.CurrentCulture, "{0} - {1}bit", Text, CpuInfo.IsX64 ? 64 : 32); About.Image = Icon.ToBitmap(); RefreshPasswordCount(); BrowseDestDialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); CtxOpenDirectory.Image = FileIcon.GetIcon(BrowseDestDialog.SelectedPath, FileIconSize.Small); Dests.AddRange(Config.Destinations.ToArray()); DestinationsChanged(); if (!string.IsNullOrEmpty(dir)) { Dests.Add(dir); } if (args != null && args.Length != 0) { AddFiles(args); } else { AdjustHeaders(); } }