示例#1
0
        // Token: 0x06000C6B RID: 3179 RVA: 0x00043D1C File Offset: 0x00041F1C
        private static SelectionCriterion _ParseCriterion(string s)
        {
            if (s == null)
            {
                return(null);
            }
            s = FileSelector.NormalizeCriteriaExpression(s);
            if (s.IndexOf(" ") == -1)
            {
                s = "name = " + s;
            }
            string[] array = s.Trim().Split(new char[]
            {
                ' ',
                '\t'
            });
            if (array.Length < 3)
            {
                throw new ArgumentException(s);
            }
            SelectionCriterion selectionCriterion  = null;
            Stack <FileSelector.ParseState> stack  = new Stack <FileSelector.ParseState>();
            Stack <SelectionCriterion>      stack2 = new Stack <SelectionCriterion>();

            stack.Push(FileSelector.ParseState.Start);
            int i = 0;

            while (i < array.Length)
            {
                string text = array[i].ToLower();
                string key;
                if ((key = text) != null)
                {
                    if (< PrivateImplementationDetails > { 0FE034E3 - 13E4 - 4121 - 9910 - ADD6363B8EF6 }.$$method0x6000c55 - 1 == null)
示例#2
0
 // Token: 0x06000C65 RID: 3173 RVA: 0x00043AB1 File Offset: 0x00041CB1
 public FileSelector(string selectionCriteria, bool traverseDirectoryReparsePoints)
 {
     if (!string.IsNullOrEmpty(selectionCriteria))
     {
         this._Criterion = FileSelector._ParseCriterion(selectionCriteria);
     }
     this.TraverseReparsePoints = traverseDirectoryReparsePoints;
 }
示例#3
0
        public DemonstrateFileSelector(string[] args)
        {
            this._directory = ".";
            this._recurse   = true;
            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i])
                {
                case "-?":
                    Usage();
                    Environment.Exit(0);
                    break;

                case "-directory":
                    i++;
                    if (args.Length <= i)
                    {
                        throw new ArgumentException("-directory");
                    }
                    this._directory = args[i];
                    break;

                case "-norecurse":
                    this._recurse = false;
                    break;

                default:
                    if (this._selectionCriteria != null)
                    {
                        throw new ArgumentException(args[i]);
                    }
                    this._selectionCriteria = args[i];
                    break;
                }


                if (this._selectionCriteria != null)
                {
                    this.f = new FileSelector(this._selectionCriteria);
                }
            }
        }
示例#4
0
        public void Run()
        {
            if (this.f == null)
            {
                this.f = new FileSelector("name = *.jpg AND (size > 1000 OR atime < 2009-02-14-00:00:00)");
            }
            Console.WriteLine("\nSelecting files:\n" + this.f.ToString());
            var files = this.f.SelectFiles(this._directory, this._recurse);

            if (files.Count == 0)
            {
                Console.WriteLine("no files.");
            }
            else
            {
                Console.WriteLine("files: {0}", files.Count);
                foreach (string file in files)
                {
                    Console.WriteLine("  " + file);
                }
            }
        }
示例#5
0
 public void Run()
 {
     if (this.f == null)
     {
         this.f = new FileSelector("name = *.jpg AND (size > 1000 OR atime < 2009-02-14-00:00:00)");
     }
     Console.WriteLine("\nSelecting files:\n" + this.f.ToString());
     var files = this.f.SelectFiles(this._directory, this._recurse);
     if (files.Count == 0)
     {
         Console.WriteLine("no files.");
     }
     else
     {
         Console.WriteLine("files: {0}", files.Count);
         foreach (string file in files)
         {
             Console.WriteLine("  " + file);
         }
     }
 }
示例#6
0
        public DemonstrateFileSelector(string[] args)
        {
            this._directory = ".";
            this._recurse = true;
            for (int i = 0; i < args.Length; i++)
            {
                switch(args[i])
                {
                case"-?":
                    Usage();
                    Environment.Exit(0);
                    break;
                case "-directory":
                    i++;
                    if (args.Length <= i)
                    {
                        throw new ArgumentException("-directory");
                    }
                    this._directory = args[i];
                    break;
                case "-norecurse":
                    this._recurse = false;
                    break;

                default:
                    if (this._selectionCriteria != null)
                    {
                        throw new ArgumentException(args[i]);
                    }
                    this._selectionCriteria = args[i];
                    break;
                }


                if (this._selectionCriteria != null)
                {
                    this.f = new FileSelector(this._selectionCriteria);
                }
            }
        }