Example #1
0
        /// <summary>
        ///     Creates an instance of the described brush and applies it to the layer
        /// </summary>
        internal void CreateInstance(Layer layer)
        {
            if (layer == null)
            {
                throw new ArgumentNullException(nameof(layer));
            }
            if (layer.LayerBrush != null)
            {
                throw new ArtemisCoreException("Layer already has an instantiated layer brush");
            }

            BaseLayerBrush brush = (BaseLayerBrush)Provider.Plugin.Kernel !.Get(LayerBrushType);

            brush.Layer      = layer;
            brush.Descriptor = this;
            brush.Initialize();
            brush.Update(0);

            layer.LayerBrush = brush;
            layer.OnLayerBrushUpdated();

            if (layer.ShouldBeEnabled)
            {
                brush.InternalEnable();
            }
        }
Example #2
0
        /// <summary>
        ///     Creates an instance of the described brush and applies it to the layer
        /// </summary>
        internal void CreateInstance(Layer layer)
        {
            if (layer.LayerBrush != null)
            {
                throw new ArtemisCoreException("Layer already has an instantiated layer brush");
            }

            BaseLayerBrush brush = (BaseLayerBrush)LayerBrushProvider.PluginInfo.Kernel.Get(LayerBrushType);

            brush.Layer      = layer;
            brush.Descriptor = this;
            brush.Initialize();
            brush.Update(0);

            layer.LayerBrush = brush;
            layer.OnLayerBrushUpdated();
        }
 /// <summary>
 ///     Creates a new instance of the <see cref="BrushConfigurationViewModel" /> class with a validator
 /// </summary>
 /// <param name="layerBrush"></param>
 /// <param name="validator"></param>
 protected BrushConfigurationViewModel(BaseLayerBrush layerBrush, IModelValidator validator) : base(validator)
 {
     LayerBrush = layerBrush;
 }
 /// <summary>
 ///     Creates a new instance of the <see cref="BrushConfigurationViewModel" /> class
 /// </summary>
 /// <param name="layerBrush"></param>
 protected BrushConfigurationViewModel(BaseLayerBrush layerBrush)
 {
     LayerBrush = layerBrush;
 }