public MainWindow()
        {
            InitializeComponent();

            watcher = new Watcher();
            watcher.Add(new Request("c:\\", true));


            watcher.OnAddedAsync += async(f, t) =>
            {
                Application.Current.Dispatcher.BeginInvoke(
                    DispatcherPriority.Background,
                    new Action(() => {
                    ListBoxItem item = new ListBoxItem();
                    item.Content     = f.FileSystemInfo.FullName;
                    LB.Items.Add(item);
                }));
            };

            watcher.Start();
        }
Esempio n. 2
0
        private void AWatcher(object sender, RoutedEventArgs e)
        {
            Watcher w = new Watcher();

            ((MainWindow)Application.Current.MainWindow).Content = w;
        }
Esempio n. 3
0
        //Kembali ke page Watcher
        private void backTo(object sender, RoutedEventArgs e)
        {
            Watcher p = new Watcher();

            ((MainWindow)Application.Current.MainWindow).Content = p;
        }