Пример #1
0
        public void UpdateRecords()
        {
            var list = _booknote.GetAllRecords();

            Records.Children.Clear();
            _buttons = new List <RadioButton>(list.Count);
            foreach (var record in list)
            {
                var rb = new RadioButton {
                    GroupName = "Records", Content = record.ToString()
                };
                rb.MouseDoubleClick += (obj, args) =>
                {
                    MessageBox.Show((string)rb.Content,
                                    record.GetType().ToString(),
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Information);
                };
                _buttons.Add(rb);
                Records.Children.Add(rb);
            }
            InvalidateVisual();
        }
Пример #2
0
        public void AddCommand()
        {
            Assert.AreEqual(_booknote.GetAllRecords().Count, 0);
            var addCommand = _producer.GetCommand("TestAddRecord");

            addCommand.Execute();
            Assert.AreEqual(_booknote.GetAllRecords().Count, 1);
            for (var i = 0; i < Iterations; i++)
            {
                addCommand = _producer.GetCommand("TestAddRecord");
                addCommand.Execute();
            }
            Assert.AreEqual(_booknote.GetAllRecords().Count, Iterations + 1);
        }
Пример #3
0
 public IBaseCommand CreateProduct()
 {
     return(new ListCommand(_booknote.GetAllRecords()));
 }