public GamesListView(Size size, IgsServerInfo serverInfo, IGSObserver gameObserver) : base(size) { if ((serverInfo == null) || (gameObserver == null)) { throw new Exception("Argument canot be null"); } dataTable = new DataTable(); dataTable.BeginInit(); dataTable.Columns.AddRange(new DataColumn[] { new DataColumn("#", Type.GetType("System.Int32")), new DataColumn("White"), new DataColumn("WR", Type.GetType("IGoEnchi.IGSRank")), new DataColumn("Black"), new DataColumn("BR", Type.GetType("IGoEnchi.IGSRank")), new DataColumn("Moves", Type.GetType("System.Int32")), new DataColumn("Size", Type.GetType("System.Int32")), new DataColumn("Handi", Type.GetType("System.Int32")), new DataColumn("Komi", Type.GetType("System.Single")), new DataColumn("Byo", Type.GetType("System.Int32")), new DataColumn("Type"), new DataColumn("Obs", Type.GetType("System.Int32")) }); dataTable.EndInit(); var sort = ConfigManager.Settings.SortModes.Games; dataView = new DataView(dataTable) { AllowEdit = false, AllowDelete = false, AllowNew = false, Sort = dataTable.Columns.Contains(SortModes.ActualName(sort)) ? sort : "" }; dataGrid = new DataGrid() { Dock = DockStyle.Fill, RowHeadersVisible = false, DataSource = dataView, }; dataGrid.MouseDown += new MouseEventHandler(DataGridClick); this.serverInfo = serverInfo; serverInfo.GameListUpdated += new EventHandler(GamesListUpdated); Controls = new List <Control>() { dataGrid }; RefreshGamesList(); }
public ObservedGameView(Size size, ObservedGame game, GameRenderer renderer, IGSObserver gameObserver) : base(size, game, renderer, gameObserver) { this.gameObserver = gameObserver; AllowNavigation = true; AllowCursor = true; }
public IGSKibitzManager(IGSObserver gameObserver) { if (gameObserver == null) { throw new ArgumentException("Argument cannot be null"); } this.gameObserver = gameObserver; gameObserver.KibitzReceived += GetMessage; }