예제 #1
0
        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();
        }
예제 #2
0
 public ObservedGameView(Size size,
                         ObservedGame game,
                         GameRenderer renderer,
                         IGSObserver gameObserver) : base(size, game, renderer, gameObserver)
 {
     this.gameObserver = gameObserver;
     AllowNavigation   = true;
     AllowCursor       = true;
 }
예제 #3
0
        public IGSKibitzManager(IGSObserver gameObserver)
        {
            if (gameObserver == null)
            {
                throw new ArgumentException("Argument cannot be null");
            }

            this.gameObserver            = gameObserver;
            gameObserver.KibitzReceived += GetMessage;
        }