public void CanResolveStringSetting()
        {
            SomeSetting config = _configurationFactory.CreateConfigurationSetting(typeof(SomeSetting));

            config.Value.ShouldBeOfType <string>();
            config.Value.ShouldBe("SomeValue");
        }
示例#2
0
 public ValuesController(SomeSetting someSetting,
                         SomeNumberSetting someNumberSetting,
                         SomeComplexTypeSetting someComplexTypeSetting,
                         VeryStrangeSetting veryStrangeSetting,
                         ArraySetting arraySetting,
                         EnumSetting enumSetting,
                         BoolSetting boolSetting,
                         CustomKeySetting customKeySetting,
                         ComplexArraySetting complexArraySetting)
 {
     _someSetting            = someSetting;
     _someNumberSetting      = someNumberSetting;
     _someComplexTypeSetting = someComplexTypeSetting;
     _veryStrangeSetting     = veryStrangeSetting;
     _arraySetting           = arraySetting;
     _enumSetting            = enumSetting;
     _boolSetting            = boolSetting;
     _customKeySetting       = customKeySetting;
     _complexArraySetting    = complexArraySetting;
 }
示例#3
0
        private void NextWord()
        {
            _indexEWC = 0;

            if (_index < Word.CountWordForLearning)
            {
                _englishWord = _data.GetDictionary.Values.ElementAt(_index).WordEngl;

                string _previousEnglishWord = _data.GetDictionary.Values.ElementAt(_index - 1).WordEngl;

                IsCorrectAnswer(_previousEnglishWord);

                char[] _word = _englishWord.ToCharArray();

                _emptyWordCollection = null;

                _englishWordCollection = null;

                if (_englishWordCollection == null)
                {
                    EnglishWordCollection = new ObservableCollection <TextBox>();

                    _count = _word.Count();

                    SomeSetting.AddTB(EnglishWordCollection, _count);

                    SomeSetting.SettingTB(EnglishWordCollection);

                    SomeSetting.AddTextToTB(_word, EnglishWordCollection);

                    foreach (var item in _englishWordCollection)
                    {
                        item.MouseDoubleClick += (s, e) =>
                        {
                            _emptyWordCollection[_indexEWC].Text = item.Text;
                            _indexEWC++;
                            _englishWordCollection.Remove(item);
                        };
                    }
                }

                if (_emptyWordCollection == null)
                {
                    EmptyWordCollection = new ObservableCollection <TextBox>();

                    _count = _word.Count();

                    SomeSetting.AddTB(EmptyWordCollection, _count);

                    SomeSetting.SettingTB(EmptyWordCollection);

                    foreach (var item in _emptyWordCollection)
                    {
                        item.MouseDoubleClick += (s, e) =>
                        {
                            _englishWordCollection.Add(new TextBox());

                            SomeSetting.SettingTB(_englishWordCollection);

                            _englishWordCollection.Last().Text = item.Text;

                            item.Text = String.Empty;
                        };
                    }
                }



                _index++;
            }
            else
            {
                _codeBehind.LoadView(ViewType.Lisening);
            }
        }