/// <summary> /// Updates the Class C grid Hosts /// TODO: move into view /// </summary> public void UpdateClassCDummies() { //get all known Hosts of the current range var start = CurrentClassCNetwork.ToLong(); var hosts = Hosts.Where(w => w.IP >= start && w.IP <= start + 255); //assign them to the grid foreach (var h in hosts) { ClassCDummies[h.IP - start].Host = h; } OnPropertyChanged("HostsOnline"); }
private void OnPreviousClassCNetwork(object parameter) { byte[] b = CurrentClassCNetwork.GetAddressBytes(); if (b[2] == 0) { if (b[1] == 0) { ChangeClassCNetwork(new IPAddress(new byte[] { (byte)(b[0] - 1), 254, 0, 0 })); } else { ChangeClassCNetwork(new IPAddress(new byte[] { b[0], (byte)(b[1] - 1), 254, 0 })); } } else { ChangeClassCNetwork(new IPAddress(new byte[] { b[0], b[1], (byte)(b[2] - 1), 0 })); } }
private void OnNextClassCNetwork(object parameter) { byte[] b = CurrentClassCNetwork.GetAddressBytes(); if (b[2] == 254) { if (b[1] == 254) { ChangeClassCNetwork(new IPAddress(new byte[] { (byte)(b[0] + 1), 0, 0, 0 })); } else { ChangeClassCNetwork(new IPAddress(new byte[] { b[0], (byte)(b[1] + 1), 0, 0 })); } } else { ChangeClassCNetwork(new IPAddress(new byte[] { b[0], b[1], (byte)(b[2] + 1), 0 })); } }
private bool CanPreviousClassCNetwork() { return(CurrentClassCNetwork.ToLong() > 1); }
private bool CanNextClassCNetwork() { return(CurrentClassCNetwork.ToLong() > 1); }