Skip to content

Conversation

@voltaney
Copy link
Owner

@voltaney voltaney commented Apr 5, 2025

What's new?

  • Changed method name from GetAllLocalIPv4 to GetAllLocalIPv4ByNIC in NetworkHelper.cs while keeping the default parameter.
  • Added a new method GetAllLocalIPv4 to retrieve local IPv4 addresses of the current machine.
  • Updated MainViewModel.cs to convert the result of GetAllLocalIPv4 to a list for improved IP address handling.

- Changed method name from `GetAllLocalIPv4` to `GetAllLocalIPv4ByNIC` in `NetworkHelper.cs` while keeping the default parameter.
- Added a new method `GetAllLocalIPv4` to retrieve local IPv4 addresses of the current machine.
- Updated `MainViewModel.cs` to convert the result of `GetAllLocalIPv4` to a list for improved IP address handling.
@voltaney voltaney requested a review from Copilot April 5, 2025 19:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

TouchSenderTablet.GUI/ViewModels/MainViewModel.cs:116

  • Consider using the candidateIpAddresses variable consistently instead of recalling NetworkHelper.GetAllLocalIPv4(), to ensure uniformity and prevent discrepancies in the displayed data.
IpAddresses = candidateIpAddresses.Count > 0 ? string.Join(" / ", NetworkHelper.GetAllLocalIPv4()) : "Unknown".GetLocalized();

TouchSenderReceiver/Helpers/NetworkHelper.cs:17

  • The list initialization syntax '[]' is not valid in C#. Replace it with 'new List();'.
List<string> ipAddrList = [];

- Changed the assignment of `IpAddresses` to use the pre-fetched `candidateIpAddresses` list instead of calling `NetworkHelper.GetAllLocalIPv4()` twice.
- Improved code efficiency by avoiding redundant method calls.
@voltaney voltaney requested a review from Copilot April 5, 2025 19:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

TouchSenderReceiver/Helpers/NetworkHelper.cs:17

  • The list initialization syntax is incorrect; replace [] with new List() to properly instantiate the list.
List<string> ipAddrList = [];

@voltaney voltaney merged commit c2b192d into main Apr 5, 2025
2 checks passed
@voltaney voltaney deleted the fix/show-all-type-local-ip branch April 5, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants