Example #1
0
        /// <summary>
        /// Initializes a new instance of the XmlApplicationContext class.
        /// </summary>
        public XmlApplicationContext(XmlApplicationContextArgs args)
            : base(args.Name, args.CaseSensitive, args.ParentContext)
        {
            _configurationLocations = args.ConfigurationLocations;
            _configurationResources = args.ConfigurationResources;

            if (args.Refresh)
            {
                bool hasLocations = args.ConfigurationLocations.Count() > 0;
                bool hasResources = args.ConfigurationResources.Length > 0;

                if (!hasLocations && !hasResources)
                {
                    throw new ArgumentException("You must provide either or both Configuration Locations and/or Configuration Resources!");
                }

                if (hasLocations || hasResources)
                {
                    Refresh();
                }
            }
        }
Example #2
0
        public void Default_CaseSensitivity_isTrue()
        {
            XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty, null, null, null);

            Assert.True(args.CaseSensitive);
        }
Example #3
0
        public void Default_AutoRefresh_isTrue()
        {
            XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty, null, null, null);

            Assert.True(args.Refresh);
        }