コード例 #1
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;
        }
コード例 #2
0
 public DefaultIniDataFormatter(IIniParserConfiguration configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
     this.Configuration = configuration;
 }
コード例 #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;
        }
コード例 #4
0
        /// <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.
        }
コード例 #5
0
        /// <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.
        }
コード例 #6
0
        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('/'));
        }
コード例 #7
0
        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("/"));
        }
コード例 #8
0
 public DefaultIniDataFormatter(IIniParserConfiguration configuration)
 {
     if (configuration == null)
         throw new ArgumentNullException("configuration");
     this.Configuration = configuration;
 }