rendered paste bodyusing System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
namespace WP_task8
{
class MyEditor : UITypeEditor
{
private IWindowsFormsEditorService edSvc = null;
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
if (context != null && context.Instance != null && provider != null)
{
edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (edSvc != null)
{
PolygonControl orgControl = (PolygonControl)context.Instance;
PolygonControl propertiesControl = new PolygonControl();
propertiesControl.Width = orgControl.Width;
propertiesControl.Height = orgControl.Height;
propertiesControl.Points = new Point[4];
propertiesControl.Colors = new Color[4];
Array.Copy(orgControl.Points, propertiesControl.Points, 4);
Array.Copy(orgControl.Colors, propertiesControl.Colors, 4);
edSvc.DropDownControl(propertiesControl);
return propertiesControl.Points;
}
}
return value;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
}
}