Example #1
0
 private void RemovePathButton_Click(object sender, System.EventArgs e)
 {
     if (SearchPathList.SelectedItem != null)
     {
         PhysFS.RemoveFromSearchPath(SearchPathList.SelectedItem.ToString());
         // Clear ths listbox if it contains any items
         SearchPathList.Items.Clear();
         // Add the items to the list
         SearchPathList.Items.AddRange(PhysFS.GetSearchPath());
     }
 }
        void Mounting()
        {
            using (var pfs = new PhysFS(""))
            {
                Assert.Empty(pfs.GetSearchPath());
                pfs.Mount("./", "/", false);
                Assert.Equal(new string[] { "./" }, pfs.GetSearchPath());
                Assert.Equal("/", pfs.GetMountPoint("./"));
                Assert.True(pfs.IsDirectory("/"));

                pfs.Mount("../", "foo", true);
                Assert.Equal(new string[] { "./", "../", }, pfs.GetSearchPath());
                Assert.Equal("foo/", pfs.GetMountPoint("../"));
                Assert.True(pfs.IsDirectory("/foo"));

                pfs.Mount("../../", "bar", false);
                Assert.Equal(new string[] { "../../", "./", "../", }, pfs.GetSearchPath());
                Assert.Equal("bar/", pfs.GetMountPoint("../../"));
                Assert.True(pfs.IsDirectory("/bar"));

                pfs.RemoveFromSearchPath("../");
                Assert.Equal(new string[] { "../../", "./", }, pfs.GetSearchPath());
            }
        }