Exemplo n.º 1
0
        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]);
        }
Exemplo n.º 2
0
        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 + ")";
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 private void OnLockError(Lock @lock, ErrorCodes error)
 {
     LockError?.Invoke(@lock, error);
 }