Skip to content

Commit

Permalink
Merge pull request #604 from johncbaur/VIX-3552
Browse files Browse the repository at this point in the history
VIX-3552 Removing IPAddress Serialization Exception
  • Loading branch information
jeffu231 authored Jul 5, 2024
2 parents 5023d76 + bd2cd6f commit 834b95c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/Vixen.Modules/Controller/DDP/DDP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Vixen.Commands;
using System.Net.Sockets;
using System.Windows.Forms;
using System.Net;

namespace VixenModules.Output.DDP
{
Expand Down Expand Up @@ -75,7 +76,7 @@ public override bool Setup()
DDPSetup setup = new DDPSetup(_data);
if (setup.ShowDialog() == DialogResult.OK) {
if (setup.Address != null)
_data.Address = setup.Address;
_data.Address = setup.Address.ToString();
OpenConnection();
return true;
}
Expand Down Expand Up @@ -253,7 +254,7 @@ public override ControllerNetworkConfiguration GetNetworkConfiguration()
{
var config = new ControllerNetworkConfiguration();
config.SupportsUniverses = true;
config.IpAddress = _data.Address;
config.IpAddress = IPAddress.Parse(_data.Address);
config.ProtocolType = ProtocolTypes.DDP;
config.TransmissionMethod = TransmissionMethods.Unicast;
var universes = new List<UniverseConfiguration>(1);
Expand Down
6 changes: 3 additions & 3 deletions src/Vixen.Modules/Controller/DDP/DDPData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ namespace VixenModules.Output.DDP
public class DDPData : ModuleDataModelBase
{
[DataMember]
public IPAddress Address { get; set; }
public string Address { get; set; }

public DDPData()
{
Address = new IPAddress(new byte[] {127, 0, 0, 1});
Address = "127, 0, 0, 1";
}

public override IModuleDataModel Clone()
{
DDPData result = new DDPData();
result.Address = new IPAddress(Address.GetAddressBytes());
result.Address = Address;
return result;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Vixen.Modules/Controller/DDP/DDPSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public DDPSetup(DDPData data)
InitializeComponent();
ForeColor = ThemeColorTable.ForeColor;
BackColor = ThemeColorTable.BackgroundColor;
ThemeUpdateControls.UpdateControls(this);
Address = data.Address;
ThemeUpdateControls.UpdateControls(this);
Address = IPAddress.Parse(data.Address);
}

public IPAddress Address
Expand Down

0 comments on commit 834b95c

Please sign in to comment.