private async void button_read_float_Click(object sender, EventArgs e) { // float if (isAsync) { button_read_float.Enabled = false; if (textBox5.Text == "1") { DemoUtils.ReadResultRender(await readWriteNet.ReadFloatAsync(textBox3.Text), textBox3.Text, textBox4); } else { DemoUtils.ReadResultRender(await readWriteNet.ReadFloatAsync(textBox3.Text, ushort.Parse(textBox5.Text)), textBox3.Text, textBox4); } button_read_float.Enabled = true; } else { if (textBox5.Text == "1") { DemoUtils.ReadResultRender(readWriteNet.ReadFloat(textBox3.Text), textBox3.Text, textBox4); } else { DemoUtils.ReadResultRender(readWriteNet.ReadFloat(textBox3.Text, ushort.Parse(textBox5.Text)), textBox3.Text, textBox4); } } }
private async void button_read_float_Click(object sender, EventArgs e) { // float if (isAsync) { button_read_float.Enabled = false; if (textBox5.Text == "1") { DateTime start = DateTime.Now; OperateResult <float> read = await readWriteNet.ReadFloatAsync(textBox3.Text); SetTimeSpend(Convert.ToInt32((DateTime.Now - start).TotalMilliseconds)); DemoUtils.ReadResultRender(read, textBox3.Text, textBox4); } else { DateTime start = DateTime.Now; OperateResult <float[]> read = await readWriteNet.ReadFloatAsync(textBox3.Text, ushort.Parse(textBox5.Text)); SetTimeSpend(Convert.ToInt32((DateTime.Now - start).TotalMilliseconds)); DemoUtils.ReadResultRender(read, textBox3.Text, textBox4); } button_read_float.Enabled = true; } else { if (textBox5.Text == "1") { DateTime start = DateTime.Now; OperateResult <float> read = readWriteNet.ReadFloat(textBox3.Text); SetTimeSpend(Convert.ToInt32((DateTime.Now - start).TotalMilliseconds)); DemoUtils.ReadResultRender(read, textBox3.Text, textBox4); } else { DateTime start = DateTime.Now; OperateResult <float[]> read = readWriteNet.ReadFloat(textBox3.Text, ushort.Parse(textBox5.Text)); SetTimeSpend(Convert.ToInt32((DateTime.Now - start).TotalMilliseconds)); DemoUtils.ReadResultRender(read, textBox3.Text, textBox4); } } }