~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FilterOptions.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
{
32
32
        public class FilterOptions
33
33
        {
 
34
                private static readonly char [] separators = {';'};
 
35
 
 
36
                private string file_mask;
 
37
                private string [] split_file_masks;
 
38
 
34
39
                public string FileMask {
35
 
                        get;
36
 
                        set;
 
40
                        get {
 
41
                                return file_mask;
 
42
                        }
 
43
                        set {
 
44
                                file_mask = value;
 
45
 
 
46
                                if (file_mask == null) {
 
47
                                        split_file_masks = null;
 
48
                                }
 
49
                                else {
 
50
                                        split_file_masks = file_mask.Split (separators, StringSplitOptions.RemoveEmptyEntries);
 
51
                                }
 
52
                        }
37
53
                }
38
 
                
 
54
 
 
55
 
39
56
                public bool CaseSensitive {
40
57
                        get;
41
58
                        set;
53
70
                
54
71
                public bool NameMatches (string name)
55
72
                {
56
 
                        if (string.IsNullOrEmpty (FileMask) || FileMask == "*")
 
73
                        if (string.IsNullOrEmpty (FileMask) || FileMask == "*" || split_file_masks == null)
57
74
                                return true;
58
 
                        return new PatternMatcher (FileMask).Match (name);
 
75
 
 
76
                        foreach (string mask in split_file_masks) {
 
77
                                if (new PatternMatcher (mask).Match (System.IO.Path.GetFileName (name))) 
 
78
                                        return true;
 
79
                        }
 
80
 
 
81
                        return false;
59
82
                }
60
83
                
61
84
                public static bool IsWordSeparator (char ch)