public void Import(FileStream fs) { byte[] buf = new byte[System.Runtime.InteropServices.Marshal.SizeOf(typeof(Dummy.Keybinding.Event))]; edown.Clear(); eup.Clear(); eheld.Clear(); byte cnt = (byte)fs.ReadByte(); for (int i = 0; i != cnt; i++) { fs.Read(buf, 0, buf.Length); edown.Add(NativeInput.byte2struct <Dummy.Keybinding.Event>(buf)); } cnt = (byte)fs.ReadByte(); for (int i = 0; i != cnt; i++) { fs.Read(buf, 0, buf.Length); eup.Add(NativeInput.byte2struct <Dummy.Keybinding.Event>(buf)); } cnt = (byte)fs.ReadByte(); for (int i = 0; i != cnt; i++) { fs.Read(buf, 0, buf.Length); eheld.Add(NativeInput.byte2struct <Dummy.Keybinding.Event>(buf)); } }
public void Import(FileStream fs) { byte[] buf = new byte[System.Runtime.InteropServices.Marshal.SizeOf(typeof(Rectangle))]; fs.Read(buf, 0, buf.Length); rekt = NativeInput.byte2struct <Rectangle>(buf); kb = new Keybinding(); kb.Import(fs); }