예제 #1
0
        public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
        {
            switch (name.ToLowerInvariant())
            {
            case FilesTable:
                return(new FilesSource((string)parameters[0], (bool)parameters[1], interCommunicator));

            case DirectoriesTable:
                return(new DirectoriesSource((string)parameters[0], (bool)parameters[1], interCommunicator));

            case ZipTable:
                return(new ZipSource((string)parameters[0], interCommunicator));

            case ProcessesName:
                return(new ProcessesSource(interCommunicator));

            case Self:
                return(new OsSource());

            case DllsTable:
                return(new DllSource((string)parameters[0], (bool)parameters[1], interCommunicator));
            }

            throw new NotSupportedException($"Unsupported row source {name}");
        }
예제 #2
0
 public CsvSource(string filePath, string separator, bool hasHeader, int skipLines, InterCommunicator communicator)
 {
     _filePath     = filePath;
     _separator    = separator;
     _hasHeader    = hasHeader;
     _skipLines    = skipLines;
     _communicator = communicator;
 }
예제 #3
0
 public override RowSource GetRowSource(string name, InterCommunicator communicator, params object[] parameters)
 {
     if (_whenChecked == WhenCheckedParameters.OnSchemaTableOrRowSourceGet)
     {
         _onGetTableOrRowSource(parameters);
     }
     return(new EntitySource <TestEntity>(_entities, new Dictionary <string, int>(), new Dictionary <int, Func <TestEntity, object> >()));
 }
예제 #4
0
        public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
        {
            switch (name.ToLowerInvariant())
            {
            case "file":
                return(new FlatFileSource((string)parameters[0], interCommunicator));
            }

            throw new SourceNotFoundException(nameof(name));
        }
예제 #5
0
        public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
        {
            switch (name.ToLowerInvariant())
            {
            case Dual:
                return(new DualRowSource());
            }

            throw new NotSupportedException(name);
        }
예제 #6
0
파일: CsvSchema.cs 프로젝트: Eibwen/Musoq
        public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
        {
            switch (name.ToLowerInvariant())
            {
            case FileTable:
                parameters[3] = Convert.ToInt32(parameters[3]);
                return((CsvSource)Activator.CreateInstance(typeof(CsvSource), parameters.ExpandParameters(interCommunicator)));
            }

            throw new NotSupportedException();
        }
예제 #7
0
파일: TimeSchema.cs 프로젝트: Eibwen/Musoq
        public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
        {
            switch (name.ToLowerInvariant())
            {
            case "interval":
                return(new TimeSource(DateTimeOffset.Parse((string)parameters[0]), DateTimeOffset.Parse((string)parameters[1]),
                                      (string)parameters[2], interCommunicator));
            }

            throw new NotSupportedException($"Table {name} not found.");
        }
예제 #8
0
        public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
        {
            switch (name)
            {
            case "commits":
                return(new CommitsSource((string)parameters[0], SchemaGitHelper.CommitsNameToIndexMap,
                                         SchemaGitHelper.CommitsIndexToMethodAccessMap));

            case "tags":
                return(new TagsSource((string)parameters[0], SchemaGitHelper.TagsNameToIndexMap,
                                      SchemaGitHelper.TagsIndexToMethodAccessMap));

            case "branches":
                return(new BranchesSource((string)parameters[0], SchemaGitHelper.BranchesNameToIndexMap,
                                          SchemaGitHelper.BranchesIndexToMethodAccessMap));
            }

            throw new NotSupportedException(name);
        }
예제 #9
0
        public TimeSource(DateTimeOffset startAt, DateTimeOffset stopAt, string resolution, InterCommunicator communicator)
        {
            _startAt    = startAt;
            _resolution = resolution.ToLowerInvariant();

            switch (_resolution)
            {
            case "seconds":
                _stopAt = stopAt.Add(TimeSpan.FromMilliseconds(1));
                break;

            case "minutes":
                _stopAt = stopAt.AddSeconds(1);
                break;

            case "hours":
                _stopAt = stopAt.AddMinutes(1);
                break;

            case "days":
                _stopAt = stopAt.AddHours(1);
                break;

            case "months":
                _stopAt = stopAt.AddDays(1);
                break;

            case "years":
                _stopAt = stopAt.AddMonths(1);
                break;

            default:
                throw new NotSupportedException($"Chosen resolution '{_resolution}' is not supported.");
            }

            _communicator = communicator;
        }
예제 #10
0
파일: FilesSource.cs 프로젝트: fw1121/Musoq
 public FilesSource(string path, bool useSubDirectories, InterCommunicator communicator)
 {
     _communicator = communicator;
     _source       = new DirectorySourceSearchOptions(path, useSubDirectories);
 }
예제 #11
0
 public FlatFileSource(string filePath, InterCommunicator communicator)
 {
     _filePath     = filePath;
     _communicator = communicator;
 }
예제 #12
0
 public DirectoriesSource(string path, bool recursive, InterCommunicator communicator)
 {
     _communicator = communicator;
     _source       = new DirectorySourceSearchOptions(path, recursive);
 }
예제 #13
0
 public abstract RowSource GetRowSource(string name, InterCommunicator communicator, params object[] parameters);
예제 #14
0
 public ZipSource(string zipPath, InterCommunicator communicator)
 {
     _zipPath      = zipPath;
     _communicator = communicator;
 }
예제 #15
0
 public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
 {
     return(new TransientVariableSource(name));
 }
예제 #16
0
 public DllSource(string path, bool useSubDirectories, InterCommunicator communicator)
     : base(path, useSubDirectories, communicator)
 {
 }
예제 #17
0
 public override RowSource GetRowSource(string name, InterCommunicator communicator, params object[] parameters)
 {
     return(new JsonSource((string)parameters[0], communicator));
 }
예제 #18
0
 public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
 {
     return(new TableMetadataSource(_columns));
 }
예제 #19
0
 public TestDirectoriesSource(string path, bool recursive, InterCommunicator communicator)
     : base(path, recursive, communicator)
 {
 }
예제 #20
0
 public ProcessesSource(InterCommunicator communicator)
 {
     _communicator = communicator;
 }
예제 #21
0
파일: TestSchema.cs 프로젝트: fw1121/Musoq
 public override RowSource GetRowSource(string name, InterCommunicator interCommunicator, params object[] parameters)
 {
     return(new EntitySource <T>(_sources, TestNameToIndexMap, TestIndexToObjectAccessMap));
 }