Esempio n. 1
0
 public virtual void CopyTotalMN1StockProperties(
     MN1Stock calculator)
 {
     if (this.AnalyzerType
         == MN1AnalyzerHelper.ANALYZER_TYPES.mnstat1.ToString())
     {
         this.Stat1 = new MN1Stat1(this.CalcParameters);
         this.CopyCalculatorProperties(calculator);
         this.Stat1.CopyCalculatorProperties(calculator.Stat1);
         this.Stat1.CopyTotalMN1Stat1Properties(
             this.Stat1, calculator.Stat1);
     }
     else if (this.AnalyzerType
              == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangeyr.ToString() ||
              this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangeid.ToString() ||
              this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangealt.ToString())
     {
         this.Change1 = new MN1Change1(this.CalcParameters);
         this.CopyCalculatorProperties(calculator);
         this.Change1.CopyCalculatorProperties(calculator.Change1);
         this.Change1.CopyTotalMN1Change1Properties(
             this.Change1, calculator.Change1);
     }
     else if (this.AnalyzerType
              == MN1AnalyzerHelper.ANALYZER_TYPES.mnprogress1.ToString())
     {
         this.Progress1 = new MN1Progress1(this.CalcParameters);
         this.CopyCalculatorProperties(calculator);
         this.Progress1.CopyCalculatorProperties(calculator.Progress1);
         this.Progress1.CopyTotalMN1Progress1Properties(
             this.Progress1, calculator.Progress1);
     }
     else
     {
         //this handles subobjects (calparams, subp1stock, subp2stock)
         this.Total1 = new MN1Total1(this.CalcParameters);
         this.CopyCalculatorProperties(calculator);
         this.Total1.CopyCalculatorProperties(calculator.Total1);
         this.Total1.CopyTotalMN1Total1Properties(
             this.Total1, calculator.Total1);
     }
 }
Esempio n. 2
0
 public virtual void InitTotalMN1StockProperties()
 {
     if (this.MNSR1Stock == null)
     {
         this.MNSR1Stock = new MNSR01Stock();
     }
     if (this.MNSR2Stock == null)
     {
         this.MNSR2Stock = new MNSR02Stock();
     }
     if (this.Total1 == null)
     {
         this.Total1 = new MN1Total1(this.CalcParameters);
     }
     if (this.Stat1 == null)
     {
         this.Stat1 = new MN1Stat1(this.CalcParameters);
     }
     if (this.Change1 == null)
     {
         this.Change1 = new MN1Change1(this.CalcParameters);
     }
     if (this.Progress1 == null)
     {
         this.Progress1 = new MN1Progress1(this.CalcParameters);
     }
     if (this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnstat1.ToString())
     {
         this.Stat1 = new MN1Stat1(this.CalcParameters);
         this.Stat1.InitTotalMN1Stat1Properties(this.Stat1, this.CalcParameters);
         //set costs
         this.Stat1.MNSR1Stock = new MNSR01Stock();
         this.Stat1.MNSR1Stock.InitTotalMNSR01StockProperties();
         //set benefits
         this.Stat1.MNSR2Stock = new MNSR02Stock();
         this.Stat1.MNSR2Stock.InitTotalMNSR02StockProperties();
     }
     else if (this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangeyr.ToString() ||
              this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangeid.ToString() ||
              this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangealt.ToString())
     {
         this.Change1 = new MN1Change1(this.CalcParameters);
         this.Change1.InitTotalMN1Change1Properties(this.Change1, this.CalcParameters);
         //set costs
         this.Change1.MNSR1Stock = new MNSR01Stock();
         this.Change1.MNSR1Stock.InitTotalMNSR01StockProperties();
         //set benefits
         this.Change1.MNSR2Stock = new MNSR02Stock();
         this.Change1.MNSR2Stock.InitTotalMNSR02StockProperties();
     }
     else if (this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnprogress1.ToString())
     {
         this.Progress1 = new MN1Progress1(this.CalcParameters);
         this.Progress1.InitTotalMN1Progress1Properties(this.Progress1, this.CalcParameters);
         //set costs
         this.Progress1.MNSR1Stock = new MNSR01Stock();
         this.Progress1.MNSR1Stock.InitTotalMNSR01StockProperties();
         //set benefits
         this.Progress1.MNSR2Stock = new MNSR02Stock();
         this.Progress1.MNSR2Stock.InitTotalMNSR02StockProperties();
     }
     else
     {
         //default are total indicators
         this.Total1 = new MN1Total1(this.CalcParameters);
         this.Total1.InitTotalMN1Total1Properties(this.Total1, this.CalcParameters);
         //set costs
         this.Total1.MNSR1Stock = new MNSR01Stock();
         this.Total1.MNSR1Stock.InitTotalMNSR01StockProperties();
         //set benefits
         this.Total1.MNSR2Stock = new MNSR02Stock();
         this.Total1.MNSR2Stock.InitTotalMNSR02StockProperties();
     }
 }
Esempio n. 3
0
        public virtual void SetTotalMN1StockProperties(XElement calculator)
        {
            //remember that the analyzer inheriting from this must .SetAnalyzerProps
            string sAttNameExtension = string.Empty;

            if (this.AnalyzerType
                == MN1AnalyzerHelper.ANALYZER_TYPES.mnstat1.ToString())
            {
                if (this.Stat1 == null)
                {
                    this.Stat1 = new MN1Stat1(this.CalcParameters);
                }
                this.Stat1.SetCalculatorProperties(calculator);
                this.Stat1.SetTotalMN1Stat1Properties(
                    this.Stat1, sAttNameExtension, calculator);
                //costs
                if (this.Stat1.MNSR1Stock == null)
                {
                    this.Stat1.MNSR1Stock = new MNSR01Stock();
                }
                this.Stat1.MNSR1Stock.SetTotalMNSR01StockProperties(calculator);
                //benefits
                if (this.Stat1.MNSR2Stock == null)
                {
                    this.Stat1.MNSR2Stock = new MNSR02Stock();
                }
                this.Stat1.MNSR2Stock.SetTotalMNSR02StockProperties(calculator);
            }
            else if (this.AnalyzerType
                     == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangeyr.ToString() ||
                     this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangeid.ToString() ||
                     this.AnalyzerType == MN1AnalyzerHelper.ANALYZER_TYPES.mnchangealt.ToString())
            {
                if (this.Change1 == null)
                {
                    this.Change1 = new MN1Change1(this.CalcParameters);
                }
                this.Change1.SetCalculatorProperties(calculator);
                this.Change1.SetTotalMN1Change1Properties(
                    this.Change1, sAttNameExtension, calculator);
                //costs
                if (this.Change1.MNSR1Stock == null)
                {
                    this.Change1.MNSR1Stock = new MNSR01Stock();
                }
                this.Change1.MNSR1Stock.SetTotalMNSR01StockProperties(calculator);
                //benefits
                if (this.Change1.MNSR2Stock == null)
                {
                    this.Change1.MNSR2Stock = new MNSR02Stock();
                }
                this.Change1.MNSR2Stock.SetTotalMNSR02StockProperties(calculator);
            }
            else if (this.AnalyzerType
                     == MN1AnalyzerHelper.ANALYZER_TYPES.mnprogress1.ToString())
            {
                if (this.Progress1 == null)
                {
                    this.Progress1 = new MN1Progress1(this.CalcParameters);
                }
                this.Progress1.SetCalculatorProperties(calculator);
                this.Progress1.SetTotalMN1Progress1Properties(
                    this.Progress1, sAttNameExtension, calculator);
                //costs
                if (this.Progress1.MNSR1Stock == null)
                {
                    this.Progress1.MNSR1Stock = new MNSR01Stock();
                }
                this.Progress1.MNSR1Stock.SetTotalMNSR01StockProperties(calculator);
                //benefits
                if (this.Progress1.MNSR2Stock == null)
                {
                    this.Progress1.MNSR2Stock = new MNSR02Stock();
                }
                this.Progress1.MNSR2Stock.SetTotalMNSR02StockProperties(calculator);
            }
            else
            {
                if (this.Total1 == null)
                {
                    this.Total1 = new MN1Total1(this.CalcParameters);
                }
                this.Total1.SetCalculatorProperties(calculator);
                this.Total1.SetTotalMN1Total1Properties(
                    this.Total1, sAttNameExtension, calculator);
                //costs
                if (this.Total1.MNSR1Stock == null)
                {
                    this.Total1.MNSR1Stock = new MNSR01Stock();
                }
                this.Total1.MNSR1Stock.SetTotalMNSR01StockProperties(calculator);
                //benefits
                if (this.Total1.MNSR2Stock == null)
                {
                    this.Total1.MNSR2Stock = new MNSR02Stock();
                }
                this.Total1.MNSR2Stock.SetTotalMNSR02StockProperties(calculator);
            }
        }