Inheritance: INotifyPropertyChanged
 private void EnsureInitialised(LogSubscription s)
 {
     if (s.LogProvider == null)
     {
         s.LoadPlugin();
         s.NewLogEntry += (o, e) => NewLogEntry(o, e);
     }
 }
Exemple #2
0
 private void EnsureInitialised(LogSubscription s)
 {
     if (s.LogProvider == null)
     {
         s.LoadPlugin();
         s.NewLogEntry += (o, e) => NewLogEntry(o, e);
     }
 }
 public LogSubscription AddLogSubscription(string name, string logProviderTypeName, string url)
 {
     var logSubscription = new LogSubscription(name, logProviderTypeName, url) { Log = new TrulyObservableCollection<LogEntry>() };
     using (var db = new SourceLogContext())
     {
         db.LogSubscriptions.Add(logSubscription);
         db.SaveChanges();
     }
     logSubscription.NewLogEntry += (o, e) => NewLogEntry(o, e);
     LogSubscriptions.Add(logSubscription);
     return logSubscription;
 }
Exemple #4
0
        public LogSubscription AddLogSubscription(string name, string logProviderTypeName, string url)
        {
            var logSubscription = new LogSubscription(name, logProviderTypeName, url)
            {
                Log = new TrulyObservableCollection <LogEntry>()
            };

            using (var db = new SourceLogContext())
            {
                db.LogSubscriptions.Add(logSubscription);
                db.SaveChanges();
            }
            logSubscription.NewLogEntry += (o, e) => NewLogEntry(o, e);
            LogSubscriptions.Add(logSubscription);
            return(logSubscription);
        }
        // used for editing a subscription
        public NewSubscriptionWindow(LogSubscription logSubscription)
        {
            _vm = new NewSubscriptionWindowViewModel();
            DataContext = _vm;

            InitializeComponent();

            txtName.Text = logSubscription.Name;
            ddlPlugin.SelectedValue = logSubscription.PluginTypeName;
            LogProviderPluginDropDownSelectionChanged(this, null);
            ((ISubscriptionSettings) grpSettings.Content).SettingsXml = logSubscription.Url;

            btnAdd.Visibility = Visibility.Hidden;
            btnUpdate.Visibility = Visibility.Visible;

            _logSubscription = logSubscription;
        }
 public void DeleteSubscription(LogSubscription logSubscription)
 {
     logSubscription.LogProvider.Dispose();
     logSubscription.UnsubscribeEvents();
     using (var db = new SourceLogContext())
     {
         foreach (var logEntry in logSubscription.Log)
         {
             logEntry.ChangedFiles = null;
             logEntry.LogSubscription = logSubscription;
         }
         db.LogSubscriptions.Attach(logSubscription);
         db.LogSubscriptions.Remove(logSubscription);
         db.SaveChanges();
     }
     _logSubscriptions.Remove(logSubscription);
 }
Exemple #7
0
 public void DeleteSubscription(LogSubscription logSubscription)
 {
     logSubscription.LogProvider.Dispose();
     logSubscription.UnsubscribeEvents();
     using (var db = new SourceLogContext())
     {
         foreach (var logEntry in logSubscription.Log)
         {
             logEntry.ChangedFiles    = null;
             logEntry.LogSubscription = logSubscription;
         }
         db.LogSubscriptions.Attach(logSubscription);
         db.LogSubscriptions.Remove(logSubscription);
         db.SaveChanges();
     }
     _logSubscriptions.Remove(logSubscription);
 }
 public void MarkAllLogEntriesAsRead(LogSubscription logSubscription)
 {
     foreach (var logEntry in logSubscription.Log)
     {
         MarkLogEntryAsRead.Execute(logEntry);
     }
 }
 public void DeleteSubscription(LogSubscription logSubscription)
 {
     LogSubscriptionManager.DeleteSubscription(logSubscription);
 }