public StaticCommandList() { InitializeComponent(); _myContext = new MyContext(); var historyBrowserConfiguation = IoC.Resolve <IHistoryBrowserConfiguration>(); var historyManagerRetriever = IoC.Resolve <IHistoryManagerRetriever>(); historyBrowserConfiguation.AddDynamicColumn("p1", "A wonderful p1"); historyBrowserConfiguation.AddDynamicColumn("p2", "A great p2"); HistoryColumns.ColumnByName("p1").Position = 0; HistoryColumns.User.Position = 1; HistoryColumns.Description.Position = 2; HistoryColumns.ColumnByName("p2").Position = 3; HistoryColumns.Description.Position = 4; HistoryColumns.State.Position = 5; _historyManager = historyManagerRetriever.Current; _historyBrowserPresenter = IoC.Resolve <IHistoryBrowserPresenter>(); _historyBrowserPresenter.Initialize(); var control = _historyBrowserPresenter.View as Control; control.Dock = DockStyle.Fill; panelControl1.Controls.Add(control); _historyBrowserPresenter.HistoryManager = _historyManager; _historyBrowserPresenter.UpdateHistory(); }
public void Initialize() { if (_initialized) { return; } //initialize view layout int position = 0; HistoryColumns.State.Position = position++; HistoryColumns.ColumnByName(Constants.Command.BUILDING_BLOCK_TYPE).Position = position++; HistoryColumns.ColumnByName(Constants.Command.BUILDING_BLOCK_NAME).Position = position++; HistoryColumns.CommandType.Position = position++; HistoryColumns.ObjectType.Position = position++; HistoryColumns.Description.Position = position++; HistoryColumns.User.Position = position++; HistoryColumns.Time.Position = position++; _historyBrowserPresenter.Initialize(); refreshHistory(); _initialized = true; }