예제 #1
0
        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);
        }
예제 #2
0
        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]);
            }
        }
예제 #3
0
        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);
        }