示例#1
0
        public static CMEffectUI getTestData()
        {
            CMEffectUI ef = new CMEffectUI();

            ef.Id          = 1;
            ef.Description = "description";
            ef.RiskLevel   = 6;
            ef.EffectState = State.POSITIVE;
            return(ef);
        }
        public static IList <CMEffectUI> transformToListOfCMEffectUI(IList <Effect> __realEffectList)
        {
            IList <CMEffectUI> listResult = new List <CMEffectUI>();

            if (__realEffectList != null)
            {
                foreach (Effect realEffect in __realEffectList)
                {
                    CMEffectUI newMaskEff = new CMEffectUI(realEffect);
                    listResult.Add(newMaskEff);
                }
            }
            return(listResult);
        }
示例#3
0
        // Indicates if an object is the same, checking the id of the element.
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }
            // safe because of the GetType check
            CMEffectUI ele = (CMEffectUI)obj;

            // use this pattern to compare value members
            if (Id == 0 || ele.Id == 0)
            {
                return(Name.Equals(ele.Name));
            }
            return(Id.Equals(ele.Id));
        }
示例#4
0
        public static IList <CMEffectUI> getTestDataCollection()
        {
            IList <CMEffectUI> list = new List <CMEffectUI>();

            CMEffectUI ef = new CMEffectUI();

            ef.Id          = 1;
            ef.Description = "description1";
            ef.RiskLevel   = 6;
            ef.EffectState = State.POSITIVE;

            CMEffectUI ef2 = new CMEffectUI();

            ef.Id          = 2;
            ef.Description = "description2";
            ef.RiskLevel   = 10;
            ef.EffectState = State.FAULTY;

            list.Add(ef);
            list.Add(ef2);

            return(list);
        }
 private static void fillEffectReal(CMEffectUI __effectMask, Effect __realEffect)
 {
     __realEffect.Description  = __effectMask.Description;
     __realEffect.CurrentState = __effectMask.EffectState;
     __realEffect.RiskLevel    = __effectMask.RiskLevel;
 }