Exemple #1
0
        public void AddProperty()
        {
            PendingConnectionViewModel pending = Parent.PendingConnection;

            if (pending == null || pending.Output == null || !(pending.Output.Parent is SubstanceNodeViewModel))
            {
                return;
            }

            SubstanceNodeViewModel sub_view = pending.Output.Parent as SubstanceNodeViewModel;

            NodeInputViewModel new_prop_input = new NodeInputViewModel();

            new_prop_input.Connections.Connect()
            .Subscribe(change => {
                OnPropertyInputChanged(change);
            });

            Inputs.Edit(x => x.Add(new_prop_input));

            ConnectionViewModel new_prop_connection = new ConnectionViewModel(
                Parent,
                new_prop_input,
                sub_view.Outputs.Items.First());

            Parent.Connections.Edit(x => x.Add(new_prop_connection));
        }
Exemple #2
0
        private ConnectionValidationResult ValidatePendingConnection(PendingConnectionViewModel arg)
        {
            DialogTree   tree         = m_project[(DialogTreeIdentifier)Branch];
            BranchOutput branchOutput = arg.Output as BranchOutput;

            if (tree == null || branchOutput == null || branchOutput.Branch == null ||
                tree.CheckForCircularDependency(branchOutput.Branch, Branch))
            {
                return(new ConnectionValidationResult(false, null));
            }

            return(new ConnectionValidationResult(true, null));
        }