internal HistoricElementSecurityData(string securityName, List <string> badFields, Dictionary <DateTime, Dictionary <string, object> > fieldData, int sequenceNumber) { this._isSecurityError = Types.Rules.IsSecurityError(securityName); //remove bad field names from the dictionary if (badFields.Count == 0) { this._elmFieldExceptions = null; } else { this._elmFieldExceptions = new HistoricElementFieldExceptionsArray(badFields); } this._elmSecurityName = new HistoricElementString("security", securityName); this._elmSequenceNumber = new HistoricElementInt("sequenceNumber", sequenceNumber); if (this._isSecurityError) { this._elmSecError = new HistoricElementSecurityError(securityName); this._elmFieldDataArray = null; } else { this._elmSecError = null; this._elmFieldDataArray = new HistoricElementFieldDataArray(fieldData); } }
internal HistoricElementErrorInfo() { string sourceGibberish = Types.RandomDataGenerator.RandomString(5).ToLower(); this._source = new HistoricElementString("source", string.Format("{0}::{1}{2}", Types.RandomDataGenerator.RandomInt(999), sourceGibberish, Types.RandomDataGenerator.RandomInt(99))); this._code = new HistoricElementInt("code", Types.RandomDataGenerator.RandomInt(99)); this._category = new HistoricElementString("category", "BAD_FLD"); this._message = new HistoricElementString("message", "Invalid field"); this._subCategory = new HistoricElementString("subcategory", "NOT_APPLICABLE_TO_HIST_DATA"); }
internal HistoricElementSecurityError(string security) { int code = Types.RandomDataGenerator.RandomInt(99); string sourceGibberish = Types.RandomDataGenerator.RandomString(5).ToLower(); this._source = new HistoricElementString("source", string.Format("{0}::{1}{2}", code, sourceGibberish, Types.RandomDataGenerator.RandomInt(99))); this._code = new HistoricElementInt("code", code); this._category = new HistoricElementString("category", "BAD_SEC"); this._message = new HistoricElementString("message", string.Format("Unknown/Invalid security [nid:{0}]", code)); this._subCategory = new HistoricElementString("subcategory", "INVALID_SECURITY"); }