Все вопросы: [typedescriptor]
8 вопросов
How can I avoid having a separate custom TypeDescriptorProvider for each of my classes?
I've added functionality to my project that allows the users to add their own custom properties to objects. I've created my own custom TypeDescriptor, PropertyDescriptor and TypeDescriptorProviders etc.. etc.. to do this. Here's my problem. Right now I have it all working, but had to create a s...
Filter properties returned by TypeDescriptor.GetProperties() depending on the class they are declared in
Hey guys. I have the following situation. I want to use a TypeDescriptor to get the properties of a certain type. The type's depth in the inheritance hierarchy may vary. I only want to get the properties declared in the type itself and not in its parents (base). The problem is that when I call T...
TypeDescriptor.GetProperties() vs Type.GetProperties()
Consider the following code. Object obj; PropertyDescriptorCollection A = TypeDescriptor.GetProperties(obj); PropertyInfo[] B = obj.GetType().GetProperties(); // EDIT* I'm trying to understand the difference between A and B. From what I understand TypeDescriptor.GetProperties() will return...
Add property-level attributes dynamically using TypeDescriptor for PropertyGrid
I want to add attributes (like Browsable(false)) dynamically while displaying in the grid. Scenario is that I have a custom class with some public properties. However, I dont want all of the public properties to be displayed in the UI. Is there a way out? I tried using TypeDescriptor. However, i...
TypeDescriptor.CreateProperty не добавляет свойство
Я пытаюсь добавить свойство к типу с помощью TypeDescriptor.CreateProperty, чтобы отобразить дополнительное свойство в сетке свойств, однако это новое свойство не добавляется, и когда я вызываю TypeDescriptor.GetProperties для этого типа, чтобы проверить свойства , это свойство не существует. ...
Добавить атрибут категории в PropertyDescriptor
У меня есть набор настраиваемых дескрипторов PropertyDescriptor, к которым я тоже хочу добавить категории, чтобы они отображались в более организованном виде в PropertyGrid. Я хочу, чтобы каждый тип PropertyDescriptor входил в определенную категорию. Я пробовал использовать TypeDescriptor.Add...
TypeDescriptor.GetProperties (thisType) для возврата свойств, которые доступны только для записи
Я пытаюсь получить все свойства из типа, но использование TypeDescriptor.GetProperties (thisType) предоставит мне только свойства, которые имеют как сеттер, так и получатель. У меня есть свойства только для записи. Есть ли способ получить PropertyDescriptorCollection, включая их? / Асгер
Привязка IList <imyinterfacetype> не отображает элементы интерфейсов, наследуемых IMyInterface</imyinterfacetype>
Я привязываю IList к GridView. IMyInterface выглядит как public interface IMyInterface: IHasTotalHours, IHasLines { DateTime GoalStartDate { get; set; } DateTime GoalEndDate { get; set; } } Я привязываю экземпляр к сетке следующим образом: IList<IMyInterface> instance= Ge...