Example #1
0
        //, Type configType)
        internal SettingProperty(PropertyInfo property)
        {
            Property = property;
            //ConfigType = configType;
            Path = new SettingUrn(Property.GetSettingPath());

            // an itemzed setting must be an enumerable
            if (IsItemized)
            {
                IsEnumerable.Validate(nameof(IsEnumerable)).IsTrue();
            }
        }
Example #2
0
        public void ctor_CreateFromPath2WithoutKey()
        {
            var path = new SettingUrn(new[] { "foo", "bar" });

            path.Count.Verify().IsEqual(2);

            path.Namespace.Verify().IsEqual("foo");
            path.WeakName.Verify().IsEqual("bar");
            path.StrongName.Verify().IsEqual("bar");
            path.Key.Verify().IsNullOrEmpty();

            path.WeakFullName.Verify().IsEqual("foo.bar");
            path.StrongFullName.Verify().IsEqual("foo.bar");
        }
Example #3
0
        public void ctor_CreateFromPath1WithKey()
        {
            var path = new SettingUrn(new[] { "foo" }, "baz");

            path.Count.Verify().IsEqual(1);

            path.Namespace.Verify().IsNullOrEmpty();
            path.WeakName.Verify().IsEqual("foo");
            path.StrongName.Verify().IsEqual("foo[baz]");
            path.Key.Verify().IsEqual("baz");

            path.WeakFullName.Verify().IsEqual("foo");
            path.StrongFullName.Verify().IsEqual("foo[baz]");
        }
Example #4
0
 public RegistryUrn(SettingUrn urn) : base(urn)
 {
     Delimiter = DefaultDelimiter;
 }