Пример #1
0
        public override void GridInsertRow <T>(
            SourceGrid.Grid grid,
            T item,
            Func <T, Color, Base.Grid.GridCellController> newCellController = null,
            int Index = -1)
        {
            int index = Index < 0 ? grid.RowsCount : Index;

            grid.Rows.Insert(index);
            grid.Rows[index].Tag = item;

            Type itemType = item.GetType();

            if (itemType == typeof(IPInfo))
            {
                IPInfo ipInfo = item as IPInfo;
                SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue);
                grid[index, 0] = newCell(ipInfo, ipInfo.IPAddressStr, CellController);
                grid[index, 1] = newCell(ipInfo, ipInfo.RoundtripTime, CellController);
                grid[index, 2] = newCell(ipInfo, ipInfo.HostName, CellController);
                grid[index, 3] = newCell(ipInfo, ipInfo.HostMac, CellController);
                Console.WriteLine(ipInfo.IPAddressStr);
                return;
            }

            {
                SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue);
                grid[index, 0] = newCell(item, item, CellController);
            }
        }
Пример #2
0
        public override void GridInsertRow <T>(
            SourceGrid.Grid grid,
            T item,
            Func <T, Color, Base.Grid.GridCellController> newCellController = null,
            int Index = -1)
        {
            int index = Index < 0 ? grid.RowsCount : Index;

            grid.Rows.Insert(index);
            grid.Rows[index].Tag = item;

            Type itemType = item.GetType();

            if (itemType == typeof(PortInfo))
            {
                PortInfo portInfo = item as PortInfo;
                SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue);
                grid[index, 0] = newCell(portInfo, portInfo.Port, CellController);
                grid[index, 1] = newCell(portInfo, portInfo.ProtocolType, CellController);
                grid[index, 2] = newCell(portInfo, portInfo.isOpen, CellController);
                return;
            }

            {
                SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue);
                grid[index, 0] = newCell(item, item, CellController);
            }
        }
Пример #3
0
        public override void GridInsertRow <T>(
            SourceGrid.Grid grid,
            T item,
            Func <T, Color, mySourceGridTools.GridCellController> newCellController = null,
            int Index = -1)
        {
            int index = Index < 0 ? grid.RowsCount : Index;

            grid.Rows.Insert(index);
            grid.Rows[index].Tag = item;

            Type itemType = item.GetType();

            SourceGrid.Cells.Controllers.IController CellController =
                (newCellController == null ?
                 new GridCellController(Color.LightBlue) :
                 CellController = newCellController(item, Color.LightBlue)
                );
            if (itemType == typeof(MyRow))
            {
                MyRow row = item as MyRow;
                for (int i = 0; i < row.Count; i++)
                {
                    grid[index, i] = newCell(row, row[Fields[i]], CellController);
                }
                return;
            }

            {
                grid[index, 0] = newCell(item, item, CellController);
            }
        }
Пример #4
0
 protected SourceGrid.Cells.Cell newCell <T, TSub>(
     T Item,
     TSub subItem,
     SourceGrid.Cells.Controllers.IController Controller = null)
 {
     SourceGrid.Cells.Cell cell = new SourceGrid.Cells.Cell(subItem)
     {
         Tag = Item
     };
     if (Controller != null)
     {
         cell.AddController(Controller);
     }
     return(cell);
 }
Пример #5
0
        public virtual void GridInsertRow <T>(
            SourceGrid.Grid grid,
            T item,
            Func <T, Color, GridCellController> newCellController = null,
            int Index = -1)
        {
            int index = Index < 0 ? grid.RowsCount : Index;

            grid.Rows.Insert(index);
            grid.Rows[index].Tag = item;

            Type itemType = item.GetType();

            {
                SourceGrid.Cells.Controllers.IController CellController = newCellController(item, Color.LightBlue);
                grid[index, 0] = newCell(item, item, CellController);
            }
        }