コード例 #1
0
ファイル: Model.cs プロジェクト: speecyy/xrefresh
 public bool PassesGlobalExcludes(string path)
 {
     // it must not match any global exclude
     foreach (GlobalExcludeFiltersRow row in GlobalExcludeFilters)
     {
         FileMask wildcard = new FileMask(row.Mask);
         if (wildcard.IsMatch(path))
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #2
0
ファイル: FilterTable.cs プロジェクト: speecyy/xrefresh
        private string GetInfoForMask(string mask)
        {
            if (mask.Length == 0)
            {
                return("");
            }
            FileMask fileMask = new FileMask(mask);

            if (fileMask.type == FileMask.Type.Mask)
            {
                string ext = mask.Substring(2);
                return(ShellIcon.GetTypeInfo("x." + ext));
            }
            return(fileMask.GetTypeInfo());
        }
コード例 #3
0
ファイル: Model.cs プロジェクト: speecyy/xrefresh
        public bool PassesGlobalIncludes(string path, MatchReason reason)
        {
            // it must match at least one global include
            foreach (GlobalIncludeFiltersRow row in GlobalIncludeFilters)
            {
                FileMask wildcard = new FileMask(row.Mask);
                if (wildcard.IsMatch(path))
                {
                    reason.Set(row.Mask, MatchReason.Status.Included);
                    return(true);
                }
            }

            // didn't match any include
            return(false);
        }
コード例 #4
0
ファイル: Model.cs プロジェクト: speecyy/xrefresh
            public bool PassesLocalExcludes(string path, MatchReason reason)
            {
                ExcludeFiltersRow[] excludes = GetExcludeFiltersRows();

                // it must not match any global exclude
                foreach (ExcludeFiltersRow exclude in excludes)
                {
                    FileMask wildcard = new FileMask(exclude.Mask);
                    if (wildcard.IsMatch(path))
                    {
                        reason.Set(exclude.Mask, MatchReason.Status.Excluded);
                        return(false);
                    }
                }

                // passed excludes
                return(true);
            }
コード例 #5
0
ファイル: Model.cs プロジェクト: speecyy/xrefresh
            public bool PassesLocalIncludes(string path, MatchReason reason)
            {
                IncludeFiltersRow[] includes = GetIncludeFiltersRows();

                // it must match at least one global include
                foreach (IncludeFiltersRow include in includes)
                {
                    FileMask wildcard = new FileMask(include.Mask);
                    if (wildcard.IsMatch(path))
                    {
                        reason.Set(include.Mask, MatchReason.Status.Included);
                        return(true);
                    }
                }

                // didn't match any include
                return(false);
            }