예제 #1
0
 public void RemoveParam(IScnPrm prm)
 {
     if (Prms.Contains(prm))
     {
         Prms.Remove(prm);
         prm.GetVal = null;
         prm.SetVal = null;
         prm.MyDiff = null;
     }
 }
예제 #2
0
        public int AddParam(IScnPrm prm)
        {
            if (!Prms.Contains(prm))
            {
                if (prm.Owner != null && prm.Owner != this)
                {
                    prm.Owner.RemoveParam(prm);
                }

                Prms.Add(prm);
                prm.Owner = this;
            }
            return(Prms.Count);
        }
예제 #3
0
        public bool SetDiff(IScnPrm prm, Func <double, double> dPrmdtF, string dname = "")
        {
            if (!Prms.Contains(prm))
            {
                return(false);
            }
            var dprm = new ScnPrm();

            dprm.GetVal = new Func <double, double>(dPrmdtF);

            bool newname = dname == "";

            if (!newname)
            {
                dprm.Name = dname;
            }
            AddDiffPropToParam(prm, dprm, getNewName: newname);
            return(true);
        }
예제 #4
0
 public void AddDiffPropToParam(IScnPrm prm, IScnPrm dPrmDt, bool removeOldDt = true, bool getNewName = false)
 {
     if (!Prms.Contains(prm))
     {
         AddParam(prm);
     }
     if (removeOldDt && prm.MyDiff != null && Prms.Contains(prm.MyDiff))
     {
         Prms.Remove(prm.MyDiff);
     }
     if (getNewName)
     {
         dPrmDt.Name = prm.Name + "'";
     }
     prm.MyDiff = dPrmDt;
     if (dPrmDt.Owner == null)
     {
         AddParam(dPrmDt);
     }
 }