private static void Timer_Elapsed(object sender, ElapsedEventArgs e) { #region Debug Raw Data Incomming event RawDataIncommingEventArgs rawArgs = new RawDataIncommingEventArgs(); rawArgs.CanId = random.Next(0x7ff); Func <List <byte> > autoRandomPackage = () => { List <byte> result = new List <byte>(); int packageLen = random.Next(8); packageLen = Math.Max(1, packageLen); for (int i = 0; i < packageLen; i++) { result.Add((byte)random.Next(0xff)); } return(result); }; rawArgs.Data = autoRandomPackage(); RawDataIncomming?.Invoke(rawArgs); #endregion #region Debug Parsing incomming event ParsingDataIncommingEventArgs parsingArgs = new ParsingDataIncommingEventArgs(); parsingArgs.EntryList = new List <KeyValuePair <string, string> >(); int argsCount = random.Next(0x30); argsCount = Math.Max(argsCount, 1); for (int i = 0; i < argsCount; i++) { parsingArgs.EntryList.Add(new KeyValuePair <string, string>( string.Format("Key={0}", random.Next(0x10)), string.Format("Value={0}", random.Next(0x10)))); } ParsingDataIncomming?.Invoke(parsingArgs); #endregion }
public static void FireRawDataIncommingEvent(RawDataIncommingEventArgs args) { RawDataIncomming?.Invoke(args); }