private void LoadValidationData(ValidItems validItems) { ValidItems.ValidDataTable table = validItems.Valid; foreach (ValidItems.ValidRow validRow in table) { legalTypes.Add(validRow.Valid_Column, String.Empty); } }
/// <summary> /// Load validation information from xml file /// </summary> public void LoadValidTypes() { String typeFilePath = AppDomain.CurrentDomain.BaseDirectory + @"ValidTypes.xml"; try { using (ValidItems validItems = new ValidItems()) { #pragma warning disable CA5366 // Use XmlReader For DataSet Read Xml validItems.ReadXml(typeFilePath, XmlReadMode.ReadSchema); LoadValidationData(validItems); } } catch (Exception) { Trace.TraceError("Missing file " + typeFilePath); } }