コード例 #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.Length > 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();
                }
            }

        }
コード例 #2
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.Length > 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();
                }
            }
        }
コード例 #3
0
        public void Default_CaseSensitivity_isTrue()
        {
            XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty, null, null, null);

            Assert.True(args.CaseSensitive);
        }
コード例 #4
0
        public void Default_AutoRefresh_isTrue()
        {
            XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty, null, null, null);

            Assert.True(args.Refresh);
        }
コード例 #5
0
 public void Default_CaseSensitivity_isTrue()
 {
     XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty,null,null,null);
     Assert.True(args.CaseSensitive);
 }
コード例 #6
0
 public void Default_AutoRefresh_isTrue()
 {
     XmlApplicationContextArgs args = new XmlApplicationContextArgs(string.Empty, null, null, null);
     Assert.True(args.Refresh);
 }