Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
            }
        }