Exemplo n.º 1
0
        private void NoteCmMenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem menuItem = (MenuItem)sender;

            switch (menuItem.Header.ToString())
            {
            case "Cut":
                Clipboard.SetText(NodeNotesTextBlock.SelectedText);
                NodeNotesTextBlock.SelectedText = "";
                NodeNotesTextBlock.Focus();
                break;

            case "Copy":
                Clipboard.SetText(NodeNotesTextBlock.SelectedText);
                NodeNotesTextBlock.Focus();
                break;

            case "Paste":
                NodeNotesTextBlock.SelectedText = Clipboard.GetText();
                break;

            default:
                break;
            }
            cm.IsOpen = false;
        }
Exemplo n.º 2
0
        private void NodePropertiesDialog_Loaded(object sender, RoutedEventArgs e)
        {
            NodeProxy = DataContext as INodeProxy;
            if (NodeProxy != null)
            {
                _originalName = NodeProxy.Name;
                _originalNote = Note; //make a copy to restore closing
                if (Note != null)
                {
                    NodeNotesTextBlock.Text = Note;
                }
                NodeNotesTextBlock.Focus();
                NodeNotesTextBlock.SelectionStart = NodeNotesTextBlock.Text.Length;

                if (NodeProxy.Created != DateTime.MinValue)
                {
                    CreatedTimeTextBlock.Text = NodeProxy.Created.ToString("f");
                }
                if (NodeProxy.LastModified != DateTime.MinValue)
                {
                    ModifiedTimeTextBlock.Text = NodeProxy.LastModified.ToString("f");
                }


                if (NodeProxy.NodeType.Name == "CompendiumReferenceNode")
                {
                    MetadataContext context = new MetadataContext()
                    {
                        NodeUid      = NodeProxy.Id,
                        MetadataName = "LinkedFile.Source"
                    };
                    if (NodeProxy.HasMetadata(context))
                    {
                        Height = 480;
                        ReferenceLocationRow.Height       = new GridLength(30);
                        ReferenceNodeInfoPanel.Visibility = System.Windows.Visibility.Visible;

                        SoapMetadata linkedFileMetadata = NodeProxy.GetNodeMetadata(context);
                        ReferenceFileLocationTextBox.Text = linkedFileMetadata.MetadataValue;
                    }
                }
            }
        }