Ejemplo n.º 1
0
 public SortingController(
     ILogger <SortingController> logger,
     ISortService sortService)
 {
     _logger          = logger;
     this.sortService = sortService;
 }
Ejemplo n.º 2
0
 public AlbumsService(LibraryContext context, IArtistsService artistsService, ISortService sortService, ITagsService tagsService)
 {
     _context        = context;
     _artistsService = artistsService;
     _sortService    = sortService;
     _tagsService    = tagsService;
 }
Ejemplo n.º 3
0
        private static void Main()
        {
            IServiceCollection serviceCollection = new ServiceCollection()
                                                   .AddLogging(configure => configure.AddConsole())
                                                   .AddPlugins(AppDomain.CurrentDomain.BaseDirectory);

            ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(new ServiceProviderOptions
            {
                ValidateScopes  = true,
                ValidateOnBuild = true
            });

            var pluginDictionary = serviceProvider
                                   .GetServices <IPlugin>()
                                   .ToDictionary(k => k.GetType().GetAssemblyName(), v => v);

            var sortServiceDictionary = serviceProvider
                                        .GetServices <ISortService>()
                                        .ToDictionary(k => k.GetType().GetAssemblyName(), v => v);

            foreach ((string assemblyName, IPlugin plugin) in pluginDictionary)
            {
                ISortService sortService = sortServiceDictionary[assemblyName];
                var          sortedArray = sortService.Sort((int[])Data.Clone());

                Console.WriteLine($"Name: {plugin.Name}");
                Console.WriteLine($"Results: {string.Join(", ", sortedArray)}");
            }
        }
