protected override void OnCreateControl() { base.OnCreateControl(); _History = new MruCollection <string>(Settings.Default.History, _HistoryDepth); _CommandBox.DataSource = _History.ToArray(); _CommandBox.SelectedIndex = -1; }
protected override void OnCreateControl() { base.OnCreateControl(); _History = new MruCollection<string>(Settings.Default.History, _HistoryDepth); _CommandBox.DataSource = _History.ToArray(); _CommandBox.SelectedIndex = -1; }
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"); }
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(); }
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"); }