public int GetImageIndex(LockError error) { if (!error.IsFile) { return(1); } string ext = Path.GetExtension(error.Path); if (!IconMap.ContainsKey(ext)) { IconMap[ext] = ErrorList.SmallImageList.Count; Bitmap img = Win32.GetIcon(ext); if (img == null) { img = new Bitmap(16, 16); } ErrorList.SmallImageList.Add(img); } return(IconMap[ext]); }
public ErrorItem(LockMessage parent, LockError error) { Error = error; ImageIndex = parent.GetImageIndex(error); Text = error.Path.Replace(parent.RootPath, ""); if (error.Message.Length > 0) { Text += " (" + error.Message + ")"; } }
public bool CreateFolder(string path, List <LockError> errors, bool subs) { try { Directory.CreateDirectory(path); } catch (Exception ex) { LockError error = new LockError(path, ex.Message, true, LockErrorType.Unexpected); error.Subs = subs; errors.Add(error); return(false); } return(true); }
private void OnLockError(Lock @lock, ErrorCodes error) { LockError?.Invoke(@lock, error); }