コード例 #1
0
        protected void RegisterPropertyDependency(string propertyName, string dependencyPropertyName)
        {
            if (_propertyDependencyMap == null)
            {
                _propertyDependencyMap = new DependencyMap();
            }

            _propertyDependencyMap.RegisterPropertyDependency(propertyName, dependencyPropertyName);
        }
コード例 #2
0
        public static void FillDependencyMap(Type type, DependencyMap map)
        {
            type.AssertNotNull(nameof(type));
            map.AssertNotNull(nameof(map));

            foreach (var propertyInfo in type.GetProperties())
            {
                var att = GetAttribute(propertyInfo);

                if (att != null && att.Dependencies != null)
                {
                    foreach (var dependencyName in att.Dependencies)
                    {
                        map.RegisterPropertyDependency(propertyInfo.Name, dependencyName);
                    }
                }
            }
        }