コード例 #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();
            }
        }
コード例 #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();
        }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
 /// <summary>
 ///     Creates a new instance of the <see cref="BrushConfigurationViewModel" /> class
 /// </summary>
 /// <param name="layerBrush"></param>
 protected BrushConfigurationViewModel(BaseLayerBrush layerBrush)
 {
     LayerBrush = layerBrush;
 }