/// <summary>
        ///     Ctor
        /// </summary>
        /// <param name="parserConfiguration">
        ///     Parser's <see cref="IIniParserConfiguration"/> instance.
        /// </param>
        public IniDataParser(IIniParserConfiguration parserConfiguration)
        {
            if (parserConfiguration == null)
                throw new ArgumentNullException("parserConfiguration");

            Configuration = parserConfiguration;
        }
 public DefaultIniDataFormatter(IIniParserConfiguration configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
     this.Configuration = configuration;
 }
Example #3
0
        /// <summary>
        ///     Ctor
        /// </summary>
        /// <param name="parserConfiguration">
        ///     Parser's <see cref="IIniParserConfiguration"/> instance.
        /// </param>
        public IniDataParser(IIniParserConfiguration parserConfiguration)
        {
            if (parserConfiguration == null)
            {
                throw new ArgumentNullException("parserConfiguration");
            }

            Configuration = parserConfiguration;
        }
        /// <summary>
        ///     Copy ctor.
        /// </summary>
        /// <param name="ori">
        ///     Original instance to be copied.
        /// </param>
        public BaseIniParserConfiguration(IIniParserConfiguration ori)
        {
            AllowDuplicateKeys      = ori.AllowDuplicateKeys;
            OverrideDuplicateKeys   = ori.OverrideDuplicateKeys;
            AllowDuplicateSections  = ori.AllowDuplicateSections;
            AllowKeysWithoutSection = ori.AllowKeysWithoutSection;

            SectionStartChar       = ori.SectionStartChar;
            SectionEndChar         = ori.SectionEndChar;
            CommentString          = ori.CommentString;
            ThrowExceptionsOnError = ori.ThrowExceptionsOnError;

            // Regex values should recreate themselves.
        }
        /// <summary>
        ///     Copy ctor.
        /// </summary>
        /// <param Name="ori">
        ///     Original instance to be copied.
        /// </param>
        public BaseIniParserConfiguration(IIniParserConfiguration ori)
        {
            AllowDuplicateKeys = ori.AllowDuplicateKeys;
            OverrideDuplicateKeys = ori.OverrideDuplicateKeys;
            AllowDuplicateSections = ori.AllowDuplicateSections;
            AllowKeysWithoutSection = ori.AllowKeysWithoutSection;

            SectionStartChar = ori.SectionStartChar;
            SectionEndChar = ori.SectionEndChar;
            CommentChar = ori.CommentChar;
            ThrowExceptionsOnError = ori.ThrowExceptionsOnError;

            // Regex values should recreate themselves.
        }
        public void check_cloning()
        {
            IIniParserConfiguration config1 = new DefaultIniParserConfiguration();

            config1.AllowDuplicateKeys = true;
            config1.CommentChar        = '/';

            Assert.That(config1.AllowDuplicateKeys, Is.True);
            Assert.That(config1.CommentChar, Is.EqualTo('/'));

            IIniParserConfiguration config2 = config1.Clone();

            Assert.That(config2.AllowDuplicateKeys, Is.True);
            Assert.That(config2.CommentChar, Is.EqualTo('/'));

            config1.CommentChar = '#';
            Assert.That(config2.CommentChar, Is.EqualTo('/'));
        }
        public void check_cloning()
        {
            IIniParserConfiguration config1 = new DefaultIniParserConfiguration();

            config1.AllowDuplicateKeys = true;
            config1.CommentString      = "/";

            Assert.That(config1.AllowDuplicateKeys, Is.True);
            Assert.That(config1.CommentString, Is.EqualTo("/"));

            IIniParserConfiguration config2 = config1.Clone();

            Assert.That(config2.AllowDuplicateKeys, Is.True);
            Assert.That(config2.CommentString, Is.EqualTo("/"));

            config1.CommentString = "#";
            Assert.That(config2.CommentString, Is.EqualTo("/"));
        }
 public DefaultIniDataFormatter(IIniParserConfiguration configuration)
 {
     if (configuration == null)
         throw new ArgumentNullException("configuration");
     this.Configuration = configuration;
 }