Questions tagged [system.componentmodel]

The System.ComponentModel namespace provides classes that are used to implement the run-time and design-time behavior of components and controls. This namespace includes the base classes and interfaces for implementing attributes and type converters, binding to data sources, and licensing components.

The classes in this namespace divide into the following categories:

114 questions
40
votes
1 answer

How do I specify the maximum column length of a field using entity framework code first

Is there an attribute I can use when creating a table ? I tried [StringLength] but it seems to be ignored. public class EntityRegister { public int Id { get; set; } [StringLength(450)] public string Name { get; set; } }
Kirsten
  • 15,730
  • 41
  • 179
  • 318
28
votes
1 answer

When and why should I implement IComponent, IContainer, and ISite?

I've wondered for a long time what IComponent, IContainer, and ISite are for. I've read the documentation, but it is extremely vague (or I'm thinking about it too hard). I know that if I create a class as a component, it can be used in the Visual…
Brian Jorgensen
  • 1,230
  • 14
  • 17
25
votes
2 answers

What is the difference between IEditableObject and IRevertibleChangeTracking?

What is the difference between IEditableObject and IRevertibleChangeTracking (both from the System.ComponentModel namespace)? It looks as if the first supports explicit transaction whilst the second is more implicit - but the net result is the…
open-collar
  • 1,404
  • 1
  • 16
  • 22
20
votes
2 answers

What is AggregateCatalog?

What is AggregateCatalog? What does it mean when you construct a new AggregateCatalog()? What does it mean when you add assemblies to the catalog, eg catalog.Catalogs.Add(new AssemblyCatalog(someAssembly))? Other than assemblies what can you add to…
Louis Rhys
  • 34,517
  • 56
  • 153
  • 221
18
votes
1 answer

When and why we should to use class System.ComponentModel.Container?

Is anybody could explain when and why we should use System.ComponentModel.Container, please? Recently I have met using of this class here, but really cannot understand what a benefit can get us this class there.
apros
  • 2,848
  • 3
  • 27
  • 31
17
votes
6 answers

Data Binding POCO Properties

Are there any data binding frameworks (BCL or otherwise) that allow binding between any two CLR properties that implement INotifyPropertyChanged and INotifyCollectionChanged? It seems to be it should be possible to do something like this: var…
Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
14
votes
4 answers

How to add property-level Attribute to the TypeDescriptor at runtime?

I want to add some custom PropertyGrid-centric Attributes to the object's properties, to provide richer editing, hide some values and group them in categories, because that class I'm working with doesn't provide such functionality and I can't do…
Gman
  • 1,781
  • 1
  • 23
  • 38
13
votes
1 answer

How have you used IContainer/ISite/IComponent in your own code?

Possible Duplicate: When and why should I implement IComponent, IContainer, and ISite? There are various online docs about using IContainer and ISite (eg http://www.theserverside.net/tt/blogs/showblog.tss?id=pluginArchitectures), and there are…
thecoop
  • 45,220
  • 19
  • 132
  • 189
12
votes
2 answers

Difference between ISupportInitialize (BeginInit/EndInit) and SuspendLayout/ResumeLayout

Could someone please explain what the difference is between using the ISupportInitialize interface methods (BeginInit/EndInit) and using SuspendLayout/ResumeLayout? Is ISupportInitialize ONLY used during construction/"initial" initialization... or…
Pato
  • 207
  • 3
  • 7
12
votes
2 answers

.NET: How do I invoke a delegate on a specific thread? (ISynchronizeInvoke, Dispatcher, AsyncOperation, SynchronizationContext, etc.)

Note first of all that this question is not tagged winforms or wpf or anything else GUI-specific. This is intentional, as you will see shortly. Second, sorry if this question is somewhat long. I try to pull together various bits of information…
12
votes
1 answer

SerializationStore not finding references

When trying to deserialize using the ComponentSerializationService, errors are populated that references were not found: public ICollection Deserialize(object serializationData) { var serializationStore = serializationData as…
JL.
  • 78,954
  • 126
  • 311
  • 459
10
votes
2 answers

.NET Component Model explanation

First of all, I have to say that I'm going to talk about System.ComponentModel.Component. You know, I understand, that the .NET Component Model provides ability (through Site Services) to define separate Components, so they can communicate with each…
theSpyCry
  • 12,073
  • 28
  • 96
  • 152
10
votes
2 answers

System.ComponentModel.BindingList: Add(object) vs. AddNew()

What is the difference between the System.ComponentModel.BindingList methods Add(object) and AddNew()? The MSDN documentation says this: Add: Adds an object to the end of the Collection. AddNew: Adds a new item to the collection. It seems like…
9
votes
1 answer

System.ComponentModel namespace usage

I consider myself a reasonably experienced .NET developer but I have almost never directly used types in the System.ComponentModel namespace. (I've implemented a few custom attributes and consumed them via reflection). In what sort of scenarios do…
Ash
  • 60,973
  • 31
  • 151
  • 169
8
votes
3 answers

Get Description Attributes From a Flagged Enum

I am trying to create an extension method that will return a List containing all the Description attributes for only the set values of a given [Flags] Enum. For example, suppose I have the following enum declared in my C#…
John Bustos
  • 19,036
  • 17
  • 89
  • 151
1
2 3 4 5 6 7 8