Ejemplo n.º 1
0
        /// <inheritdoc/>
        public override void OnEnable()
        {
            base.OnEnable();

            this.aliasBrush = this.Brush as AliasBrush;
            this.RefreshTargetDesigner();
        }
        /// <summary>
        /// Create designer for editing an alias brush that targets a brush of the
        /// described kind.
        /// </summary>
        /// <remarks>
        /// <para>Each brush can define their own alias brush designer which is used to
        /// design alias brushes that target them.</para>
        /// </remarks>
        /// <param name="brush">Brush instance to edit.</param>
        /// <returns>
        /// The <see cref="AliasBrushDesigner"/>.
        /// </returns>
        internal AliasBrushDesigner CreateAliasDesigner(AliasBrush brush)
        {
            if (ReferenceEquals(this.AliasDesignerType, null))
            {
                return(null);
            }

            var aliasBrushDesigner = Activator.CreateInstance(this.AliasDesignerType) as AliasBrushDesigner;

            aliasBrushDesigner.Brush = brush;

            return(aliasBrushDesigner);
        }
        /// <inheritdoc/>
        public override void OnEnable()
        {
            base.OnEnable();

            this.AliasBrush = this.Brush as AliasBrush;

            var targetBrushRecord = BrushDatabase.Instance.FindRecord(this.AliasBrush.target);

            if (targetBrushRecord != null)
            {
                this.isTargetMasterBrush = targetBrushRecord.IsMaster;
            }
        }