Example #1
0
        public void UIUpdate(object data, object arguments, eUpdateVisibilty visiblity, ref List <Control> owners)
        {
            TriggerValue trigerValue = data as TriggerValue;

            if (trigerValue != null)
            {
                foreach (Control c in VarInHardPointsBar.GetLogicalControls())
                {
                    ITriggerUIUpdate ui = c as ITriggerUIUpdate;
                    if (ui != null)
                    {
                        ui.UIUpdate(data, arguments, visiblity, ref owners);
                    }
                }
                foreach (Control c in VarOutHardPointsBar.GetLogicalControls())
                {
                    ITriggerUIUpdate ui = c as ITriggerUIUpdate;
                    if (ui != null)
                    {
                        ui.UIUpdate(data, arguments, visiblity, ref owners);
                    }
                }
            }


            BasicArgument ba = arguments as BasicArgument;

            if (data == null)
            {
            }
            else if ((data == this.TriggerTemplateMapping) && (ba != null))
            {
                if (ba.mArgument == BasicArgument.eArgumentType.Search)
                {
                    owners.Add(this);
                }
            }

            //throw new Exception("The method or operation is not implemented.");
        }
Example #2
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;
            }
        }