Skip to content

Commit

Permalink
feat: support different distributor names for a package, this can hap…
Browse files Browse the repository at this point in the history
…pen if the owner decides to switch the name of the company
  • Loading branch information
iadonkey committed Jan 21, 2024
1 parent ce7b965 commit 72da9ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions TwinpackShared/TwinpackUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,9 @@ public static void RemoveReference(ITcPlcLibraryManager libManager, string place
itemDistributorName = plcLibrary.Distributor;
}

if (string.Equals(itemPlaceholderName, placeholderName, StringComparison.InvariantCultureIgnoreCase) &&
string.Equals(itemDistributorName, distributorName, StringComparison.InvariantCultureIgnoreCase))
if (string.Equals(itemPlaceholderName, placeholderName, StringComparison.InvariantCultureIgnoreCase))
{
_logger.Info($"Remove reference to {placeholderName} (version: {itemVersion}, distributor: {itemDistributorName})");
_logger.Info($"Remove reference {placeholderName} (version: {itemVersion}, distributor: {itemDistributorName})");
libManager.RemoveReference(placeholderName);
}
}
Expand Down
2 changes: 1 addition & 1 deletion TwinpackVsixShared/Dialogs/PackageVersionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private async void Window_Loaded(object sender, RoutedEventArgs e)
TargetsView.SelectedIndex = target != null ? UserInfo.Targets.IndexOf(target) : 0;
FileTypeView.SelectedIndex = _packageVersion?.Compiled == 1 ? 1 : 0;

IsConfigured = _plcConfig != null && (_package?.PackageId == null || _plcConfig.Name == _package.Name && _plcConfig.DistributorName == _package.DistributorName && _package.Repository == _twinpackServer.Username);
IsConfigured = _plcConfig != null && (_package?.PackageId == null || _plcConfig.Name == _package.Name && _package.Repository == _twinpackServer.Username);
IsNewPackage = _package.PackageId == null;
if (IsNewPackage)
License = (cmbLicense.Items[2] as ComboBoxItem).Content.ToString();
Expand Down

0 comments on commit 72da9ee

Please sign in to comment.