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 PlayersListView(Size size, IgsServerInfo serverInfo) : base(size) { if ((serverInfo == null)) { throw new Exception("Argument canot be null"); } dataTable = new DataTable(); dataTable.BeginInit(); dataTable.Columns.AddRange(new DataColumn[] { new DataColumn("Flags"), new DataColumn("Name"), new DataColumn("Rank", Type.GetType("IGoEnchi.IGSRank")), new DataColumn("Won", Type.GetType("System.Int32")), new DataColumn("Lost", Type.GetType("System.Int32")), new DataColumn("Playing", Type.GetType("System.Int32")), new DataColumn("Observing", Type.GetType("System.Int32")), new DataColumn("Idle"), new DataColumn("Country"), new DataColumn("Info") }); dataTable.EndInit(); var sort = ConfigManager.Settings.SortModes.Players; 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.PlayersListUpdated += new EventHandler(PlayersListUpdated); Controls = new List <Control>() { dataGrid }; RefreshPlayersList(); }
public Settings() { DefaultFontName = "Tahoma"; DefaultEncodingName = "utf-8"; CurrentAccountName = IGSAccount.DefaultAccount.Name; Accounts = new List <IGSAccount>(); Renderer = RendererType.GDI; KeepCursor = false; FriendsNotify = true; ChatNotify = true; SortModes = new SortModes() { Games = "", Players = "" }; ButtonBindings = new string[0]; GnuGoSettings = GnuGoSettings.Default; }