Esempio n. 1
0
 public MiMFa_Percent SetValue(MiMFa_Percent percent)
 {
     None     = percent.None;
     Positive = percent.Positive;
     Negative = percent.Negative;
     return(this);
 }
Esempio n. 2
0
 public MiMFa_Percent(MiMFa_Percent mp)
 {
     Positive   = mp.Positive;
     None       = mp.None;
     Negative   = mp.Negative;
     FinalScore = mp.FinalScore;
 }
Esempio n. 3
0
 public MiMFa_Percent RemoveValue(MiMFa_Percent percent)
 {
     None     -= percent.None;
     Positive -= percent.Positive;
     Negative -= percent.Negative;
     return(this);
 }
Esempio n. 4
0
 public static MiMFa_Percent Min(MiMFa_Percent op1, MiMFa_Percent op2)
 {
     if (op1 < op2)
     {
         return(op1);
     }
     return(op2);
 }
Esempio n. 5
0
 public static MiMFa_Percent Max(MiMFa_Percent op1, MiMFa_Percent op2)
 {
     if (op1 > op2)
     {
         return(op1);
     }
     return(op2);
 }
Esempio n. 6
0
        public static MiMFa_Percent operator *(MiMFa_Percent op1, decimal op2)
        {
            var op = new MiMFa_Percent(0, 0, 0);

            op.SetValue(op1.Negative * op2);
            op.SetValue(op1.Positive * op2);
            op.SetValue(op1.None * op2, true);
            return(op);
        }
Esempio n. 7
0
        public static MiMFa_Percent operator /(MiMFa_Percent op1, MiMFa_Percent op2)
        {
            var op = new MiMFa_Percent(0, 0, 0);

            op.SetValue(op1.Negative / op2.Negative);
            op.SetValue(op1.Positive / op2.Positive);
            op.SetValue(op1.None / op2.None, true);
            return(op);
        }
Esempio n. 8
0
        public static decimal GetValue(MiMFa_Percent th)
        {
            switch (th.FinalScore)
            {
            case MiMFa_Score.Null:
                return(th.None);

            case MiMFa_Score.Positive:
                return(th.Positive);

            case MiMFa_Score.Negative:
                return(th.Negative);

            case MiMFa_Score.Both:
                return(th.Positive + th.Negative + th.None);

            default:
                return(th.Positive);
            }
        }