예제 #1
0
 internal void Attach(InitializerProperty property)
 {
     _property = property;
     if (_source.GetValue(_propertyname, out object value))
     {
         _property.SetValue(value);
     }
 }
        protected InitializerProperty Register(string propertyname, Type propertytype, PropertyMetadata meta)
        {
            if (propertyname == null)
            {
                throw new ArgumentNullException(nameof(propertyname));
            }
            if (propertytype == null)
            {
                throw new ArgumentNullException(nameof(propertytype));
            }
            if (meta == null)
            {
                throw new ArgumentNullException(nameof(meta));
            }
            if (_properties.ContainsKey(propertyname))
            {
                throw new ArgumentException();
            }
            InitializerProperty property = new InitializerProperty(propertyname, propertytype, this, meta);

            _properties.Add(propertyname, property);
            return(property);
        }
 public InitializerResource()
 {
     _content = new InitializerProperty(nameof(Content), typeof(ResourceContent), this, new PropertyMetadata(new ResourceContent()));
 }
 internal bool GetProperty(string name, out InitializerProperty property)
 {
     return(_properties.TryGetValue(name, out property));
 }