internal ElementHistoricErrorInfo()
        {
            string sourceGibberish = Types.RandomDataGenerator.RandomString(5).ToLower();

            this._source = new ElementHistoricString("source", string.Format("{0}::{1}{2}", Types.RandomDataGenerator.RandomInt(999), sourceGibberish, Types.RandomDataGenerator.RandomInt(99)));
            this._code = new ElementHistoricInt("code", Types.RandomDataGenerator.RandomInt(99));
            this._category = new ElementHistoricString("category", "BAD_FLD");
            this._message = new ElementHistoricString("message", "Invalid field");
            this._subCategory = new ElementHistoricString("subcategory", "NOT_APPLICABLE_TO_HIST_DATA");
        }
        internal ElementHistoricSecurityError(string security)
        {
            int code = Types.RandomDataGenerator.RandomInt(99);
            string sourceGibberish = Types.RandomDataGenerator.RandomString(5).ToLower();

            this._source = new ElementHistoricString("source", string.Format("{0}::{1}{2}", code, sourceGibberish, Types.RandomDataGenerator.RandomInt(99)));
            this._code = new ElementHistoricInt("code", code);
            this._category = new ElementHistoricString("category", "BAD_SEC");
            this._message = new ElementHistoricString("message", string.Format("Unknown/Invalid security [nid:{0}]", code));
            this._subCategory = new ElementHistoricString("subcategory", "INVALID_SECURITY");
        }
        internal ElementHistoricSecurityData(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 ElementHistoricFieldExceptionsArray(badFields);

            this._elmSecurityName = new ElementHistoricString("security", securityName);
            this._elmSequenceNumber = new ElementHistoricInt("sequenceNumber", sequenceNumber);
            if (this._isSecurityError)
            {
                this._elmSecError = new ElementHistoricSecurityError(securityName);
                this._elmFieldDataArray = null;
            }
            else
            {
                this._elmSecError = null;
                this._elmFieldDataArray = new ElementHistoricFieldDataArray(fieldData);
            }
        }
Beispiel #4
0
 internal ElementHistoricSecurityData(string securityName, Dictionary <DateTime, Dictionary <string, object> > fieldData, int sequenceNumber)
 {
     this._elmSecurityName   = new ElementHistoricString("security", securityName);
     this._elmFieldDataArray = new ElementHistoricFieldDataArray(fieldData);
     this._elmSequenceNumber = new ElementHistoricInt("sequenceNumber", sequenceNumber);
 }