private static ChoIniDocument OpenNLoadDocument(string filePath) { ChoIniDocument iniDocument = ChoIniDocument.Load(filePath); iniDocument.TextIgnored += new EventHandler <ChoIniDocumentEventArgs>(iniDocument_IgnoredEntry); iniDocument.TextErrorFound += new EventHandler <ChoIniDocumentEventArgs>(iniDocument_ErrorFound); return(iniDocument); }
private static ChoIniDocument LoadDocument(string filePath) { lock (_iniDocuments.SyncRoot) { if (!_iniDocuments.ContainsKey(filePath)) { _iniDocuments.Add(filePath, OpenNLoadDocument(filePath)); } else if (_iniDocuments[filePath].IsDisposed) { _iniDocuments[filePath] = ChoIniDocument.Load(filePath); } return(_iniDocuments[filePath]); } }
internal object GetData() { if (!IniFilePath.IsNullOrWhiteSpace() && File.Exists(IniFilePath)) { using (ChoIniDocument iniDocument = ChoIniDocument.Load(IniFilePath)) { ChoIniSectionNode iniSectionNode = iniDocument.GetSection(IniSectionName); if (iniSectionNode != null) { return(iniSectionNode.ToNameValueCollection()); } } } return(null); }