예제 #1
0
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     this.isAttached = true;
     this.device     = host.Device;
     this.effect     = host.Effects[effectName];
     this.renderHost = host;
 }
예제 #2
0
 /// <summary>
 /// Used to override Detach
 /// </summary>
 protected virtual void OnDetach()
 {
     IsAttached      = false;
     renderTechnique = null;
     effect          = null;
     renderHost      = null;
 }
예제 #3
0
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     this.isAttached = true;
     this.device = host.Device;
     this.effect = host.Effects[effectName];
     this.renderHost = host;
 }
예제 #4
0
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     this.renderTechnique = this.renderTechnique == null ? host.RenderTechnique : this.renderTechnique;
     this.effect          = EffectsManager.Instance.GetEffect(renderTechnique);
     this.renderHost      = host;
     this.InvalidateRender();
 }
예제 #5
0
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     renderTechnique = this.renderTechnique == null ? host.RenderTechnique : this.renderTechnique;
     renderHost      = host;
     effect          = renderHost.EffectsManager.GetEffect(renderTechnique);
     InvalidateRender();
 }
예제 #6
0
 /// <summary>
 /// <para>Attaches the element to the specified host. To overide Attach, please override <see cref="OnAttach(IRenderHost)"/> function.</para>
 /// <para>To set different render technique instead of using technique from host, override <see cref="SetRenderTechnique"/></para>
 /// <para>Attach Flow: <see cref="SetRenderTechnique(IRenderHost)"/> -> Set RenderHost -> Get Effect -> <see cref="OnAttach(IRenderHost)"/> -> <see cref="OnAttached"/> -> <see cref="InvalidateRender"/></para>
 /// </summary>
 /// <param name="host">The host.</param>
 public void Attach(IRenderHost host)
 {
     if (IsAttached || host == null)
     {
         return;
     }
     renderHost = host;
     if (host.EffectsManager == null)
     {
         throw new ArgumentException("EffectManger does not exist. Please make sure the proper EffectManager has been bind from view model.");
     }
     this.renderTechnique = SetRenderTechnique(host);
     effect     = renderHost.EffectsManager.GetEffect(renderTechnique);
     IsAttached = OnAttach(host);
     if (IsAttached)
     {
         OnAttached();
     }
     InvalidateRender();
 }
예제 #7
0
 /// <summary>
 /// Detaches the element from the host.
 /// </summary>
 public virtual void Detach()
 {
     this.renderTechnique = null;
     this.effect          = null;
     this.renderHost      = null;
 }
예제 #8
0
 /// <summary>
 /// Detaches the element from the host.
 /// </summary>
 public virtual void Detach()
 {
     renderTechnique = null;
     effect          = null;
     renderHost      = null;
 }