public void RemoveItemTest()
        {
            FileCollection fc;
            Package        package;
            File           f;


            //
            // Setup the test.
            //
            package = new Package();
            fc      = new FileCollection(package);
            f       = new File();
            fc.Add(f);

            //
            // Run the test.
            //
            fc.Remove(f);

            //
            // Verify the test.
            //
            Assert.AreEqual(null, f.Package);
            Assert.AreEqual(0, fc.Count);
        }
Beispiel #2
0
        private void FileSystem_Deleted(object sender, FileSystemEventArgs e)
        {
            if (!CheckAccess())
            {
                BeginInvoke(() => FileSystem_Deleted(sender, e));
                return;
            }

            FileView fv = FileCollection.Find(e.Name);

            if (null != fv)
            {
                DirectorySizeBytes -= fv.Size ?? 0;
                FileCollection.Remove(fv);
            }
        }