Ejemplo n.º 1
0
        internal ExpressionInfo GetCustomProperty(CustomPropertyDefinitionCollection properties, string name, ExpressionInfo defaultValue)
        {
            // get property
            CustomPropertyDefinition property = properties[name];

            // if property is not set then return default value
            return(property == null ? defaultValue : property.Value);
        }
Ejemplo n.º 2
0
        internal void SetCustomProperty(CustomPropertyDefinitionCollection properties, string name, ExpressionInfo value, ExpressionInfo defaultValue)
        {
            // Fire component changing
            if (ComponentChangeService != null)
            {
                ComponentChangeService.OnComponentChanging(ReportItem, null);
            }

            // get property
            CustomPropertyDefinition property = properties[name];

            bool isDefaultValue = defaultValue == value;

            if (isDefaultValue)
            {
                // reset the property value
                if (property != null)
                {
                    properties.Remove(property);
                }
            }
            else
            {
                // set property value
                if (property == null)
                {
                    properties.Add(new CustomPropertyDefinition(name, value));
                }
                else
                {
                    property.Value = value;
                }
            }

            // Fire component changed
            if (ComponentChangeService != null)
            {
                ComponentChangeService.OnComponentChanged(ReportItem, null, null, null);
            }
        }