/// <summary>
        /// Gets a string representation of the lab test type.
        /// </summary>
        ///
        /// <returns>
        /// A string representing the lab test type.
        /// </returns>
        ///
        public override string ToString()
        {
            StringBuilder result = new StringBuilder(200);

            result.Append(When);

            if (!string.IsNullOrEmpty(Name))
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    Name);
            }

            if (Substance != null)
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    Substance.ToString());
            }

            if (CollectionMethod != null)
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    CollectionMethod.ToString());
            }

            if (TestAbbreviation != null)
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    TestAbbreviation);
            }

            if (!string.IsNullOrEmpty(Description))
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    Description);
            }

            if (Result != null)
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    Result.ToString());
            }

            if (Status != null)
            {
                result.AppendFormat(
                    Resources.ListFormat,
                    Status.ToString());
            }

            return(result.ToString());
        }
Пример #2
0
        public IList <DryingGas> GetDryingGasesForMoisture(Substance materialMoistureSubstance)
        {
            //DryingGas gas = null;

            //SubstanceCatalog sc = SubstanceCatalog.GetInstance();
            //IList<Substance> moistureSubstanceList = sc.GetMoistureSubstanceListForAir();
            //if (moistureSubstanceList.Contains(materialMoistureSubstance)) {
            //   gas = GetDryingGas("Air");
            //}
            //else {
            //   gas = GetDryingGas("Nitrogen");
            //}
            //return gas;
            return(GetDryingGasesForMoisture(materialMoistureSubstance.ToString()));
        }
        static void Main(string[] args)
        {
            Substance s = new Substance(new Pressure(5), new Enthalpy(3500));

            Console.WriteLine(s.ToString());

            s = new Substance(new Pressure(2), new Entropy(6));
            Console.WriteLine(s.ToString());

            s = new Substance(new Pressure(2, Pressure.Measure.MPa),
                              new Entropy(6, Entropy.Measure.kJ_kgK));
            Console.WriteLine(s.ToString());

            s = new Substance(1500, 0.5);
            Console.WriteLine(s.ToString());

            s = new Substance(new Temperature(150, Temperature.Measure.Celsius), Substance.State.Steam);
            Console.WriteLine(s.ToString());

            s = new Substance(new Pressure(20, Pressure.Measure.bar), Substance.State.Water);
            Console.WriteLine(s.ToString());

            Console.Read();
        }