Thursday, January 5, 2012

WPF

Rendering Tier 0 directx 7 aşağısı

Rendering Tier 1 Directx 7-9

Rendering Tier 2 Direct x 9+

 

int renderingTier = (RenderCapability.Tier >> 16);
 
if (renderingTier == 0)
{ ... }
else if (renderingTier == 1)
{ ... }

 

milcore.dll media integration layer MIL

DWM Desktop Wİndow Manager

wpf ile herşey 3d render edilir 2 boyutlu şeyler bile üçgenlere çevrilip 3d pipeline dan geçer

The client profile is the subset of the .NET Framework that’s required for rich client applications 
like WPF. It doesn’t include server-side features such as ASP.NET, debuggers, developer tools, code compilers.

Concurrent Bag

[Serializable] public class ConcurrentList<T> : ConcurrentBag<T> //where T : ICloneable { private object lockObject = new object(); public ConcurrentList<T> CloneOnlyList() { lock (lockObject) { ConcurrentList<T> clone = new ConcurrentList<T>(); foreach (T t in this) { clone.Add(t); } return clone; } } public T this[int i] { get { return this.ElementAt(i); } } public void Clear() { T someItem; lock (lockObject) { while (!this.IsEmpty) { this.TryTake(out someItem); } } } }

lock static objects

// C#
lock(typeof(Foo)) { // BAD CODE! NO! NO! NO!
// statements;
}
' VB .NET
SyncLock GetType(MyClass) ' BAD CODE! NO! NO! NO!
' statements
End SyncLock
…into the following good code:
// C#
lock(somePrivateStaticObject) { // Good code!
// statements;
}
' VB .NET
SyncLock GetType(somePrivateStaticObject) ' Good code!
' statements
End SyncLock