Exemple #1
0
        public PathsItem AddUniqueItem(string pathValue, bool blnIsComputerFolder)
        {
            if (string.IsNullOrEmpty(pathValue) || pathValue.Trim() == string.Empty ||
                !PathAnalysis.IsValidPath(pathValue.Trim()))
            {
                return(null);
            }

            var pathItem = new PathsItem();

            pathItem.Path             = Functions.GetPathFolder(pathValue.Trim());
            pathItem.IsComputerFolder = blnIsComputerFolder;
            if (Items.Contains(pathItem, new CaseInsensitiveFolderItemComparer <PathsItem>()))
            {
                return(Items.FirstOrDefault(r => r.Path.ToLower() == pathItem.Path.ToLower()));
            }
            Items.Add(pathItem);
            return(pathItem);
        }
Exemple #2
0
 public override int GetHashCode(PathsItem obj)
 {
     return(obj.GetHashCode());
 }
Exemple #3
0
 public override bool Equals(PathsItem x, PathsItem y)
 {
     return(StringComparer.OrdinalIgnoreCase.Equals(x.Path.Trim(), y.Path.Trim()));
 }