private void SelectReferenceItem(NodeConfigSectionBase section, NodeConfigSectionBase section1) { if (section.AddCommandType != null) { } if (section1.AllowDuplicates) { InvertGraphEditor.WindowManager.InitItemWindow(section1.GenericSelector(GraphItem).ToArray(), (selected) => { GraphItem.AddReferenceItem(selected, section1); }); } else { InvertGraphEditor.WindowManager.InitItemWindow( section1.GenericSelector(GraphItem).ToArray() .Where( p => !GraphItem.PersistedItems.OfType <GenericReferenceItem>() .Select(x => x.SourceIdentifier) .Contains(p.Identifier)), (selected) => { GraphItem.AddReferenceItem(selected, section1); }); } }
private void SelectFromOptions(NodeConfigSectionBase section1, DiagramNodeViewModel vm) { InvertGraphEditor.WindowManager.InitItemWindow(section1.GenericSelector(GraphItem).ToArray(), (selected) => { var item = selected as GenericNodeChildItem; item.Node = vm.GraphItemObject as GraphNode; DiagramViewModel.CurrentRepository.Add(item); if (section1.OnAdd != null) { section1.OnAdd(item); } else { item.Name = item.Repository.GetUniqueName(section1.Name); } item.IsEditing = true; OnAdd(section1, item); }); }