#pragma warning restore 0414 internal HistoricRequest() { this._dtStart = new HistoricRequestElementDate("startDate"); this._dtEnd = new HistoricRequestElementDate("endDate"); this._securities = new HistoricRequestElementStringArray("securities"); this._fields = new HistoricRequestElementStringArray("fields"); }
public override void Set(string name, string elementValue) { DateTime dtTemp; switch (name) { case "startDate": if (Types.DisplayFormats.HistoricalOrReferenceRequests.TryParseInput(elementValue, out dtTemp)) { this._dtStart = new HistoricRequestElementDate("startDate", dtTemp); } else { throw new ArgumentException(string.Format("BEmu.Request.Set: Bad startDate format {0}, yyyyMMdd expected", elementValue)); } break; case "endDate": if (Types.DisplayFormats.HistoricalOrReferenceRequests.TryParseInput(elementValue, out dtTemp)) { this._dtEnd = new HistoricRequestElementDate("endDate", dtTemp); } else { throw new ArgumentException(string.Format("BEmu.Request.Set: Bad endDate format {0}, yyyyMMdd expected", elementValue)); } break; case "periodicityAdjustment": switch (elementValue) { case "CALENDAR": this._periodicityAdjustment = HistDataPeriodicityAdjustment.calendar; break; case "FISCAL": this._periodicityAdjustment = HistDataPeriodicityAdjustment.fiscal; break; case "ACTUAL": this._periodicityAdjustment = HistDataPeriodicityAdjustment.actual; break; default: throw new ArgumentException(string.Format("BEmu.Request.Set: unknown value ({0}) for periodicityadjustment. These are case-sensitive.", elementValue)); } this._periodicityAdjustmentElement = new HistoricRequestElementString("periodicityAdjustment", elementValue); break; case "periodicitySelection": switch (elementValue) { case "WEEKLY": this._periodicity = HistDataPeriodicity.weekly; break; case "MONTHLY": this._periodicity = HistDataPeriodicity.monthly; break; case "QUARTERLY": this._periodicity = HistDataPeriodicity.quarterly; break; case "SEMI_ANNUALLY": this._periodicity = HistDataPeriodicity.semi_annually; break; case "YEARLY": this._periodicity = HistDataPeriodicity.yearly; break; case "DAILY": this._periodicity = HistDataPeriodicity.daily; break; default: throw new ArgumentException(string.Format("BEmu.Request.Set: unknown value ({0}) for periodicityselection. These are case-sensitive.", elementValue)); } this._periodicityElement = new HistoricRequestElementString("periodicitySelection", elementValue); break; case "pricingOption": switch (elementValue) { case "PRICING_OPTION_YIELD": this._pricingOption = PricingOption.yield; break; case "PRICING_OPTION_PRICE": this._pricingOption = PricingOption.price; break; default: throw new ArgumentException(string.Format("BEmu.Request.Set: unknown value ({0}) for pricingOption. These are case-sensitive.", elementValue)); } this._pricingOptionElement = new HistoricRequestElementString("pricingOption", elementValue); break; case "overrideOption": switch (elementValue) { case "OVERRIDE_OPTION_GPA": this._overrideOptions = OverrideOptions.averagePrice; break; case "OVERRIDE_OPTION_CLOSE": this._overrideOptions = OverrideOptions.closingPrice; break; default: throw new ArgumentException(string.Format("BEmu.Request.Set: unknown value ({0}) for overrideoption. These are case-sensitive.", elementValue)); } this._overrideOptionsElement = new HistoricRequestElementString("overrideOption", elementValue); break; default: throw new ArgumentException(string.Format("BEmu.Request.Set: Element name {0} not supported. These are case-sensitive.", name)); } }