コード例 #1
0
        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();
        }
コード例 #2
0
        private void AWatcher(object sender, RoutedEventArgs e)
        {
            Watcher w = new Watcher();

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

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