Ejemplo n.º 1
0
        private void FillGrid()
        {
            ReplicationServers.RefreshCache();
            _listReplicationServers = ReplicationServers.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("FormReplicationSetup", "Description"), 100);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("FormReplicationSetup", "server_id"), 65);
            gridMain.ListGridColumns.Add(col);
            if (PrefC.GetBool(PrefName.RandomPrimaryKeys))
            {
                col = new GridColumn(Lan.g("FormReplicationSetup", "Key Range Start"), 160);
                gridMain.ListGridColumns.Add(col);
                col = new GridColumn(Lan.g("FormReplicationSetup", "Key Range End"), 160);
                gridMain.ListGridColumns.Add(col);
            }
            col = new GridColumn(Lan.g("FormReplicationSetup", "AtoZ Path"), 160);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("FormReplicationSetup", "UpdateBlocked"), 100, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("FormReplicationSetup", "SlaveMonitor"), 100);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("FormReplicationSetup", "IsReport"), 100, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            for (int i = 0; i < _listReplicationServers.Count; i++)
            {
                row = new GridRow();
                row.Cells.Add(_listReplicationServers[i].Descript);
                row.Cells.Add(_listReplicationServers[i].ServerId.ToString());
                if (PrefC.GetBool(PrefName.RandomPrimaryKeys))
                {
                    row.Cells.Add(_listReplicationServers[i].RangeStart.ToString("n0"));
                    row.Cells.Add(_listReplicationServers[i].RangeEnd.ToString("n0"));
                }
                row.Cells.Add(_listReplicationServers[i].AtoZpath);
                row.Cells.Add(_listReplicationServers[i].UpdateBlocked ? "X" : "");
                row.Cells.Add(_listReplicationServers[i].SlaveMonitor.ToString());
                row.Cells.Add(_listReplicationServers[i].ReplicationServerNum == PrefC.GetLong(PrefName.ReplicationUserQueryServer) ? "X" : "");
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }