///<summary> /// Adds resource source in specific culture name. ///</summary> /// <remarks> /// <para> /// The same resource may be added many times to vary culture names</para> /// <para> /// Resources for the same language may be added many times - they will be used in random order /// </para> /// </remarks> ///<param name="cultureName">culture name for which resource should be used</param> ///<param name="resourceSource">source to use for specified language</param> public void AddSource(string cultureName, IResourceSource resourceSource) { if (!_resourceSources.ContainsKey(cultureName)) _resourceSources[cultureName] = new List<IResourceSource>(); _resourceSources[cultureName].Add(resourceSource); }
public DynamoAlarmGenerator( IAlarmLogger logger, TableNamePopulator populator, ITableAlarmCreator tableAlarmCreator, IIndexAlarmCreator indexAlarmCreator, SnsCreator snsCreator, IResourceSource <TableDescription> tableSource) { _logger = logger; _populator = populator; _tableAlarmCreator = tableAlarmCreator; _indexAlarmCreator = indexAlarmCreator; _snsCreator = snsCreator; _tableSource = tableSource; }
public static AlarmLoaderAndGenerator CreateSystemUnderTest <T, TAlarmConfig>( IResourceSource <T> source, IAlarmDimensionProvider <T> dimensionProvider, IResourceAttributesProvider <T, TAlarmConfig> attributeProvider, Func <WatchmanConfiguration, WatchmanServiceConfiguration <TAlarmConfig> > mapper, IAlarmCreator creator, IConfigLoader loader ) where T : class where TAlarmConfig : class, IServiceAlarmConfig <TAlarmConfig>, new() { var builder = new Builder(loader, creator); builder.AddService(source, dimensionProvider, attributeProvider, mapper); return(builder.Build()); }
public override IResource GetNew(IResourceSource resourceSource) { var cSource = (Source)resourceSource; var vertices = new[] { new VertexPosTanNormTex(new Vector3(-1, 0, 1), new Vector3(1, 0, 0), new Vector3(0, 0, 1), new Vector2(0, 1)), new VertexPosTanNormTex(new Vector3(-1, 0, -1), new Vector3(1, 0, 0), new Vector3(0, 0, 1), new Vector2(0, 0)), new VertexPosTanNormTex(new Vector3(1, 0, -1), new Vector3(1, 0, 0), new Vector3(0, 0, 1), new Vector2(1, 0)), new VertexPosTanNormTex(new Vector3(1, 0, 1), new Vector3(1, 0, 0), new Vector3(0, 0, 1), new Vector2(1, 1)), }; var indices = new int[] { 0, 1, 2, 0, 2, 3 }; return(ExplicitModel.FromVertices(vertices, indices, ExplicitModelPrimitiveTopology.TriangleList).WithSource(cSource)); }
public override IResource GetNew(IResourceSource resourceSource) { var cSource = (Source)resourceSource; var vertices = new[] { new VertexPos(-1, -1, 0), new VertexPos(-1, 1, 0), new VertexPos(1, 1, 0), new VertexPos(1, -1, 0), }; var indices = new[] { 0, 1, 2, 3, 0 }; return(ExplicitModel.FromVertices(vertices, indices, ExplicitModelPrimitiveTopology.LineStrip).WithSource(cSource)); }
public void AddService <T, TAlarmConfig>(IResourceSource <T> source, IAlarmDimensionProvider <T> dimensionProvider, IResourceAttributesProvider <T, TAlarmConfig> attributeProvider, Func <WatchmanConfiguration, WatchmanServiceConfiguration <TAlarmConfig> > mapper) where T : class where TAlarmConfig : class, IServiceAlarmConfig <TAlarmConfig>, new() { var task = new ServiceAlarmTasks <T, TAlarmConfig>( _logger, new ResourceNamePopulator <T, TAlarmConfig>(_logger, source), new OrphanResourcesReporter <T>( new OrphanResourcesFinder <T>(source), new OrphansLogger(_logger)), _creator, new ServiceAlarmBuilder <T, TAlarmConfig>(source, dimensionProvider, attributeProvider), mapper ); _serviceAlarmTasks.Add(task); }
public override IResource GetNew(IResourceSource resourceSource) { var cSource = (Source)resourceSource; var distance = 1f / MathHelper.Tan(MathHelper.Pi / 8); var vertices = new[] { new VertexPos(-1, -1, 0), new VertexPos(-1, 1, 0), new VertexPos(1, 1, 0), new VertexPos(1, -1, 0), new VertexPos(-2, -2, -distance), new VertexPos(-2, 2, -distance), new VertexPos(2, 2, -distance), new VertexPos(2, -2, -distance) }; var indices = new[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 }; return(ExplicitModel.FromVertices(vertices, indices, ExplicitModelPrimitiveTopology.LineList).WithSource(cSource)); }
public IObjectRef TryGetCachedResource(IResourceSource resourceSource, Type interfaceType) => this.TryGetCachedResource(resourceSource, interfaceType, false);
public IObjectRef GetCachedOrCreateResource(IResourceSource resourceSource, Type interfaceType) => this.GetCachedOrCreateResource(resourceSource, interfaceType, false);
public IObjectRef TryGetCachedResource(IResourceSource resourceSource, Type interfaceType) => null;
public void AddSource(IResourceSource source) { sources.Add(source); }
public OrphanTablesFinder(IResourceSource <TableDescription> tableSource) { _tableSource = tableSource; }
public IObjectRef GetCachedOrCreateResource(IResourceSource resourceSource, Type interfaceType) => base.innerRefT.GetCachedOrCreateResource(resourceSource, interfaceType);
public TableNamePopulator(IAlarmLogger logger, IResourceSource <TableDescription> tableSource) { _logger = logger; _tableSource = tableSource; }
public HtmlResourceLocalizer(IResourceSource resources) => this.resources = resources;
public OrphanQueuesFinder(IResourceSource <QueueData> queueSource) { _queueSource = queueSource; }
public static TResource GetCachedOrCreateResource <TResource>(this IResourceCache resourceCache, IResourceSource <TResource> resourceSource) where TResource : class, IObjectRef => ((TResource)resourceCache.GetCachedOrCreateResource(resourceSource, typeof(TResource)));
public static TResource SafeGetCachedOrCreateResource <TResource>(this IResourceCache resourceCache, IResourceSource <TResource> resourceSource) where TResource : class, IObjectRef { if (resourceSource == null) { return(default(TResource)); } return((TResource)resourceCache.GetCachedOrCreateResource(resourceSource, typeof(TResource))); }
public override IResource GetNew(IResourceSource resourceSource) { return(GenerateNew().WithSource(resourceSource)); }
public OrphanResourcesFinder(IResourceSource <T> source) { _source = source; }
public ResourceNamePopulator(IAlarmLogger logger, IResourceSource <T> resourceSource) { _logger = logger; _resourceSource = resourceSource; }
public static T WithSource <T>(this T resource, IResourceSource source) where T : IResource { resource.Source = source; return(resource); }
static Texture2D GetTexture(IResourceSource <Texture2D> source) { return(source != null?source.GetResourceValue() : null); }
public StringResourceLocalizerFactory(IResourceSource resources) => this.resources = resources;
public IObjectRef TryGetCachedResource(IResourceSource resourceSource, Type interfaceType) => base.innerRefT.TryGetCachedResource(resourceSource, interfaceType);
public abstract IResource GetNew(IResourceSource resourceSource);