public void ShowNodePropertiesDialog(INodeProxy node)
 {
     NodePropertiesDialog npd = new NodePropertiesDialog();
     npd.DataContext = node;
     MetadataContext noteKey = new MetadataContext()
     {
         NodeUid = node.Id,
         MetadataName = "Note"
     };
     if (node.HasMetadata(noteKey))
     {
         npd.Note = node.GetNodeMetadata(noteKey).MetadataValue;
     }
     npd.Closed += new EventHandler(NodePropertiesDialog_Close);
     npd.Show();
 }
        private void NodePropertiesDialog_Close(object sender, EventArgs e)
        {
            NodePropertiesDialog dialog = sender as NodePropertiesDialog;

            if (dialog != null)
            {
                if (dialog.DialogResult.Value)
                {
                    TypeManager        typeManager             = IoC.IoCContainer.GetInjectionInstance().GetInstance <TypeManager>();
                    IMetadataTypeProxy stringMetadataTypeProxy = typeManager.GetMetadataType("string");
                    Navigator.UpdateNodeMetadataAsync(dialog.NodeProxy, Guid.Empty, null, "Note", dialog.Note, stringMetadataTypeProxy);
                }
                else
                {
                    //cancel was selected
                }
            }
        }
        public void ShowNodePropertiesDialog(INodeProxy node)
        {
            NodePropertiesDialog npd = new NodePropertiesDialog();

            npd.DataContext = node;
            MetadataContext noteKey = new MetadataContext()
            {
                NodeUid      = node.Id,
                MetadataName = "Note"
            };

            if (node.HasMetadata(noteKey))
            {
                npd.Note = node.GetNodeMetadata(noteKey).MetadataValue;
            }
            npd.Closed += new EventHandler(NodePropertiesDialog_Close);
            npd.Show();
        }
Пример #4
0
 private void propertiesMenuItem_Click(object sender, RoutedEventArgs e)
 {
     NodePropertiesDialog npd = new NodePropertiesDialog();
     npd.DataContext = NodeProxy;
     MetadataContext noteKey = new MetadataContext()
     {
         MetadataName = "Note",
         NodeUid = NodeProxy.Id
     };
     if (NodeProxy.HasMetadata(noteKey))
     {
         npd.Note = NodeProxy.GetNodeMetadata(noteKey).MetadataValue;
     }
     npd.Closed += new EventHandler(NodePropertiesDialog_Close);
     npd.Show();
 }