// Separate thread private void eventsconsole_OnEventInfo(object sender, EventInfoReplyEventArgs e) { BeginInvoke((MethodInvoker) delegate { EventInf(e.MatchedEvent); }); }
// Separate thread private void eventsconsole_OnEventInfo(object sender, EventInfoReplyEventArgs e) { BeginInvoke(new MethodInvoker(() => { EventInf(e.MatchedEvent); })); }
void Directory_EventDetails(object sender, EventInfoReplyEventArgs e) { float x, y; Helpers.GlobalPosToRegionHandle((float)e.MatchedEvent.GlobalPos.X, (float)e.MatchedEvent.GlobalPos.Y, out x, out y); StringBuilder sb = new StringBuilder("secondlife://" + e.MatchedEvent.SimName + "/" + x + "/" + y + "/0" + System.Environment.NewLine); sb.AppendLine(e.MatchedEvent.ToString()); //sb.AppendFormat(" Name: {0} ({1})" + System.Environment.NewLine, e.MatchedEvent.Name, e.MatchedEvent.ID); //sb.AppendFormat(" Location: {0}/{1}/{2}" + System.Environment.NewLine, e.MatchedEvent.SimName, x, y); //sb.AppendFormat(" Date: {0}" + System.Environment.NewLine, e.MatchedEvent.Date); //sb.AppendFormat("Description: {0}" + System.Environment.NewLine, e.MatchedEvent.Desc); Console.WriteLine(sb.ToString()); Client.Directory.EventInfoReply -= Directory_EventDetails; }
void Directory_EventDetails(object sender, EventInfoReplyEventArgs e) { float x, y; Helpers.GlobalPosToRegionHandle((float)e.MatchedEvent.GlobalPos.X, (float)e.MatchedEvent.GlobalPos.Y, out x, out y); StringBuilder sb = new StringBuilder("secondlife://" + e.MatchedEvent.SimName + "/" + x + "/" + y + "/0" + System.Environment.NewLine); sb.AppendLine(e.MatchedEvent.ToString()); //sb.AppendFormat(" Name: {0} ({1})" + System.Environment.NewLine, e.MatchedEvent.Name, e.MatchedEvent.ID); //sb.AppendFormat(" Location: {0}/{1}/{2}" + System.Environment.NewLine, e.MatchedEvent.SimName, x, y); //sb.AppendFormat(" Date: {0}" + System.Environment.NewLine, e.MatchedEvent.Date); //sb.AppendFormat("Description: {0}" + System.Environment.NewLine, e.MatchedEvent.Desc); Console.WriteLine(sb.ToString()); Client.Directory.EventInfoReply -= Directory_EventDetails; }
void Directory_EventInfoReply(object sender, EventInfoReplyEventArgs e) { if (InvokeRequired) { BeginInvoke(new MethodInvoker(() => Directory_EventInfoReply(sender, e))); return; } var evt = e.MatchedEvent; pnlEventDetail.Visible = true; pnlEventDetail.Tag = evt; btnTeleport.Enabled = btnShowOnMap.Enabled = true; txtEventName.Text = evt.Name; txtEventType.Text = evt.Category.ToString(); txtEventMaturity.Text = evt.Flags.ToString(); txtEventDate.Text = Utils.UnixTimeToDateTime(evt.DateUTC).ToString("r"); txtEventDuration.Text = string.Format("{0}:{1:00}", evt.Duration / 60u, evt.Duration % 60u); txtEventOrganizer.Text = instance.Names.Get(evt.Creator, string.Empty); txtEventOrganizer.Tag = evt.Creator; txtEventLocation.Text = string.Format("{0} ({1}, {2}, {3})", evt.SimName, Math.Round(evt.GlobalPos.X % 256), Math.Round(evt.GlobalPos.Y % 256), Math.Round(evt.GlobalPos.Z)); txtEventDescription.Text = evt.Desc.Replace("\n", Environment.NewLine); }