///<summary>Raises the SimConnected Event</summary> /// <param name="e">A SimConnectedEventArgs object containing /// the data sent from the simulator</param> protected virtual void OnSimDiscovered(SimDiscoveredEventArgs e) { EventHandler<SimDiscoveredEventArgs> handler = m_SimDiscovered; if (handler != null) handler(this, e); }
void Network_SimDiscovered(object sender, SimDiscoveredEventArgs e) { Logger.Log("*** Sim Discovered " + e.Simulator.Handle + " " + e.Simulator.Name, Helpers.LogLevel.Info); ThreadPool.QueueUserWorkItem(sync => { Dictionary<string, string> parameters = new Dictionary<string, string>(); Dictionary<string, string> conditions = new Dictionary<string, string>(); parameters.Add("Grid", MainClass.db.gridKey.ToString()); parameters.Add("Handle", e.Simulator.Handle.ToString()); parameters.Add("Name", e.Simulator.Name); parameters.Add("Owner", MainClass.db.compressUUID(e.Simulator.SimOwner)); MainClass.db.genericInsertIgnore("Region", parameters); }); }