Example #1
0
File: Paths.cs Project: timfplab/fp
        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);
        }
Example #2
0
File: Paths.cs Project: timfplab/fp
 public override int GetHashCode(PathsItem obj)
 {
     return(obj.GetHashCode());
 }
Example #3
0
File: Paths.cs Project: timfplab/fp
 public override bool Equals(PathsItem x, PathsItem y)
 {
     return(StringComparer.OrdinalIgnoreCase.Equals(x.Path.Trim(), y.Path.Trim()));
 }