private void checkBox2_CheckedChanged(object sender, EventArgs e) { if (checkBox2.Checked) { if (IPAddressStart.Text != addressExampleText) { textBefore = IPAddressStart.Text; } IPAddressStart.Focus(); var start = localIP.Split('.').Select(str => Convert.ToInt32(str)).ToArray(); var end = localIP.Split('.').Select(str => Convert.ToInt32(str)).ToArray(); start[3] = 1; end[3] = 255; string lanRange = string.Join(".", start.Select(num => num.ToString())) + " - " + string.Join(".", end.Select(num => num.ToString())); IPAddressStart.Text = lanRange; ScanStart.Focus(); } else { IPAddressStart.Focus(); IPAddressStart.Text = textBefore; ScanStart.Focus(); } }
public void ScanArray() { ScanStart?.Invoke(this, EventArgs.Empty); for (var i = 0; i < numbers.Length; i++) { if (numbers[i] % 2 == 1) { var args = new OddNumberEventArgs(numbers[i]); IterateOdd?.Invoke(this, args); if (args.CancelRequested) { break; } } } ScanDone?.Invoke(this, EventArgs.Empty); }
internal void RaiseScanStartEvent(ScanStartEventArgs e) { ScanStart?.Invoke(this, e); }