示例#1
0
        public static CWYModel CloneObject(CWYModel obj)
        {
            using (MemoryStream memoryStream = new MemoryStream())
            {
                //XmlSerializer ser = new XmlSerializer(typeof(CWYModel));

                /* BinaryFormatter binaryFormatter = NewMethod();
                 * binaryFormatter.Serialize(memoryStream,(CWYModel)obj);
                 * memoryStream.Seek(0L, SeekOrigin.Begin);
                 * return (CWYModel)binaryFormatter.Deserialize(memoryStream);*/
                Console.WriteLine("mybase: Type is {0}", obj.GetType());
                return(obj);
            }
        }
示例#2
0
        public double[] IrrigationCost(CWYModel model)
        {
            double gpm       = model.gpm;
            double amount1   = this.cIrrigationCosts[1].Amount;
            double amount2   = this.cIrrigationCosts[2].Amount;
            double fuelprice = model.fuelprice;
            double amount3   = this.cIrrigationCosts[3].Amount;
            double amount4   = this.cIrrigationCosts[4].Amount;
            double num1      = amount1 + amount2 * 2.31;
            double num2      = 1.0 * (1.0 / (gpm / 450.0));
            double num3      = num1 * (gpm / 3960.0) / model.npc * num2 * fuelprice / 1.0;

            return(new double[2] {
                num2, num3
            });
        }
示例#3
0
 public object Clone()
 {
     return(CWYModel.CloneObject((object)this));
 }