예제 #1
0
        public override Section GetSection(string name)
        {
            if (!Options.CaseSensitive)
            {
                name = name.ToLowerInvariant();
            }

            // the wanted section might not be completely parsed yet
            if (CurrentSection.Equals(name, StringComparison))
            {
                ParseCurrentSection();
                return(Sections[name]);
            }

            if (Sections.TryGetValue(name, out var section))
            {
                return(section);
            }

            if (!ParseSection(name))
            {
                throw new ArgumentException($"section not found: {name}", nameof(name));
            }

            return(Sections[name]);
        }
예제 #2
0
 private void SectionChecker()
 {
     if (SelectedSection == null)
     {
         SaveSection();
     }
     else
     {
         if (CurrentSection.Equals(SelectedSection))
         {
             MessageBox.Show("Updated");
         }
         else
         {
             UpdateSection();
         }
     }
     SelectedSection = null;
     CurrentSection  = null;
     SecView.Close();
 }