private void CreateBtn_Click(object sender, RoutedEventArgs e)
        {
            CreateWorkspaceFile open = new CreateWorkspaceFile();

            if (open.ShowDialog() == true)
            {
                string label = open.Label;
                string path  = open.Path;
                try
                {
                    WorkspaceManager.CreateWorkspace(label, path);
                }
                catch (Exception)
                {
                    MessageBox.Show($"Permission denied for path '{open.Path}'", "Permission Denied", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                WorkspaceWindow workspaceWindow = new WorkspaceWindow(open.Path);
                workspaceWindow.Show();

                this.Close();
            }
        }
Пример #2
0
        [Test] public void TestFilterList()
        {
            IResource person = _storage.NewResource("Person");
            IResource email  = _storage.NewResource("Email");

            person.AddLink(_propAuthor, email);

            IResource workspace = _workspaceManager.CreateWorkspace("Test");

            _workspaceManager.AddResourceToWorkspace(workspace, person);

            IResourceList resList = _workspaceManager.GetFilterList(workspace);

            Assert.AreEqual(2, resList.Count);
            resList.Sort("ID");
            Assert.AreEqual(person.Id, resList [0].Id);
            Assert.AreEqual(email.Id, resList [1].Id);

            person.DeleteLink(_propAuthor, email);
            Assert.AreEqual(1, _workspaceManager.GetFilterList(workspace).Count);
        }