IOsbideEvent IOsbideEvent.FromDict(Dictionary <string, object> values) { EditorActivityEvent evt = new EditorActivityEvent(); if (values.ContainsKey("Id")) { evt.Id = (int)values["Id"]; } if (values.ContainsKey("EventLogId")) { evt.EventLogId = (int)values["EventLogId"]; } if (values.ContainsKey("EventLog")) { evt.EventLog = (EventLog)values["EventLog"]; } if (values.ContainsKey("EventDate")) { evt.EventDate = (DateTime)values["EventDate"]; } if (values.ContainsKey("SolutionName")) { evt.SolutionName = values["SolutionName"].ToString(); } return(evt); }
/// <summary> /// Called whenever the current line gets modified (text added / deleted). Only raised at a maximum of /// once per minute in order to undercut the potential flood of event notifications. /// </summary> /// <param name="StartPoint"></param> /// <param name="EndPoint"></param> /// <param name="Hint"></param> public override void EditorLineChanged(TextPoint StartPoint, TextPoint EndPoint, int Hint) { base.EditorLineChanged(StartPoint, EndPoint, Hint); if (LastEditorActivityEvent < DateTime.UtcNow.Subtract(new TimeSpan(0, 1, 0))) { LastEditorActivityEvent = DateTime.UtcNow; EditorActivityEvent activity = new EditorActivityEvent(); activity.EventDate = DateTime.UtcNow; activity.SolutionName = Path.GetFileName(dte.Solution.FullName); NotifyEventCreated(this, new EventCreatedArgs(activity)); } }