Skip to content

Commit

Permalink
v1.2.18
Browse files Browse the repository at this point in the history
- Added `MigEvent.Disabled` property to prevent event from being routed to configured gateways
  • Loading branch information
genemars committed Apr 7, 2024
1 parent f2117a1 commit c4c43de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MIG/MIG.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="WebsocketSharp.Standard2" Version="2022.4.16.1520" />
<PackageReference Include="MessagePack" Version="2.5.129" />
<PackageReference Include="MessagePack.Annotations" Version="2.5.129" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="MessagePack.Annotations" Version="2.5.140" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.3" />
Expand Down
3 changes: 3 additions & 0 deletions MIG/MigEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public double UnixTimestamp
public object Value { get; set; }
#endif

[NonSerialized, IgnoreMember]
public bool Disabled;

public MigEvent()
{
}
Expand Down
12 changes: 9 additions & 3 deletions MIG/MigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,15 @@ protected virtual void OnInterfacePropertyChanged(object sender, InterfaceProper
{
InterfacePropertyChanged(sender, args);
}
// Route event to MIG.Gateways as well
foreach (var gateway in Gateways)
gateway.OnInterfacePropertyChanged(sender, args);
// check if event has been flagged as "disabled" (Events.Disable)
if (!args.EventData.Disabled)
{
// Route event to MIG.Gateways as well
foreach (var gateway in Gateways)
{
gateway.OnInterfacePropertyChanged(sender, args);
}
}
}

#endregion
Expand Down

0 comments on commit c4c43de

Please sign in to comment.