-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add virtual desktop rename notification support
- Loading branch information
Showing
8 changed files
with
147 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
source/VirtualDesktop/Interop/(interfaces)/IVirtualDesktopNotification2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace WindowsDesktop.Interop | ||
{ | ||
[ComImport] | ||
[Guid("00000000-0000-0000-0000-000000000000") /* replace at runtime */] | ||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | ||
public interface IVirtualDesktopNotification2 | ||
{ | ||
void VirtualDesktopCreated(IVirtualDesktop pDesktop); | ||
|
||
void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback); | ||
|
||
void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback); | ||
|
||
void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback); | ||
|
||
void ViewVirtualDesktopChanged(IntPtr pView); | ||
|
||
void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew); | ||
|
||
void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string name); | ||
} | ||
|
||
public class VirtualDesktopNotificationListener2 : VirtualDesktopNotification, IVirtualDesktopNotification, IVirtualDesktopNotification2 | ||
{ | ||
public void VirtualDesktopCreated(IVirtualDesktop pDesktop) | ||
{ | ||
this.VirtualDesktopCreatedCore(pDesktop); | ||
} | ||
|
||
public void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback) | ||
{ | ||
this.VirtualDesktopDestroyBeginCore(pDesktopDestroyed, pDesktopFallback); | ||
} | ||
|
||
public void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback) | ||
{ | ||
this.VirtualDesktopDestroyFailedCore(pDesktopDestroyed, pDesktopFallback); | ||
} | ||
|
||
public void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback) | ||
{ | ||
this.VirtualDesktopDestroyedCore(pDesktopDestroyed, pDesktopFallback); | ||
} | ||
|
||
public void ViewVirtualDesktopChanged(IntPtr pView) | ||
{ | ||
this.ViewVirtualDesktopChangedCore(pView); | ||
} | ||
|
||
public void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew) | ||
{ | ||
this.CurrentVirtualDesktopChangedCore(pDesktopOld, pDesktopNew); | ||
} | ||
|
||
public void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string name) | ||
{ | ||
this.VirtualDesktopRenamedCore(pDesktop, name); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
|
||
namespace WindowsDesktop | ||
{ | ||
/// <summary> | ||
/// Provides data for the <see cref="VirtualDesktop.Renamed" /> event. | ||
/// </summary> | ||
public class VirtualDesktopRenamedEventArgs : EventArgs | ||
{ | ||
/// <summary> | ||
/// Gets the virtual desktop that was renamed. | ||
/// </summary> | ||
public VirtualDesktop Source { get; } | ||
|
||
/// <summary> | ||
/// Gets the old name of the virtual desktop. | ||
/// </summary> | ||
public string OldName { get; } | ||
|
||
/// <summary> | ||
/// Gets the new name of the virtual desktop. | ||
/// </summary> | ||
public string NewName { get; } | ||
|
||
public VirtualDesktopRenamedEventArgs(VirtualDesktop source, string oldName, string newName) | ||
{ | ||
this.Source = source; | ||
this.OldName = oldName; | ||
this.NewName = newName; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters