コード例 #1
0
 public virtual void CopyTotalLCA1StocksProperties(
     LCA1Stock calculator)
 {
     if (this.AnalyzerType
         == LCA1AnalyzerHelper.ANALYZER_TYPES.lcastat1.ToString())
     {
         this.Stat1 = new LCA1Stat1();
         this.CopyCalculatorProperties(calculator);
         this.Stat1.CopyCalculatorProperties(calculator.Stat1);
         this.Stat1.CopyTotalLCA1Stat1Properties(
             this.Stat1, calculator.Stat1);
     }
     else if (this.AnalyzerType
              == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangeyr.ToString() ||
              this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangeid.ToString() ||
              this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangealt.ToString())
     {
         this.Change1 = new LCA1Change1();
         this.CopyCalculatorProperties(calculator);
         this.Change1.CopyCalculatorProperties(calculator.Change1);
         this.Change1.CopyTotalLCA1Change1Properties(
             this.Change1, calculator.Change1);
     }
     else if (this.AnalyzerType
              == LCA1AnalyzerHelper.ANALYZER_TYPES.lcaprogress1.ToString())
     {
         this.Progress1 = new LCA1Progress1();
         this.CopyCalculatorProperties(calculator);
         this.Progress1.CopyCalculatorProperties(calculator.Progress1);
         this.Progress1.CopyTotalLCA1Progress1Properties(
             this.Progress1, calculator.Progress1);
     }
     else
     {
         //this handles subobjects (calparams, subp1stock, subp2stock)
         this.Total1 = new LCA1Total1();
         this.CopyCalculatorProperties(calculator);
         this.Total1.CopyCalculatorProperties(calculator.Total1);
         this.Total1.CopyTotalLCA1Total1Properties(
             this.Total1, calculator.Total1);
     }
 }
コード例 #2
0
 public virtual void InitTotalLCA1StocksProperties()
 {
     if (this.SubP1Stock == null)
     {
         this.SubP1Stock = new SubPrice1Stock();
     }
     if (this.SubP2Stock == null)
     {
         this.SubP2Stock = new SubPrice2Stock();
     }
     if (this.Total1 == null)
     {
         this.Total1 = new LCA1Total1();
     }
     if (this.Stat1 == null)
     {
         this.Stat1 = new LCA1Stat1();
     }
     if (this.Change1 == null)
     {
         this.Change1 = new LCA1Change1();
     }
     if (this.Progress1 == null)
     {
         this.Progress1 = new LCA1Progress1();
     }
     if (this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcastat1.ToString())
     {
         this.Stat1 = new LCA1Stat1();
         this.Stat1.InitTotalLCA1Stat1Properties(this.Stat1);
         //set costs
         this.Stat1.SubP1Stock = new SubPrice1Stock();
         this.Stat1.SubP1Stock.InitTotalSubPrice1StocksProperties();
         //set benefits
         this.Stat1.SubP2Stock = new SubPrice2Stock();
         this.Stat1.SubP2Stock.InitTotalSubPrice2StocksProperties();
     }
     else if (this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangeyr.ToString() ||
              this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangeid.ToString() ||
              this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangealt.ToString())
     {
         this.Change1 = new LCA1Change1();
         this.Change1.InitTotalLCA1Change1Properties(this.Change1);
         //set costs
         this.Change1.SubP1Stock = new SubPrice1Stock();
         this.Change1.SubP1Stock.InitTotalSubPrice1StocksProperties();
         //set benefits
         this.Change1.SubP2Stock = new SubPrice2Stock();
         this.Change1.SubP2Stock.InitTotalSubPrice2StocksProperties();
     }
     else if (this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcaprogress1.ToString())
     {
         this.Progress1 = new LCA1Progress1();
         this.Progress1.InitTotalLCA1Progress1Properties(this.Progress1);
         //set costs
         this.Progress1.SubP1Stock = new SubPrice1Stock();
         this.Progress1.SubP1Stock.InitTotalSubPrice1StocksProperties();
         //set benefits
         this.Progress1.SubP2Stock = new SubPrice2Stock();
         this.Progress1.SubP2Stock.InitTotalSubPrice2StocksProperties();
     }
     else
     {
         //default are total indicators
         this.Total1 = new LCA1Total1();
         this.Total1.InitTotalLCA1Total1Properties(this.Total1);
         //set costs
         this.Total1.SubP1Stock = new SubPrice1Stock();
         this.Total1.SubP1Stock.InitTotalSubPrice1StocksProperties();
         //set benefits
         this.Total1.SubP2Stock = new SubPrice2Stock();
         this.Total1.SubP2Stock.InitTotalSubPrice2StocksProperties();
     }
 }
コード例 #3
0
        public virtual void SetTotalLCA1StocksProperties(XElement calculator)
        {
            //remember that the analyzer inheriting from this must .SetAnalyzerProps
            string sAttNameExtension = string.Empty;

            if (this.AnalyzerType
                == LCA1AnalyzerHelper.ANALYZER_TYPES.lcastat1.ToString())
            {
                if (this.Stat1 == null)
                {
                    this.Stat1 = new LCA1Stat1();
                }
                this.Stat1.SetCalculatorProperties(calculator);
                this.Stat1.SetTotalLCA1Stat1Properties(
                    this.Stat1, sAttNameExtension, calculator);
                //costs
                if (this.Stat1.SubP1Stock == null)
                {
                    this.Stat1.SubP1Stock = new SubPrice1Stock();
                }
                this.Stat1.SubP1Stock.SetTotalSubPrice1StocksProperties(calculator);
                //benefits
                if (this.Stat1.SubP2Stock == null)
                {
                    this.Stat1.SubP2Stock = new SubPrice2Stock();
                }
                this.Stat1.SubP2Stock.SetTotalSubPrice2StocksProperties(calculator);
            }
            else if (this.AnalyzerType
                     == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangeyr.ToString() ||
                     this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangeid.ToString() ||
                     this.AnalyzerType == LCA1AnalyzerHelper.ANALYZER_TYPES.lcachangealt.ToString())
            {
                if (this.Change1 == null)
                {
                    this.Change1 = new LCA1Change1();
                }
                this.Change1.SetCalculatorProperties(calculator);
                this.Change1.SetTotalLCA1Change1Properties(
                    this.Change1, sAttNameExtension, calculator);
                //costs
                if (this.Change1.SubP1Stock == null)
                {
                    this.Change1.SubP1Stock = new SubPrice1Stock();
                }
                this.Change1.SubP1Stock.SetTotalSubPrice1StocksProperties(calculator);
                //benefits
                if (this.Change1.SubP2Stock == null)
                {
                    this.Change1.SubP2Stock = new SubPrice2Stock();
                }
                this.Change1.SubP2Stock.SetTotalSubPrice2StocksProperties(calculator);
            }
            else if (this.AnalyzerType
                     == LCA1AnalyzerHelper.ANALYZER_TYPES.lcaprogress1.ToString())
            {
                if (this.Progress1 == null)
                {
                    this.Progress1 = new LCA1Progress1();
                }
                this.Progress1.SetCalculatorProperties(calculator);
                this.Progress1.SetTotalLCA1Progress1Properties(
                    this.Progress1, sAttNameExtension, calculator);
                //costs
                if (this.Progress1.SubP1Stock == null)
                {
                    this.Progress1.SubP1Stock = new SubPrice1Stock();
                }
                this.Progress1.SubP1Stock.SetTotalSubPrice1StocksProperties(calculator);
                //benefits
                if (this.Progress1.SubP2Stock == null)
                {
                    this.Progress1.SubP2Stock = new SubPrice2Stock();
                }
                this.Progress1.SubP2Stock.SetTotalSubPrice2StocksProperties(calculator);
            }
            else
            {
                if (this.Total1 == null)
                {
                    this.Total1 = new LCA1Total1();
                }
                this.Total1.SetCalculatorProperties(calculator);
                this.Total1.SetTotalLCA1Total1Properties(
                    this.Total1, sAttNameExtension, calculator);
                //costs
                if (this.Total1.SubP1Stock == null)
                {
                    this.Total1.SubP1Stock = new SubPrice1Stock();
                }
                this.Total1.SubP1Stock.SetTotalSubPrice1StocksProperties(calculator);
                //benefits
                if (this.Total1.SubP2Stock == null)
                {
                    this.Total1.SubP2Stock = new SubPrice2Stock();
                }
                this.Total1.SubP2Stock.SetTotalSubPrice2StocksProperties(calculator);
            }
        }