private void CreateVisibilityControl(NameAttribute displayNameAttribute) { var visibilityControl = new ConfigVisibilityControl(_localController.GetLocalStrings <SDGuiStrings>(), _coreConfigSection, _buildController); visibilityControl.ConfigItemDisplayName = _localController.GetLocalString(displayNameAttribute.LocalType, displayNameAttribute.DisplayName); configItemPanel.Children.Add(visibilityControl); }
public void ShouldGetLocalizedDEStringByName() { // Arrange Thread.CurrentThread.CurrentCulture = new CultureInfo("de"); var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var strings = localController.GetLocalString(typeof(TestLocalStrings), "TestString1"); // Assert Assert.AreEqual("TestString1DE", strings); }
private void AddSection(IConfigSection configSection) { var displayNameAttribute = (NameAttribute)Attribute.GetCustomAttribute(configSection.GetType(), typeof(NameAttribute)); if (displayNameAttribute != null) { var configSectionControl = new ConfigSectionControl(_localController, _configController.GetConfigSection <ICoreConfigSection>(), _allExporters, _buildController); configSectionControl.SectionHeader = _localController.GetLocalString(displayNameAttribute.LocalType, displayNameAttribute.DisplayName); configSectionControl.ConfigSection = configSection; configPanel.Children.Add(configSectionControl); } }