Exemplo n.º 1
0
        private void PageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox box       = sender as ListBox;
            object  selection = box.SelectedItem;

            if (selection != null)   // Can be null when this panel is reused
            {
                ArchiveNodeRepresentation node = (box.SelectedItem as ArchiveNodeRepresentation);
                // If next panel is not null then use it
                if (NextPanel != null)
                {
                    NextPanel.Update(node);
                    // (Window.GetWindow(this) as CollectionCreatorWindow).RemovePanelsFor(this);
                }
                // Otherwise create one
                else
                {
                    NextPanel = new VirtualArchivePanel(node);
                    (Window.GetWindow(this) as CollectionCreatorWindow).AddNextPanelFor(this, NextPanel);
                }

                // Notify Parent
                (Window.GetWindow(this) as CollectionCreatorWindow).UpdateContent(this, node);

                e.Handled = true;
            }
        }
Exemplo n.º 2
0
        private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            TextBox box = sender as TextBox;

            if (e.Key == Key.Enter)
            {
                box.IsReadOnly = true;

                // Commit name change
                ArchiveNodeRepresentation node = (box.DataContext as ArchiveNodeRepresentation);
                node.Name = box.Text;
                box.Text  = node.Name;  // Might have been stripped down
            }
        }
Exemplo n.º 3
0
        private void IconImage_MouseDown(object sender, MouseButtonEventArgs e)
        {
            ArchiveNodeRepresentation repre = (sender as Image).DataContext as ArchiveNodeRepresentation;

            switch (repre.Type)
            {
            case ArchiveNodeType.File:
            case ArchiveNodeType.Folder:
                System.Diagnostics.Process.Start(repre.Node.GetPath());
                break;

            case ArchiveNodeType.Link:
                VirtualWorkspaceWindow.CurrentWindow.OpenDocument(repre.Node.GetLinkedDocument(), false);
                break;

            case ArchiveNodeType.Virtual:
                break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
        private void CreateNewNodeButton_Click(object sender, RoutedEventArgs e)
        {
            ArchiveNodeRepresentation node = (sender as Button).DataContext as ArchiveNodeRepresentation;

            node.AddNode();
        }
Exemplo n.º 5
0
 internal void Update(ArchiveNodeRepresentation node)
 {
     NodePresentation = node;
     node.UpdateContents();
 }
Exemplo n.º 6
0
 internal VirtualArchivePanel(ArchiveNodeRepresentation node)
 {
     InitializeComponent();
     NodePresentation = node;
     node.UpdateContents();
 }