propertydescriptor

    1熱度

    1回答

    我做了以下的自定義PropertyDescriptor的 public class CustomProperty : PropertyDescriptor { private PropertyDescriptor _innerPropertyDescriptor; private bool _ronly; public CustomProperty(Propert

    0熱度

    1回答

    實體框架屬性描述符收集字段值..嗨,我試圖從任何這樣的實體串連一些列的值: var valor = ""; PropertyDescriptorCollection objProperties = TypeDescriptor.GetProperties(obj); foreach (PropertyDescriptor objProperty in objPrope

    4熱度

    3回答

    此代碼: foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(lst[0])) { Console.WriteLine(descriptor.Name); } 會寫出我的列表中的所有元素的名稱。即名字/姓氏或永遠。我如何寫出元素的孩子?如果我的列表中包含汽車類型和顏色的汽車,我將如何使用Ty

    0熱度

    1回答

    讓我們想象我有我不得擅自更改以下類: public class BaseType { public UInt32 m_baseMember = 1; public bool m_baseMemberBool = false; } public class ComposedType { public ComposedType() { m_

    1熱度

    1回答

    我有一個對象,我已經定義了,我希望使用PropertyDescriptor修改它的一個名爲「DeviceType」的屬性,但它不適合我。 我可以檢索屬性DeviceType的值,但是當我使用SetValue()更改它的屬性值時,我總是得到異常:即使我嘗試設置「對象引用未設置爲對象的實例」該屬性的值與我剛剛檢索的值相同。 下面是一些代碼: PropertyDescriptorCollection p

    0熱度

    1回答

    這可能會遇到一個天真的問題。我怪我在Java Beans方面的經驗不足。 林使用Java豆如下 - 我有一個類ComponentModel具有boolean構件isComponentEditable 然後我有一個ComponentPropertyEditor類其中i執行以下操作 - public ComponentPropertyEditorModel(ComponentModel bean) {

    8熱度

    5回答

    通常Python描述符被定義爲類屬性。但就我而言,我希望每個對象實例都具有不同的取決於輸入的集合描述符。例如: class MyClass(object): def __init__(self, **kwargs): for attr, val in kwargs.items(): self.__dict__[attr] = MyDescriptor(val)

    7熱度

    2回答

    我想在我的PropertyGrid中顯示一個類的多個實例。這個類看起來是這樣的: public class Parameter { [Description("the name")] public string Name { get; set; } [Description("the value"), ReadOnly(true)] public str

    1熱度

    1回答

    的PropertyDescriptor與我有以下代碼: public partial class Form1 : Form { public Form1() { InitializeComponent(); object o; Person p = new Person { FirstName = "John", Surname = "He

    1熱度

    1回答

    是否有任何干淨的方法從表達式樹中獲取PropertyDescriptor? 我現在有PropertyInfo但我非常想PropertyDescriptor,我的代碼: var prop = (System.Reflection.PropertyInfo) ((MemberExpression) ((Expression<Func<TestClass, long>