Esempio n. 1
0
        /// <summary>
        /// Add a new attribute definition to the component definition.
        /// </summary>
        /// <param name="definition">Attribute definition.</param>
        public void AddAttribute(ReadOnlyAttributeDefinition definition)
        {
            if (attributeDefinitions.ContainsKey(definition.Name))
            {
                throw new AttributeDefinitionException("Attribute with such name is already defined.");
            }

            attributeDefinitions[definition.Name] = definition;
        }
 public void Init()
 {
     definition = new ReadOnlyAttributeDefinition("test-name", typeof(int), 42, Guid.NewGuid());
 }
 public Attribute(ReadOnlyAttributeDefinition definition, Component parentComponent)
 {
     ParentComponent = parentComponent;
     Definition      = definition;
     Value           = definition.DefaultValue;
 }