예제 #1
0
 private String GetProperty(IPropertyType aProperty, Control aControl)
 {
     String result = aProperty.Get();
     result = result.Replace("$ControlClass", aControl.ControlClass());
     result = result.Replace("$ControlName", aControl.ControlName);
     return result;
 }
예제 #2
0
        public String AssignmentStatement(Control aControl, IPropertyType aProperty, String aValue)
        {
            String result = aProperty.Set();
            if (aValue.EndsWith(";"))
                aValue = aValue.Remove(aValue.Length - 1, 1);

            result = result.Replace("$ControlClass", aControl.ControlClass());
            result = result.Replace("$ControlName", aControl.ControlName);
            result = result.Replace("$Value", aValue);
            return result;
        }
예제 #3
0
        /// <summary>
        /// Return the property for the given control
        /// </summary>
        /// <param name="aControl"></param>
        /// <param name="aPropertyName"></param>
        /// <returns></returns>
        public IPropertyType GetProperty(Control aControl, String aPropertyName)
        {
            IPropertyType[] controlProperties = aControl.Properties();
            if (controlProperties == null || controlProperties.Length == 0)
                throw new CompileErrorException("Control '" + aControl.ControlClass() + "' doesn't have any properties");

            IPropertyType property = (from c in controlProperties
                                                where c.GetType().Name.CompareTo(aPropertyName) == 0
                                                select c).FirstOrDefault();

            return property;
        }