Пример #1
0
 private void RefreshSearchPathButton_Click(object sender, System.EventArgs e)
 {
     // Clear ths listbox if it contains any items
     SearchPathList.Items.Clear();
     // Add the items to the list
     SearchPathList.Items.AddRange(PhysFS.GetSearchPath());
 }
 static bool GetSearchPath(string[] args)
 {
     foreach (var d in physFS.GetSearchPath())
     {
         Console.WriteLine(" - {0}", d);
     }
     return(true);
 }
Пример #3
0
 private void AddSearchPathButton_Click(object sender, System.EventArgs e)
 {
     // Add search path
     PhysFS.AddToSearchPath(NewSearchPathText.Text, false);
     // Clear ths listbox if it contains any items
     SearchPathList.Items.Clear();
     // Add the items to the list
     SearchPathList.Items.AddRange(PhysFS.GetSearchPath());
 }
Пример #4
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());
     }
 }
Пример #5
0
        public void Mounting()
        {
            using var pfs = new PhysFS("");
            pfs.GetSearchPath().Should().BeEmpty();

            pfs.Mount("./", "/", false);

            pfs.GetSearchPath().Should().BeEquivalentTo(new string[] { "./" });
            pfs.GetMountPoint("./").Should().Be("/");
            pfs.IsDirectory("/").Should().BeTrue();

            pfs.Mount("../", "foo", true);
            pfs.GetSearchPath().Should().BeEquivalentTo(new string[] { "./", "../" });
            pfs.GetMountPoint("../").Should().Be("foo/");
            pfs.IsDirectory("/foo").Should().BeTrue();

            pfs.Mount("../../", "bar", false);
            pfs.GetSearchPath().Should().BeEquivalentTo(new string[] { "../../", "./", "../" });
            pfs.GetMountPoint("../../").Should().Be("bar/");
            pfs.IsDirectory("/bar").Should().BeTrue();

            pfs.UnMount("../");
            pfs.GetSearchPath().Should().BeEquivalentTo(new string[] { "../../", "./" });
        }
        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());
            }
        }