using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
Using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System.ComponentModel.Design;
using Mylib;
Namespace Mylib
{
Class Dynamics: Label
{
Private list<typedfilter> _filters = new List<t Ypedfilter> ();
[Category ("Businessobjectcontrol")]
[DesignerSerializationVisibility (Designerserializationvisibilit y.content)]
[Editor (typeof (Filtercollectioneditor), typeof (System.Drawing.Design.UITypeEditor))]
Public L Ist<typedfilter> Filters
{
get {return _filters;}
Set {_filters = value;}
}
}
public class Typedfilter
{
private string _datapropertyname = ' Name ';
public string DataPropertyName The
{
get {_datapropertyname;}
Set {_datapropertyname = VALue
}
Private int _value = 0;
public int Value
{
get {_value;}
Set {_value = value;}
}
public override string ToString ()
{
return _datapropertyname + ' = ' + _value. ToString ();
}
}
class Filtercollectioneditor:collectioneditor
{
Public Filtercollectionedito R (Type type)
: Base (Type)
{
}
}
Can actually achieve a simple collection class ... Or a lot of places are not enough,,, if you are fortunate to encounter experts also hope to help answer ...
1. The above examples can only produce local variables. It doesn't produce a global. How can i solve
Can I generate, I want variables, such as local, or global ...
2.public class Typedfilter:control The result is that after the control is deleted, the variable is not deleted
The above code is expected to help you, especially in doing this.