Esempio n. 1
0
        // GroupInputHardPointsBar
        IControlPoint GetExternalInputControlPoint(IControlPoint originalSender)
        {
            if (mInputControlPointMap.ContainsKey(originalSender) == false)
            {
                BasicControlPoint proxy = new BasicControlPoint(mOuterGroup);
                //proxy.mbDontHide = true;
                proxy.Virtual = true;


                proxy.SetDirection(new Point(250, 0));

                proxy.TargetKey = originalSender.TargetKey;
                proxy.TypeKey   = originalSender.TypeKey;
                //proxy.BackColor = originalSender.BackColor;
                proxy.TagObject = this;
                proxy.ControlPointDescription = proxy.ControlPointDescription;

                proxy.ProxyTarget = originalSender;

                mControlPoints.Add(proxy);
                GroupInputHardPointsBar.AddControl(proxy);
                mInputControlPointMap[originalSender] = proxy;


                proxy.ControlPointConnected += new BasicControlPoint.ControlPointEvent(inproxy_ControlPointConnected);
                proxy.ControlPointRemoved   += new BasicControlPoint.ControlPointEvent(inproxy_ControlPointRemoved);
            }
            return(mInputControlPointMap[originalSender]);
        }
Esempio n. 2
0
        IControlPoint GetExternalOutputControlPoint(IControlPoint originalSender, IControlPoint originalTarget)
        {
            if (mOutputControlPointMap.ContainsKey(originalTarget) == false)
            {
                originalTarget.HasProxy = true;


                BasicControlPoint proxy = new BasicControlPoint(mOuterGroup);
                proxy.Virtual = true;

                proxy.SetDirection(new Point(-250, 0));

                //proxy.ChainChild = target;
                proxy.TargetKey = originalTarget.TargetKey;
                proxy.TypeKey   = originalTarget.TypeKey;
                //proxy.BackColor = originalSender.BackColor;
                proxy.ControlPointDescription = originalTarget.ControlPointDescription;

                proxy.Name        = originalTarget.ToString();
                proxy.TagObject   = this;
                proxy.ProxyTarget = originalTarget;


                mControlPoints.Add(proxy); //?
                GroupOutputHardPointsBar.AddControl(proxy);
                mOutputControlPointMap[originalTarget] = proxy;

                proxy.SenderControlPointConnected += new BasicControlPoint.ControlPointEvent(outproxy_ControlPointConnected);
                proxy.SenderControlPointRemoved   += new BasicControlPoint.ControlPointEvent(outproxy_ControlPointRemoved);
            }
            return(mOutputControlPointMap[originalTarget]);
        }
Esempio n. 3
0
        //Loads ui.  Creates values for the mappings if they do not exist
        private void LoadMappingUI(TriggerTemplateMapping mapping)
        {
            TriggerNameText.Text = Path.GetFileNameWithoutExtension(mapping.Name);

            foreach (TriggersTemplateInputVariable v in mapping.InputMappings)
            {
                TriggerParameterControl c   = new TriggerParameterControl();
                TriggerValue            val = new TriggerValue();

                if (mbDemoMode || (ParentTriggerNamespace.GetValues().ContainsKey(v.ID) == false) || (v.ID == -1))
                {
                    val.Name = v.Name;
                    val.Type = v.Type;
                    int newID = -1;
                    ParentTriggerNamespace.InsertValue(val, out newID);
                    v.ID = newID;

                    //this line set optional parmas to default off for newly placed templates
                    if (v.Optional == true)
                    {
                        val.IsNull = true;
                    }
                }
                else
                {
                    val = ParentTriggerNamespace.GetValues()[v.ID];
                }


                c.Init(null, v, val, ParentTriggerNamespace);

                VarInHardPointsBar.AddControl(c);
            }
            foreach (TriggersTemplateOutputVariable v in mapping.OutputMappings)
            {
                TriggerParameterControl c   = new TriggerParameterControl();
                TriggerValue            val = new TriggerValue();
                if (ParentTriggerNamespace.GetValues().ContainsKey(v.ID) == false)
                {
                    val.Name = v.Name;
                    val.Type = v.Type;
                    int newID = -1;
                    ParentTriggerNamespace.InsertValue(val, out newID);
                    v.ID = newID;
                }
                else
                {
                    val = ParentTriggerNamespace.GetValues()[v.ID];
                }
                c.Init(null, v, val, ParentTriggerNamespace);

                VarOutHardPointsBar.AddControl(c);
            }
            foreach (TriggersTemplateInputActionBinder b in mapping.TriggerInputs)
            {
                BasicControlPoint cp = new BasicControlPoint(mHost);

                INHardPointsBar.AddControl(cp);
                cp.TargetKey = "none";//"Trigger.Link.Back";
                cp.TypeKey   = "Trigger.Link.Forward";
                cp.BackColor = b.GetColor();
                cp.SetToolTipText(b.Name);
                cp.Name = b.Name;
                cp.SetDirection(new Point(-250, 0));
                cp.Tag        = this;
                cp.TagObject  = this;
                cp.RenderText = cp.Name;
                cp.ControlPointDescription = this.mTriggerTemplateMapping.Name + "." + b.Name;

                mControlPoints.Add(cp);

                mInputActionCPs[cp] = b;
            }
            //flowLayoutPanel1.Controls.Add(MakeLabel("OutputTriggers:"));
            foreach (TriggersTemplateOutputActionBinder b in mapping.TriggerOutputs)
            {
                BasicControlPoint cp = new BasicControlPoint(mHost);
                OutHardPointsBar.AddControl(cp);
                cp.TargetKey = "Trigger.Link.Forward";
                cp.TypeKey   = "none";//"Trigger.Link.Back";
                cp.BackColor = b.GetColor();
                cp.SetToolTipText(b.Name);
                cp.Name = b.Name;
                cp.SetDirection(new Point(250, 0));
                cp.Tag                     = this;
                cp.TagObject               = this;
                cp.RenderText              = b.Name;
                cp.ControlPointConnected  += new BasicControlPoint.ControlPointEvent(output_ControlPointConnected);
                cp.ControlPointRemoved    += new BasicControlPoint.ControlPointEvent(output_ControlPointRemoved);
                cp.ControlPointDescription = this.mTriggerTemplateMapping.Name + "." + b.Name;

                mControlPoints.Add(cp);

                mOutputActionCPs[cp] = b;
            }
        }