Exemple #1
0
        public static void BuildProperty(IImageProperty property, TypeBuilder type, PropertyBuilder propertyBuilder, Dictionary <IBusinessObjectBase, TypeBuilder> definedTypes)
        {
            var p    = propertyBuilder; //PropertyLogic.BuildPropertyCore(property, type, definedTypes);
            var ctor = typeof(ValueConverterAttribute).GetConstructor(new[] { typeof(Type) });
            var cb   = new CustomAttributeBuilder(ctor, new object[] { typeof(ImageValueConverter) });

            p.SetCustomAttribute(cb);
        }
Exemple #2
0
        private static Attribute[] CreateAttributes(IImageProperty imageProperty)
        {
            CategoryAttribute    category    = new CategoryAttribute(imageProperty.Category);
            DescriptionAttribute description = new DescriptionAttribute(imageProperty.Description);
            EditorAttribute      editor      = new EditorAttribute(typeof(ShowValueEditor), typeof(UITypeEditor));

            return(new Attribute[] { category, description, editor });
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ctrl"></param>
        /// <param name="image"></param>
        public static void SetImage(Control control, Image image)
        {
            if (control is IImageProperty)
            {
                IImageProperty imageProperty = control as IImageProperty;
                imageProperty.Image = image;
            }
#if !PocketPC
            else
            {
                control.BackgroundImage = image;
            }
#else
            if (control is Panel)
            {
                Panel panel = (Panel)control;
                panel.BackGroundImage = image;
            }
#endif
        }
		private static Attribute[] CreateAttributes(IImageProperty imageProperty)
		{
			CategoryAttribute category = new CategoryAttribute(imageProperty.Category);
			DescriptionAttribute description = new DescriptionAttribute(imageProperty.Description);
			EditorAttribute editor = new EditorAttribute(typeof(ShowValueEditor), typeof(UITypeEditor));

			return new Attribute[] { category, description, editor };
		}
		public ImagePropertyDescriptor(IImageProperty imageProperty)
			: base(imageProperty.Identifier, CreateAttributes(imageProperty))
		{
			ImageProperty = imageProperty;
		}
Exemple #6
0
 public ImagePropertyDescriptor(IImageProperty imageProperty)
     : base(imageProperty.Identifier, CreateAttributes(imageProperty))
 {
     ImageProperty = imageProperty;
 }