Beispiel #1
0
 public KeyDataCollection this[string sectionName] {
     get {
         if (mSections.ContainsSection(sectionName))
         {
             return(mSections[sectionName]);
         }
         else if (mSections.ContainsSection("Plugin - " + sectionName))
         {
             return(mSections["Plugin - " + sectionName]);
         }
         return(null);
     }
 }
        private void ProcessSection(string s)
        {
            ProcessingSection = true;

            string tmp = mSectionRegex.Match(s).Value.Trim();

            if (tmp == string.Empty)
            {
                throw new ParsingException("Error parsing section. String: \"" + s + "\"");
            }

            tmp = tmp.Substring(1, tmp.Length - 2).Trim();
            if (mCurrentTmpData.ContainsSection(tmp))
            {
                if (mRelaxedIniFormat)
                {
                    ProcessingSection = false;
                    return;
                }
                throw new ParsingException(string.Format("Error parsing section: Another section with the name [{0}] exists!", s));
            }

            mCurrentSectionName = tmp;
            mCurrentTmpData.AddSection(tmp);
            mCurrentTmpData.GetSectionData(tmp).Comments = mCurrentCommentList;
            mCurrentCommentList.Clear();
        }