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")); }
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)); }
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")); }
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)); }