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; } }
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 } }
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; } }
private void CreateNewNodeButton_Click(object sender, RoutedEventArgs e) { ArchiveNodeRepresentation node = (sender as Button).DataContext as ArchiveNodeRepresentation; node.AddNode(); }
internal void Update(ArchiveNodeRepresentation node) { NodePresentation = node; node.UpdateContents(); }
internal VirtualArchivePanel(ArchiveNodeRepresentation node) { InitializeComponent(); NodePresentation = node; node.UpdateContents(); }