public MainWindow()
        {
            _log.Info("create Main window");

            InitializeComponent();
            try
            {
                rootEntity = JsonConvert.DeserializeObject <RootEntity>(File.ReadAllText(Watcher.BACKUPFILE_LOCATION));

                instrument.Text = rootEntity.Instrument;
            }
            catch (Exception e)
            {
                rootEntity = new RootEntity()
                {
                    Alerts = new ObservableCollection <AlertSetupEntity>()
                };
            }


            dataGrid.ItemsSource = rootEntity.Alerts;
            _watcher             = new Watcher(this, rootEntity);

            rootEntity.Alerts.CollectionChanged += AlertSetupEntity_Changed;
        }
示例#2
0
 public Watcher(IWatcherObserver observer, RootEntity root)
 {
     this._observer = observer;
     _root          = root;
 }