![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | I must be bored...CompositionTarget.Render question While browsing though the PresentationCore code in .NET Reflector and found this: Note: this is a method on CompositionTarget... void ICompositionTarget.Render(bool inResize) { MediaContext.From(base.Dispatcher); <<<<<<<<< ????? if (this._rootVisual.Value != null) { bool flag1 = false; if (EventTrace.IsEnabled(EventTrace.Flags.performance, EventTrace.Level.normal)) { flag1 = true; EventTrace.EventProvider.TraceEvent(EventTrace.PRECOMPUTESCENEGUID, 1, this.GetHashCode()); } this._rootVisual.Value.PreCompute(); if (flag1) { EventTrace.EventProvider.TraceEvent(EventTrace.PRECOMPUTESCENEGUID, 2); } if (flag1) { EventTrace.EventProvider.TraceEvent(EventTrace.COMPILESCENEGUID, 1, this.GetHashCode()); } this.Compile(); if (flag1) { EventTrace.EventProvider.TraceEvent(EventTrace.COMPILESCENEGUID, 2); } } } Obviously I dont have comments in Reflector so there probably is a legit reason for this method call, but from what I can tell MediaContext.From doesn't do anything within this method. The point of MediaContext.From is to get the MediaContext associated with the dispatcher for the current thread but it's not assigned to a local variable, so I'm very confused. I then thought it might be to ensure that the media context is created (which From will do if its not already), but I ran Reflectors analyzer on it and found that CompositionTarget.Render is only called from MediaContext.Render. Thus MediaContext must already be created. Looks to me like pointless code, but if it's not then I'm curious what it's for. Thanks |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| So, what should I do with my Vista x64 install. I'm just bored :( | General Discussion | |||
| badass port if gates gets bored. | Vista General | |||
| I'm Bored Again (I Need Access To The MSDN X64 Download!), Just FYI. | Vista General | |||
| I'm Bored, Could Microsoft Please Hurry Up And Release RTM on MSDN? | Vista General | |||