Exemplo n.º 1
0
        public static OperatorClass operator +(OperatorClass first, OperatorClass second)
        {
            OperatorClass aOperatorClass = new OperatorClass();

            aOperatorClass.Salary = first.Salary + second.Salary;
            return(aOperatorClass);
        }
        /// <summary>
        /// Extract human readable operator class description.
        /// </summary>
        /// <param name="op">Operator class to parse.</param>
        /// <returns>Tuple of operator class and human readble description.</returns>
        private Tuple <OperatorClass, String> GetOperatorClassType(String op)
        {
            OperatorClass ocEnum = OperatorClass.Unknown;

            if (!String.IsNullOrWhiteSpace(op) && Enum.TryParse <OperatorClass>(op, out ocEnum))
            {
                return(Tuple.Create <OperatorClass, String>(ocEnum, Util.GetEnumDescription(ocEnum)));
            }

            return(Tuple.Create <OperatorClass, String>(OperatorClass.Unknown, op));
        }
Exemplo n.º 3
0
 public static BitmapImage ToClassImage(this OperatorClass value)
 {
     byte[] imageArray = (byte[])Resources.Resource.ResourceManager.GetObject($"ui_{value.ToString().ToLower()}");
     return(imageArray.AsBitmapImage());
 }