Skip to content

Commit

Permalink
Cache the PropertyControlInfo for the lossless property
Browse files Browse the repository at this point in the history
SetPropertyControlValue would have to retrieve the PropertyControlInfo
each time it is called.
  • Loading branch information
0xC0000054 committed Jun 10, 2022
1 parent 25f1645 commit 754d3be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/WebPFileType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props)

info.SetPropertyControlValue(PropertyNames.Quality, ControlInfoPropertyNames.DisplayName, GetString("Quality_DisplayName"));

info.SetPropertyControlValue(PropertyNames.Lossless, ControlInfoPropertyNames.DisplayName, string.Empty);
info.SetPropertyControlValue(PropertyNames.Lossless, ControlInfoPropertyNames.Description, GetString("Lossless_Description"));
PropertyControlInfo losslessPCI = info.FindControlForPropertyName(PropertyNames.Lossless);
losslessPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = string.Empty;
losslessPCI.ControlProperties[ControlInfoPropertyNames.Description].Value = GetString("Lossless_Description");

PropertyControlInfo forumLinkPCI = info.FindControlForPropertyName(PropertyNames.ForumLink);
forumLinkPCI.ControlProperties[ControlInfoPropertyNames.DisplayName].Value = GetString("ForumLink_DisplayName");
Expand Down

0 comments on commit 754d3be

Please sign in to comment.