Beispiel #1
0
        IOsbideEvent IOsbideEvent.FromDict(Dictionary <string, object> values)
        {
            SaveEvent evt = new SaveEvent();

            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();
            }
            if (values.ContainsKey("DocumentId"))
            {
                evt.DocumentId = (int)values["DocumentId"];
            }
            if (values.ContainsKey("Document"))
            {
                evt.Document = (CodeDocument)values["Document"];
            }
            return(evt);
        }
        public override void DocumentSaved(Document document)
        {
            base.DocumentSaved(document);
            SaveEvent save = new SaveEvent();

            save.EventDate    = DateTime.UtcNow;
            save.SolutionName = dte.Solution.FullName;
            save.Document     = (CodeDocument)DocumentFactory.FromDteDocument(document);

            //let others know that we have a new event
            NotifyEventCreated(this, new EventCreatedArgs(save));
        }