Exemplo n.º 1
0
        public ActionResult Image(string location, string id)
        {
            Response.Cache.SetOmitVaryStar(true);
            IContractFactory <IResourceAccess> builder = Actor.Public.GetNamedExport <IContractFactory <IResourceAccess> >(location);

            if (builder.IsNull())
            {
                return(Content("no resource"));
            }
            return(File(builder.Build().GetImage(id), "image/png"));
        }
Exemplo n.º 2
0
        public ActionResult Script(string location, string id)
        {
            Response.Cache.SetOmitVaryStar(true);
            IContractFactory <IResourceAccess> builder = Actor.Public.GetNamedExport <IContractFactory <IResourceAccess> >(location);

            if (builder.IsNull())
            {
                return(Content("no resource"));
            }
            return(Content(builder.Build().GetScript(id), "text/javascript"));
        }
Exemplo n.º 3
0
        public static IEntityRequestProcess BuildEntityProcessor(this Public Public, string ProviderName)
        {
            Lazy <IContractFactory <IEntityRequestProcess> > factoryLazy = _founderAgent.EntityProcessorBox.FirstOrDefault(f => f.Metadata.ProviderName.Equals(ProviderName, StringComparison.InvariantCultureIgnoreCase));
            IContractFactory <IEntityRequestProcess>         factory     = factoryLazy.Value;

            if (factory != default(IContractFactory <IEntityRequestProcess>))
            {
                return(factory.Build());
            }
            return(default(IEntityRequestProcess));
        }
Exemplo n.º 4
0
        public static T BuildContractProvider <T>(this Public Public) where T : class
        {
            object obj = default(IContractFactory <T>);

            if (MEFPool.TryGetValue(typeof(IContractFactory <T>), out obj) && obj is IContractFactory <T> )
            {
                IContractFactory <T> builder = obj as IContractFactory <T>;
                return(builder.Build().AsDecorator());
            }
            return(default(T));
        }
Exemplo n.º 5
0
 public FestiTimerContext(
     DbContextOptions options,
     IEmployerFactory employerFactory,
     IPersonFactory personFactory,
     IContractFactory contractFactory,
     IWorkscheduleFactory workscheduleFactory,
     IJobFactory jobFactory,
     IWorkshiftFactory workshiftFactory) : base(options)
 {
     EmployerFactory     = employerFactory;
     PersonFactory       = personFactory;
     ContractFactory     = contractFactory;
     WorkscheduleFactory = workscheduleFactory;
     JobFactory          = jobFactory;
     WorkshiftFactory    = workshiftFactory;
     Database.EnsureCreated();
 }
Exemplo n.º 6
0
        public Billing(IBillableExchange phoneExchange, IContractFactory contractFactory, ISubscriberFactory subscriberFactory, IDateTimeHelper dtHelper = null)
        {
            if (phoneExchange == null)
            {
                throw new ArgumentNullException("phoneExchange", "phoneExchange cannot be null.");
            }

            _dtHelper = dtHelper ?? new DefaultDateTimeHelper();
            _dtHelper.DayIntervalChanged += BillingDayIntervalChanged;

            _phoneExchange     = phoneExchange;
            _contractFactory   = contractFactory;
            _subscriberFactory = subscriberFactory;

            _phoneExchange.CallLog             += BillingCallLog;
            _phoneExchange.CallPermissionCheck += BillingCallPermissionCheck;

            _timer           = new Timer(_dtHelper.DayInterval);
            _timer.AutoReset = true;
            _timer.Elapsed  += DailyTask;
            _timer.Start();
        }
 public ContractService(IContractRepository contractRepository, IContractFactory contractFactory, IWorkscheduleFactory workscheduleFactory)
 {
     _contractRepository  = contractRepository;
     _contractFactory     = contractFactory;
     _workscheduleFactory = workscheduleFactory;
 }
Exemplo n.º 8
0
 public ContractRegistry(IContractFactory factory)
 {
     _factory = factory;
 }