/// <summary> /// Creates an instance of the described effect and applies it to the render element /// </summary> internal void CreateInstance(RenderProfileElement renderElement, LayerEffectEntity entity) { // Skip effects already on the element if (renderElement.LayerEffects.Any(e => e.EntityId == entity.Id)) { return; } if (PlaceholderFor != null) { CreatePlaceHolderInstance(renderElement, entity); return; } BaseLayerEffect effect = (BaseLayerEffect)LayerEffectProvider.PluginInfo.Kernel.Get(LayerEffectType); effect.ProfileElement = renderElement; effect.EntityId = entity.Id; effect.Order = entity.Order; effect.Name = entity.Name; effect.Enabled = entity.Enabled; effect.Descriptor = this; effect.Initialize(); effect.Update(0); renderElement.ActivateLayerEffect(effect); }
/// <summary> /// Creates an instance of the described effect and applies it to the render element /// </summary> internal void CreateInstance(RenderProfileElement renderElement, LayerEffectEntity entity) { // Skip effects already on the element if (renderElement.LayerEffects.Any(e => e.EntityId == entity.Id)) { return; } if (PlaceholderFor != null) { CreatePlaceHolderInstance(renderElement, entity); return; } if (LayerEffectType == null) { throw new ArtemisCoreException("Cannot create an instance of a layer effect because this descriptor is not a placeholder but is still missing its LayerEffectType"); } BaseLayerEffect effect = (BaseLayerEffect)Provider.Plugin.Kernel !.Get(LayerEffectType); effect.ProfileElement = renderElement; effect.EntityId = entity.Id; effect.Order = entity.Order; effect.Name = entity.Name; effect.Enabled = entity.Enabled; effect.Descriptor = this; effect.Initialize(); effect.Update(0); renderElement.ActivateLayerEffect(effect); }
/// <summary> /// Creates a new instance of the <see cref="EffectConfigurationViewModel" /> class with a validator /// </summary> /// <param name="layerEffect"></param> /// <param name="validator"></param> protected EffectConfigurationViewModel(BaseLayerEffect layerEffect, IModelValidator validator) : base(validator) { LayerEffect = layerEffect; }
/// <summary> /// Creates a new instance of the <see cref="EffectConfigurationViewModel" /> class /// </summary> /// <param name="layerEffect"></param> protected EffectConfigurationViewModel(BaseLayerEffect layerEffect) { LayerEffect = layerEffect; }