예제 #1
0
        private void CreateNewSectionItem(NodeConfigSectionBase section1, DiagramNodeViewModel vm)
        {
            var item = Activator.CreateInstance(section1.SourceType) as GenericNodeChildItem;

            item.Node = vm.GraphItemObject as GraphNode;
            DiagramViewModel.CurrentRepository.Add(item);
            item.Name = item.Repository.GetUniqueName(section1.Name);

            OnAdd(section1, item);

            if (typeof(ITypedItem).IsAssignableFrom(section1.SourceType))
            {
                InvertApplication.Execute(new SelectTypeCommand()
                {
                    PrimitiveOnly     = false,
                    AllowNone         = false,
                    IncludePrimitives = true,
                    Item = item as ITypedItem,
                    OnSelectionFinished = () =>
                    {
                        item.IsSelected = true;
                        item.IsEditing  = true;
                    }
                });
            }
            else
            {
                item.IsEditing = true;
            }
        }
예제 #2
0
        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);
            });
        }
예제 #3
0
 public GenericItemViewModel(TData data, DiagramNodeViewModel nodeViewModel) : base(data, nodeViewModel)
 {
 }
예제 #4
0
 public GenericItemViewModel(DiagramNodeViewModel nodeViewModel) : base(nodeViewModel)
 {
 }
예제 #5
0
 protected TypedItemViewModel(ITypedItem viewModelItem, DiagramNodeViewModel nodeViewModel)
     : base(nodeViewModel)
 {
     DataObject = viewModelItem;
 }
예제 #6
0
 private void OnAdd(NodeConfigSectionBase section, NodeConfigSectionBase section1, DiagramNodeViewModel vm)
 {
     if (section1.AllowAdding && section1.ReferenceType != null && !section1.HasPredefinedOptions)
     {
         SelectReferenceItem(section, section1);
     }
     else
     {
         if (section1.GenericSelector != null && section1.HasPredefinedOptions)
         {
             SelectFromOptions(section1, vm);
         }
         else
         {
             CreateNewSectionItem(section1, vm);
         }
     }
 }
 public GenericChildItemHeaderDrawer(DiagramNodeViewModel viewModelObject)
     : base(viewModelObject)
 {
 }
 public PropertyFieldViewModel(DiagramNodeViewModel nodeViewModel) : base(nodeViewModel)
 {
 }
예제 #9
0
 public ItemViewModel(TData data, DiagramNodeViewModel nodeViewModel)
     : base(nodeViewModel)
 {
     Data = data;
 }
예제 #10
0
 protected TypedItemViewModel(ITypedItem viewModelItem, DiagramNodeViewModel nodeViewModel)
     : base(viewModelItem, nodeViewModel)
 {
 }