public WidgetSettingsControl(WidgetSettings data) { _data = data; InitializeComponent(); if ((CreateGraphics()).DpiX > 96) { var font = new Font(styleController.Appearance.Font.FontFamily, styleController.Appearance.Font.Size - 2, styleController.Appearance.Font.Style); styleController.Appearance.Font = font; styleController.AppearanceDisabled.Font = font; styleController.AppearanceDropDown.Font = font; styleController.AppearanceDropDownHeader.Font = font; styleController.AppearanceFocused.Font = font; styleController.AppearanceReadOnly.Font = font; radioButtonWidgetTypeCustom.Font = new Font(radioButtonWidgetTypeCustom.Font.FontFamily, radioButtonWidgetTypeCustom.Font.Size - 2, radioButtonWidgetTypeCustom.Font.Style); radioButtonWidgetTypeDisabled.Font = new Font(radioButtonWidgetTypeDisabled.Font.FontFamily, radioButtonWidgetTypeDisabled.Font.Size - 2, radioButtonWidgetTypeDisabled.Font.Style); buttonXSearch.Font = new Font(buttonXSearch.Font.FontFamily, buttonXSearch.Font.Size - 2, buttonXSearch.Font.Style); } }
public static void ApplyWidgets(this IEnumerable<BaseLibraryLink> links, WidgetSettings widgetSettings = null) { foreach (var libraryLink in links) { libraryLink.Widget = widgetSettings != null ? widgetSettings.Clone<LinkWidgetSettings>(libraryLink) : SettingsContainer.CreateInstance<LinkWidgetSettings>(libraryLink); libraryLink.MarkAsModified(); } }