public Class1()
    {
        SomeControl control = new SomeControl();
        Class2      class2  = new Class2();

        control.SomeEvent += class2.EventHandler;
    }
    public void Test()
    {
        IFoo display = new SomeControl();

        Assert.IsTrue(display.Height == 123);
        display.Height = 789;
        Assert.IsTrue(display.Height == 789);
    }
		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) {
			IWindowsFormsEditorService  service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
			if (service != null) {
                SomeControl ctrl = new SomeControl();
				ctrl.XYZ = ...
				service.DropDownControl(ctrl);
				value = ctrl.XYZ;
			}
			return value;
		}
示例#4
0
 public SomeWindow()
 {
     tagNameBoxAMT1 = new SomeControl()
     {
         Text = "Text1"
     };
     tagNameBoxAMT2 = new SomeControl()
     {
         Text = "Text2"
     };
     tagNameBoxAMT3 = new SomeControl()
     {
         Text = "Text3"
     };
 }
示例#5
0
    public void CreateControl(Action eventHandler)
    {
        SomeControl control = new SomeControl();

        control.SomeEvent += eventHandler;
    }