public void AddNewLogEntry(object sender, NewLogEntryEventArgs e)
        {
            var logEntry = new LogEntry(e.LogEntry);
            if (Log.Count(l => l.Revision == logEntry.Revision) > 0)
            {
                SourceLogLogger.LogError($"Subscription \"{Name}\" already contains revision {logEntry.Revision}, date (ticks) {logEntry.CommittedDate.Ticks}");
            }

            logEntry.GenerateFlowDocuments();

            using (var db = SourceLogContextProvider())
            {
                logEntry.LogSubscription = db.LogSubscriptions.Find(LogSubscriptionId);
                db.LogEntries.Add(logEntry);
                db.SaveChanges();
            }

            logEntry.UnloadChangedFiles();

            if (_uiThread != null)
            {
                _uiThread.Post(entry =>
                    {
                        Log.Add((LogEntry)entry);
                        NotifyPropertyChanged("Log");
                        var logEntryInfo = new NewLogEntryInfoEventHandlerArgs
                            {
                                LogSubscriptionName = Name,
                                Author = ((LogEntry)entry).Author,
                                Message = ((LogEntry)entry).Message
                            };
                        NewLogEntry(this, logEntryInfo);
                    }, logEntry);
            }
        }
Beispiel #2
0
        void ViewModelNewLogEntry(object sender, NewLogEntryInfoEventHandlerArgs e)
        {
            var balloon = new NewLogEntryBalloon(e.LogSubscriptionName, e.Author, e.Message);

            NotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Fade, 5000);
        }
        void ViewModelNewLogEntry(object sender, NewLogEntryInfoEventHandlerArgs e)
        {
            var balloon = new NewLogEntryBalloon(e.LogSubscriptionName, e.Author, e.Message);

            NotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Fade, 5000);
        }