Esempio n. 1
0
        public static BarRenderer FindOwnerBarRenderer(ElementRenderer renderer)
        {
            var owner = renderer.Owner;

            while (owner != null && !(owner is BarRenderer))
            {
                owner = owner.Owner;
            }

            return(owner as BarRenderer);
        }
Esempio n. 2
0
        public virtual TRenderingContext GetRenderingContext <TRenderingContext>(ElementRenderer renderer)
            where TRenderingContext : RenderingContextBase
        {
            RenderingContextBase renderingContext;

            if (!_renderingContextLookup.TryGetValue(renderer, out renderingContext))
            {
                return(null);
            }

            return((TRenderingContext)renderingContext);
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
 public BeamRenderer(ElementRenderer owner, Beam beam)
     : base(owner, beam)
 {
     _beatElementRenderers = new List <IBeatElementRenderer>();
 }
Esempio n. 5
0
 public virtual void AssignRenderingContext(ElementRenderer renderer, RenderingContextBase renderingContext)
 {
     _renderingContextLookup[renderer] = renderingContext;
 }
Esempio n. 6
0
 public BeatRenderer(ElementRenderer owner, Beat beat)
     : base(owner, beat)
 {
     _noteRenderers = new List <NoteRenderer>();
 }
Esempio n. 7
0
 protected internal ElementRenderer(ElementRenderer owner)
 {
     this.Owner = owner;
 }
Esempio n. 8
0
 void IRootElementRenderer.RegisterRenderer <TElement>(TElement element, ElementRenderer <TElement> renderer)
 {
     // _rendererLookup will be null if we are in our own constructor
     _rendererLookup?.Add(element, renderer);
 }
Esempio n. 9
0
 public BarColumnRenderer(ElementRenderer owner, BarColumn element)
     : base(owner, element)
 {
 }