Esempio n. 1
0
 public HomeController(IMediaFacade mediaService,
                       IVideoRepository videoRepository,
                       ILocatorService locatorService)
 {
     this.mediaService    = mediaService;
     this.videoRepository = videoRepository;
     this.locatorService  = locatorService;
 }
 public HomeController(IMediaFacade mediaService,
                       IVideoRepository videoRepository,
                       ILocatorService locatorService)
 {
     this.mediaService = mediaService;
     this.videoRepository = videoRepository;
     this.locatorService = locatorService;
 }
Esempio n. 3
0
 public ProjectMapper(ILocatorService locator)
 {
     mapper = new MapperConfiguration(config =>
     {
         config.ConstructServicesUsing(locator.Locate);
         MapToDomain(config);
         MapFromDomain(config);
     }).CreateMapper();
 }
Esempio n. 4
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     if (this._mediaService == null)
     {
         this._mediaService = new MediaService(requestContext.HttpContext.Session["mctx"] as CloudMediaContext);
         this._assetSErvice = new AssetService(this.MediaService);
         this._jobService = new JobService(this.MediaService);
         this._locatorService = new LocatorService(this.MediaService);
     }
     base.Initialize(requestContext);
 }
Esempio n. 5
0
 protected override void Initialize(System.Web.Routing.RequestContext requestContext)
 {
     if (this._mediaService == null)
     {
         this._mediaService   = new MediaService(requestContext.HttpContext.Session["mctx"] as CloudMediaContext);
         this._assetSErvice   = new AssetService(this.MediaService);
         this._jobService     = new JobService(this.MediaService);
         this._locatorService = new LocatorService(this.MediaService);
     }
     base.Initialize(requestContext);
 }
        private bool CreateDatabase(ILocatorService scope)
        {
            var databaseManager = scope.Locate <DatabaseManager>();

            try {
                databaseManager.CreateAndConnectNewDatabase("./db.s3db");
                return(true);
            }
            catch (Exception e) {
                Logger.Log(LogLevel.Error, e);
                return(false);
            }
        }
        private async Task <bool> ConnectDatabase(ILocatorService scope, string path)
        {
            var databaseManager = scope.Locate <DatabaseManager>();

            try {
                await databaseManager.Connect(path);

                return(true);
            }
            catch (Exception) {
                return(false);
            }
        }
Esempio n. 8
0
        public static CommandLineBuilder Configure(this CommandLineBuilder builder, ILocatorService container)
        {
            var project  = new Option <string>("--project", GetDefaultProject);
            var authType = new Option <AuthType>("--auth-type", "Authentication")
            {
                Required = true
            };
            var auth    = new Option <string>("--auth", "Authentication string");
            var profile = new Argument <string>("profile");
            var verbose = new Option <bool>("--verbose", () => false);

            var configureCommand = new Command("configure")
            {
                profile,
                project,
                authType,
                auth,
                verbose
            };

            configureCommand.Handler = CommandHandler.Create <ProfileCreationOptions>(options =>
            {
                var creator = container.Locate <ProfileCreationUnit>(options);
                return(creator.Create());
            });

            var deployCommand = new Command("deploy")
            {
                profile,
                project,
                authType,
                auth,
                new Option <string>("--configuration", () => "Debug", "Build configuration"),
                verbose
            };

            deployCommand.Handler = CommandHandler.Create <DeploymentOptions>(async options =>
            {
                var deploymentRequest = container.Locate <DeploymentUnit>(options);
                var deploy            = await deploymentRequest.Deploy();
                if (deploy.IsFailure)
                {
                    Log.Error($"Deployment failed {deploy.Error}");
                }
            });

            builder.AddCommand(configureCommand);
            builder.AddCommand(deployCommand);
            return(builder);
        }
Esempio n. 9
0
 public TestInstanceBuilder(ILocatorService container) : base(container)
 {
 }
 public HomeController()
 {
     //TODO: Implement IoC Container
     this.locatorService  = new MediaLocatorService(new VideoLibraryConfigurationManager(), new OneDayReadOnlyAccessPolicyFactory());
     this.videoRepository = new AzureVideoRepository(new VideoLibraryConfigurationManager(), new AzureMediaServicesMediaFacade(new VideoLibraryConfigurationManager(), new ThumbnailService(new VideoLibraryConfigurationManager())));
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocatorController"/> class.
 /// </summary>
 /// <param name="loggerService">The logger service.</param>
 /// <param name="locatorService">The locator service.</param>
 public LocatorController(ILoggerService loggerService, ILocatorService locatorService)
     : base(loggerService)
 {
     this.locatorService = locatorService;
 }
Esempio n. 12
0
 public LocatorController(
     ILocatorService locatorService
     )
 {
     _locatorService = locatorService;
 }
 public TopSecretController(IMessageRecoveryService messageRecovery,
                            ILocatorService locatorService)
 {
     _messageRecovery = messageRecovery ?? throw new ArgumentNullException(nameof(messageRecovery));
     _locatorService  = locatorService ?? throw new ArgumentNullException(nameof(locatorService));
 }
Esempio n. 14
0
 static LocatorHelper()
 {
     service = IoC.Resolve<ILocatorService>("LocatorService");
 }
 public HomeController()
 {
     //TODO: Implement IoC Container
     this.locatorService = new MediaLocatorService(new VideoLibraryConfigurationManager(), new OneDayReadOnlyAccessPolicyFactory());
     this.videoRepository = new AzureVideoRepository(new VideoLibraryConfigurationManager(), new AzureMediaServicesMediaFacade(new VideoLibraryConfigurationManager(), new ThumbnailService(new VideoLibraryConfigurationManager())));
 }
Esempio n. 16
0
 public ViewModelFactory(ILocatorService locatorService)
 {
     this.locatorService = locatorService;
 }
Esempio n. 17
0
 public LocatorsController(ILocatorService locatorService)
 {
     _locatorService = locatorService ?? throw new ArgumentNullException(nameof(locatorService));
 }
Esempio n. 18
0
 public ImportILocatorService(ILocatorService locatorService)
 {
     LocatorService = locatorService;
 }
Esempio n. 19
0
 public InstanceBuilder(ILocatorService container)
 {
     this.container = container;
 }
Esempio n. 20
0
 static LocatorHelper()
 {
     service = IoC.Resolve <ILocatorService>("LocatorService");
 }