Ejemplo n.º 4
0
 public ReportController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService,
     ICfgService cfgService,
     ISlugService slugService,
     IAppDataFolder appDataFolder,
     IClock clock,
     IBatchCreateService batchCreateService,
     IBatchWriteService batchWriteService,
     IBatchRunService batchRunService,
     IBatchRedirectService batchRedirectService,
     IFileService fileService
     )
 {
     _orchardServices      = services;
     _processService       = processService;
     _secureFileService    = secureFileService;
     _sortService          = sortService;
     _batchCreateService   = batchCreateService;
     _batchWriteService    = batchWriteService;
     _batchRunService      = batchRunService;
     _batchRedirectService = batchRedirectService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
Ejemplo n.º 5
0
 public FileLoader(IFileExplorerCommonHelper fileExplorerCommonHelper, IApplicationService applicationService, IDispatcherService dispatcherService)
 {
     this.filecommonhelper   = fileExplorerCommonHelper;
     this.applicationService = applicationService;
     this.dispatcherservice  = dispatcherService;
     GetSortService          = new SortService();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor for setting up organizer service.
 /// </summary>
 /// <param name="logger">Logger used for logging.</param>
 /// <param name="configuration">Configuration object containing information about settings.</param>
 /// <param name="context">Database context used for storing photo metadata.</param>
 /// <param name="sortService">Sort service used for sorting photos.</param>
 public OrganizerService(ILogger <IOrganizerService> logger, IConfiguration configuration, ISortService sortService, PhotoContext?context = null)
 {
     _logger        = logger;
     _configuration = configuration;
     _context       = context;
     _sortService   = sortService;
 }
Ejemplo n.º 7
0
        public TextController()
        {
            IRegExProvider regExProvider = new RegExProvider();

            this.statisticService = new StatisticService(regExProvider);
            this.sortService      = new SortService(regExProvider);
        }
Ejemplo n.º 8
0
 public SortController(
     ISortService sortService,
     IResourceService resourceService)
 {
     this.sortService     = sortService;
     this.resourceService = resourceService;
 }
Ejemplo n.º 9
0
 public DefaultResourceService(
     IFieldsToSerialize fieldsToSerialize,
     IEnumerable <IQueryParameterService> queryParameters,
     IJsonApiOptions options,
     ILoggerFactory loggerFactory,
     IResourceRepository <TResource, TId> repository,
     IResourceContextProvider provider,
     IResourceChangeTracker <TResource> resourceChangeTracker,
     IResourceFactory resourceFactory,
     IResourceHookExecutor hookExecutor = null)
 {
     _fieldsToSerialize   = fieldsToSerialize;
     _includeService      = queryParameters.FirstOrDefault <IIncludeService>();
     _sparseFieldsService = queryParameters.FirstOrDefault <ISparseFieldsService>();
     _pageService         = queryParameters.FirstOrDefault <IPageService>();
     _sortService         = queryParameters.FirstOrDefault <ISortService>();
     _filterService       = queryParameters.FirstOrDefault <IFilterService>();
     _options             = options;
     _logger                 = loggerFactory.CreateLogger <DefaultResourceService <TResource, TId> >();
     _repository             = repository;
     _resourceChangeTracker  = resourceChangeTracker;
     _resourceFactory        = resourceFactory;
     _hookExecutor           = hookExecutor;
     _currentRequestResource = provider.GetResourceContext <TResource>();
 }
Ejemplo n.º 10
0
 public BindingListSortService(List <T> unsortedList, DataGridView grid, SortConfiguration sortConfiguration, ISortService <T> sortService)
 {
     _unsortedList      = unsortedList;
     _grid              = grid;
     _sortConfiguration = sortConfiguration;
     _sortService       = sortService;
 }
Ejemplo n.º 11
0
 private void InitializeComponents()
 {
     Service          = FSCore.Service;
     StartupForm      = new StartupForm();
     ProgressForm     = new ProgressForm();
     BackgroundWorker = new BackgroundWorker();
 }
Ejemplo n.º 12
0
        private static void SortByGenderAndLastNameAscending(ISortService sortService, IList <Person> unsortedList)
        {
            IList <Person> sortedByGender = sortService.SortByGenderAndLastNameAscending(unsortedList);

            Console.WriteLine(" ");
            Console.WriteLine("Sorted by gender and by last name ascending.");
            PrintList(sortedByGender);
        }
Ejemplo n.º 13
0
        private static void SortByBirthDateAscending(ISortService sortService, IList <Person> unsortedList)
        {
            IList <Person> sortedByBirthdate = sortService.SortByBirthDateAscending(unsortedList);

            Console.WriteLine(" ");
            Console.WriteLine("Sorted by date of birth ascending.");
            PrintList(sortedByBirthdate);
        }
Ejemplo n.º 14
0
 public SearchesController(ISearchService searchService, IDocumentsService docService,
                           ISortService sortService, IEuCaselawFilterService euCaselawFilterService)
 {
     this.searchService          = searchService;
     this.docService             = docService;
     this.sortService            = sortService;
     this.euCaselawFilterService = euCaselawFilterService;
 }
Ejemplo n.º 15
0
        public void Initialize()
        {
            //arrange
            var messageHandler = Substitute.For <MockHttpMessageHandler>(jsonResponse, HttpStatusCode.OK);
            var httpClient     = new HttpClient(messageHandler);

            _sortService = Substitute.For <ISortService>();
        }
Ejemplo n.º 16
0
        private static void SortByLastNameDescending(ISortService sortService, IList <Person> unsortedList)
        {
            IList <Person> sortedBylastName = sortService.SortByLastNameDescending(unsortedList);

            Console.WriteLine(" ");
            Console.WriteLine("Sorted by last name descending.");
            PrintList(sortedBylastName);
        }
Ejemplo n.º 17
0
        public PlaylistService(IPlaylistRepository playlistRepository, ISongService songService, ISortService sortService)
        {
            this.playlistRepository = playlistRepository;
            this.songService = songService;
            this.sortService = sortService;

            Playlists = new ObservableCollection<Playlist>();
            Songs = new ObservableCollection<Song>();
        }
Ejemplo n.º 18
0
        public IActionResult Index()
        {
            ISortService SortService = this.CreateService <ISortService>();
            List <Sort>  ListSort    = SortService.GetList((int)EnumSort.Link, "");

            ViewBag.ListSort = ListSort;

            return(View());
        }
Ejemplo n.º 19
0
        private static void Parse(IParser _parserService, ISortService sortService)
        {
            Console.WriteLine("Enter file and path with file format specified as part of the name, " +
                              "such as 'comma', 'pipe' or 'space':");
            string input = Console.ReadLine();

            IList <Person> unsortedList = _parserService.GetPersons(input);

            Sort(sortService, unsortedList);
        }
Ejemplo n.º 20
0
        private static void InitializeServices()
        {
            List <FileFormatGetter>       formatGetters = GetFormatGetters();
            Dictionary <FormatEnum, char> delimiters    = GetDelimiters();
            IStreamReader streamReader      = new StreamReaderWrapper();
            IFileSystem   fileSystemWrapper = new FileSystemWrapper();

            _parserService = new ParserService(streamReader, fileSystemWrapper, formatGetters, delimiters);
            _sortService   = new SortService();
        }
Ejemplo n.º 21
0
 public void SetUp()
 {
     this.beforeSorting = new List <IProduct>
     {
         product1,
         product2,
         product3
     };
     this.sortingService = new SortService();
 }
Ejemplo n.º 22
0
 public ProductController(
     IMapper mapper,
     ICategoryService categoryService,
     IProductService productService,
     ISortService sortService)
 {
     _mapper          = mapper;
     _categoryService = categoryService;
     _productService  = productService;
     _sortService     = sortService;
 }
 /// <summary>Creates a new instance of the controller.</summary>
 /// <param name="readerService">The service for reading the CSV file.</param>
 /// <param name="writerService">The service for writting the CSV file.</param>
 /// <param name="configuration">The configuration for the application.</param>
 /// <param name="sortService">The service for sorting the players.</param>
 /// <param name="cleanService">The service for cleaning up the data to reduce chances of errors.</param>
 public PlayerController(ICsvFileReaderService readerService,
                         ICsvFileWriterService writerService,
                         IConfiguration configuration,
                         ISortService sortService,
                         IDataCleanerService cleanService)
 {
     _readerService = readerService;
     _writerService = writerService;
     _configuration = configuration;
     _sortService   = sortService;
     _cleanService  = cleanService;
 }
 public ReportController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
     _sortService       = sortService;
 }
Ejemplo n.º 25
0
        static void Main(string[] args)
        {
            _serviceProvider = RegisterServices();

            ISortService _sortService = _serviceProvider.GetService <ISortService>();

            var result = _sortService.Sort("Contrary to popular belief, the pink unicorn flies east.");

            Console.WriteLine($"Result is: { result }");
            Console.Read();

            DisposeServices();
        }
Ejemplo n.º 26
0
 public SortCriterionController(
     IOrchardServices services,
     IFormManager formManager,
     IShapeFactory shapeFactory,
     IProjectionManager projectionManager,
     IRepository<SortCriterionRecord> repository,
     IQueryService queryService,
     ISortService sortService) {
     Services = services;
     _formManager = formManager;
     _projectionManager = projectionManager;
     _repository = repository;
     _queryService = queryService;
     _sortService = sortService;
     Shape = shapeFactory;
 }
 public ExportController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISlugService slugService,
     IAppDataFolder appDataFolder
     )
 {
     _appDataFolder   = appDataFolder;
     _orchardServices = services;
     _processService  = processService;
     _sortService     = sortService;
     _slugService     = slugService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
Ejemplo n.º 28
0
        public SortServiceTests()
        {
            _fixture = FixtureBuilder.Build();

            _productSort1 = _fixture.Create <IProductSortService>();
            _productSort2 = _fixture.Create <IProductSortService>();

            _fixture.Inject <IReadOnlyList <IProductSortService> >(new List <IProductSortService>
            {
                _productSort1,
                _productSort2
            });

            _productsRepository = _fixture.Freeze <IProductsRepository>();
            _sut = _fixture.Create <SortService>();
        }
Ejemplo n.º 29
0
 public ApiController(
     IOrchardServices orchardServices,
     IIpRangeService ipRangeService,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = orchardServices;
     _ipRangeService    = ipRangeService;
     _processService    = processService;
     _sortService       = sortService;
     _secureFileService = secureFileService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
Ejemplo n.º 30
0
 public SortCriterionController(
     IOrchardServices services,
     IFormManager formManager,
     IShapeFactory shapeFactory,
     IProjectionManager projectionManager,
     IRepository <SortCriterionRecord> repository,
     IQueryService queryService,
     ISortService sortService)
 {
     Services           = services;
     _formManager       = formManager;
     _projectionManager = projectionManager;
     _repository        = repository;
     _queryService      = queryService;
     _sortService       = sortService;
     Shape = shapeFactory;
 }
Ejemplo n.º 31
0
 public ArrangementLoadService(
     ICustomFileStore formFileStore,
     IParameterService parameterService,
     ISortService sortService,
     ISettingsService settings,
     IConfigurationContainer configurationContainer,
     IFileService fileService,
     CombinedLogger <ArrangementLoadService> logger
     )
 {
     _formFileStore          = formFileStore;
     _parameters             = parameterService.GetParameters();
     _sortService            = sortService;
     _settings               = settings;
     _logger                 = logger;
     _fileService            = fileService;
     _configurationContainer = configurationContainer;
 }
 public PivotTableController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService,
     ICfgService cfgService,
     ISlugService slugService,
     IAppDataFolder appDataFolder,
     IClock clock,
     IBatchCreateService batchCreateService,
     IBatchWriteService batchWriteService,
     IBatchRunService batchRunService,
     IBatchRedirectService batchRedirectService,
     IFileService fileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
 }