Skip to content

Commit

Permalink
Infrastructure Preparation 304
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 31, 2024
1 parent e49d550 commit d1d7ea9
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Skylark" Version="3.1.4.8" />
<PackageReference Include="Skylark.Wing" Version="3.1.7.2" />
<PackageReference Include="Skylark.Wing" Version="3.1.7.3" />
</ItemGroup>
</Project>
34 changes: 17 additions & 17 deletions src/Skylark.Wing/Helper/EventSubscriptionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Runtime.InteropServices;
using DISPPARAMS = System.Runtime.InteropServices.ComTypes.DISPPARAMS;
using EXCEPINFO = System.Runtime.InteropServices.ComTypes.EXCEPINFO;
using HRESULT = Skylark.Wing.Native.Methods.HRESULT;
using SWIIEL = Skylark.Wing.Interface.IEventListener;
using SWIIESM = Skylark.Wing.Interface.IEventSystem;
using SWIIESN = Skylark.Wing.Interface.IEventSubscription;
using SWNM = Skylark.Wing.Native.Methods;

namespace Skylark.Wing.Helper
{
Expand All @@ -22,9 +22,9 @@ public EventSubscriptionManager(SWIIEL eventListener)
_eventListener = eventListener;
}

public SWNM.HRESULT Initialize()
public HRESULT Initialize()
{
SWNM.HRESULT hr = SWNM.HRESULT.E_FAIL;
HRESULT hr = HRESULT.E_FAIL;

Guid CLSID_CEventSubscription = new("7542e960-79c7-11d1-88f9-0080c7d771bf");

Expand All @@ -38,15 +38,15 @@ public SWNM.HRESULT Initialize()
{
hr = pEventSubscription.put_EventClassID("{D5978630-5B9F-11D1-8DD2-00AA004ABD5E}");

if (hr == SWNM.HRESULT.S_OK)
if (hr == HRESULT.S_OK)
{
hr = pEventSubscription.put_SubscriptionName("SkylarkEventSubscriptionManager");

if (hr == SWNM.HRESULT.S_OK)
if (hr == HRESULT.S_OK)
{
hr = pEventSubscription.put_PerUser(true);

if (hr == SWNM.HRESULT.S_OK)
if (hr == HRESULT.S_OK)
{
IntPtr pSubscriberInterface = Marshal.GetIUnknownForObject(this);

Expand All @@ -73,9 +73,9 @@ public SWNM.HRESULT Initialize()
return hr;
}

public SWNM.HRESULT Uninitialize()
public HRESULT Uninitialize()
{
SWNM.HRESULT hr = SWNM.HRESULT.E_FAIL;
HRESULT hr = HRESULT.E_FAIL;

if (_eventSystem != null)
{
Expand All @@ -101,47 +101,47 @@ public IntPtr GetTypeInfo(int iTInfo, int lcid)
throw new NotImplementedException();
}

public SWNM.HRESULT GetIDsOfNames(ref Guid riid, string[] rgszNames, int cNames, int lcid, int[] rgDispId)
public HRESULT GetIDsOfNames(ref Guid riid, string[] rgszNames, int cNames, int lcid, int[] rgDispId)
{
throw new NotImplementedException();
}

public SWNM.HRESULT Invoke(int dispIdMember, ref Guid riid, int lcid, int dwFlags, DISPPARAMS pDispParams, out object pVarResult, EXCEPINFO pExcepInfo, IntPtr[] pArgErr)
public HRESULT Invoke(int dispIdMember, ref Guid riid, int lcid, int dwFlags, DISPPARAMS pDispParams, out object pVarResult, EXCEPINFO pExcepInfo, IntPtr[] pArgErr)
{
throw new NotImplementedException();
}

public SWNM.HRESULT Logon(string userName)
public HRESULT Logon(string userName)
{
return _eventListener.OnLogon(userName);
}

public SWNM.HRESULT Logoff(string userName)
public HRESULT Logoff(string userName)
{
return _eventListener.OnLogoff(userName);
}

public SWNM.HRESULT StartShell(string userName)
public HRESULT StartShell(string userName)
{
return _eventListener.OnStartShell(userName);
}

public SWNM.HRESULT DisplayLock(string userName)
public HRESULT DisplayLock(string userName)
{
return _eventListener.OnDisplayLock(userName);
}

public SWNM.HRESULT DisplayUnlock(string userName)
public HRESULT DisplayUnlock(string userName)
{
return _eventListener.OnDisplayUnlock(userName);
}

public SWNM.HRESULT StartScreenSaver(string userName)
public HRESULT StartScreenSaver(string userName)
{
return _eventListener.OnStartScreenSaver(userName);
}

public SWNM.HRESULT StopScreenSaver(string userName)
public HRESULT StopScreenSaver(string userName)
{
return _eventListener.OnStopScreenSaver(userName);
}
Expand Down
16 changes: 8 additions & 8 deletions src/Skylark.Wing/Interface/IEventListener.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SWNM = Skylark.Wing.Native.Methods;
using HRESULT = Skylark.Wing.Native.Methods.HRESULT;

namespace Skylark.Wing.Interface
{
Expand All @@ -12,48 +12,48 @@ public interface IEventListener
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnLogon(string userName);
HRESULT OnLogon(string userName);

/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnLogoff(string userName);
HRESULT OnLogoff(string userName);

/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnStartShell(string userName);
HRESULT OnStartShell(string userName);

/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnDisplayLock(string userName);
HRESULT OnDisplayLock(string userName);

/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnDisplayUnlock(string userName);
HRESULT OnDisplayUnlock(string userName);

/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnStartScreenSaver(string userName);
HRESULT OnStartScreenSaver(string userName);

/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
SWNM.HRESULT OnStopScreenSaver(string userName);
HRESULT OnStopScreenSaver(string userName);
}
}
Loading

0 comments on commit d1d7ea9

Please sign in to comment.