Exemplo n.º 1
0
 protected override void OnCreateControl()
 {
     base.OnCreateControl();
     _History = new MruCollection <string>(Settings.Default.History, _HistoryDepth);
     _CommandBox.DataSource    = _History.ToArray();
     _CommandBox.SelectedIndex = -1;
 }
Exemplo n.º 2
0
 protected override void OnCreateControl()
 {
   base.OnCreateControl();
   _History = new MruCollection<string>(Settings.Default.History, _HistoryDepth);
   _CommandBox.DataSource = _History.ToArray();
   _CommandBox.SelectedIndex = -1;
 }
Exemplo n.º 3
0
        public void Accessing_an_item_moves_it_to_the_top()
        {
            var stringCollection = new MruCollection <string>(12, new MruCollectionOptions <string> {
                InitialData = StringData
            });
            var june = stringCollection[5];

            june.ShouldBe("June");
            stringCollection.Peek(0).ShouldBe("June");
        }
Exemplo n.º 4
0
        public void Create_instance_with_valid_capacities(int capacity)
        {
            var sut1 = new MruCollection <int>(capacity);
            var sut2 = new MruCollection <NonEquatableReference>(capacity, new MruCollectionOptions <NonEquatableReference>
            {
                EqualityComparer = new NonEquatableEqualityComparer()
            });

            sut1.ShouldNotBeNull();
            sut2.ShouldNotBeNull();
        }
Exemplo n.º 5
0
        public void Accessing_an_item_should_not_trigger()
        {
            var stringCollection = new MruCollection <string>(12, new MruCollectionOptions <string>
            {
                InitialData = StringData,
                Triggers    = MruTriggers.ItemSetOrInserted
            });
            var june = stringCollection[5];

            june.ShouldBe("June");
            stringCollection.Peek(0).ShouldBe("January");
        }