Skip to content

Commit

Permalink
Add VirtualDesktop.Current property.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabacr07 committed Sep 15, 2015
1 parent c1b1a98 commit f8cee3e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions source/VirtualDesktop/VirtualDesktop.static.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ partial class VirtualDesktop
[EditorBrowsable(EditorBrowsableState.Never)]
public static Exception InitializationException { get; }

public static VirtualDesktop Current
{
get
{
var current = ComInternal.GetCurrentDesktop();
var wrapper = wrappers.GetOrAdd(current.GetID(), _ => new VirtualDesktop(current));

return wrapper;
}
}

static VirtualDesktop()
{
if (!IsSupported) return;
Expand Down

0 comments on commit f8cee3e

Please sign in to comment.