Esempio n. 1
0
        private BoxedValue GetDirectoryFiles(BoxedValue options)
        {
            var directoryPath = options.SimpleProperty<string>("directory");

            var searchPattern = "*.*";
            if (options.Has("pattern")) searchPattern = options.SimpleProperty<string>("pattern");

            var recurse = SearchOption.TopDirectoryOnly;
            if (options.Has("recurse")) recurse = SearchOption.AllDirectories;

            var files = Directory.GetFiles(directoryPath, searchPattern, recurse);

            return files.ToBoxedValue(context.Environment);
        }
Esempio n. 2
0
        public static void TaskFunction(BoxedValue options)
        {
            var paths = options.ComplexProperty("Paths").ToArray<string>();
            var numberOfRetries = options.SimpleProperty<double>("NumberOfRetries");

            System.Console.WriteLine(numberOfRetries);
            TaskFunction(paths);
        }