public static BarRenderer FindOwnerBarRenderer(ElementRenderer renderer) { var owner = renderer.Owner; while (owner != null && !(owner is BarRenderer)) { owner = owner.Owner; } return(owner as BarRenderer); }
public virtual TRenderingContext GetRenderingContext <TRenderingContext>(ElementRenderer renderer) where TRenderingContext : RenderingContextBase { RenderingContextBase renderingContext; if (!_renderingContextLookup.TryGetValue(renderer, out renderingContext)) { return(null); } return((TRenderingContext)renderingContext); }
public static IBeatElementRenderer Create(ElementRenderer owner, IBeatElement element) { var beat = element as Beat; if (beat != null) { return(new BeatRenderer(owner, beat)); } var beam = element as Beam; if (beam != null) { return(new BeamRenderer(owner, beam)); } throw new InvalidOperationException(); }
public BeamRenderer(ElementRenderer owner, Beam beam) : base(owner, beam) { _beatElementRenderers = new List <IBeatElementRenderer>(); }
public virtual void AssignRenderingContext(ElementRenderer renderer, RenderingContextBase renderingContext) { _renderingContextLookup[renderer] = renderingContext; }
public BeatRenderer(ElementRenderer owner, Beat beat) : base(owner, beat) { _noteRenderers = new List <NoteRenderer>(); }
protected internal ElementRenderer(ElementRenderer owner) { this.Owner = owner; }
void IRootElementRenderer.RegisterRenderer <TElement>(TElement element, ElementRenderer <TElement> renderer) { // _rendererLookup will be null if we are in our own constructor _rendererLookup?.Add(element, renderer); }
public BarColumnRenderer(ElementRenderer owner, BarColumn element) : base(owner, element) { }