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
0
votes
0 answers

Valid placement of System.ComponentModel.DataAnnotations on properties and Encapsulated fields

I'm using various syntaxes of System.ComponentModel.DataAnnotations within my Model. Wondering if there's any implications on DataAnnotations placement using this short hand syntax and also the placement seen further below where DataAnnotations are…
greg
  • 1,118
  • 1
  • 20
  • 40
0
votes
1 answer

Understand Component.GetService()

i have a method in a Usercontrol with this code public bool GetActiveDocument(ref EnvDTE.Document doc) { try { var dte = (DTE2)GetService(typeof(SDTE)); doc = dte.ActiveDocument; if…
mjsr
  • 7,410
  • 18
  • 57
  • 83
0
votes
1 answer

ComponentModel's Browsable false doesn't work for specific model

I have DataGridView and I display different tables. Everything worked fine but I had to update my Entity Framework model and it reset all my model classes. Now only one class still displays ID Column and other ones hide it. I can't see any…
0
votes
1 answer

Sharing of Property in a DTO using Category attribute c#

I'm working on Employee Model, it contains all the information about the Employee already I posted the same in How to use the DTO efficiently based on Scenario in C#. How could I share the single property for the multiple groups using Category…
B.Balamanigandan
  • 4,713
  • 11
  • 68
  • 130
0
votes
1 answer

C# Property Grid Pass Constructor Variable

I'm using the C# property grid to add new objects and change settings of a specific object. I need to know how to pass a a variable to the constructor using the Component Model. Reason why is because a parameter is required to correctly define the…
ceds
  • 2,097
  • 5
  • 32
  • 50
0
votes
1 answer

What is "System.ComponentModel.Design.DateTimeEditor+DateTimeUI"?

Greetings, doing research into outside code I got this control returning { Name = "DateTimeUI" FullName = "System.ComponentModel.Design.DateTimeEditor+DateTimeUI" } to Type.GetType(). I've no idea what DateTimeUI is, and…
Mir
  • 454
  • 1
  • 4
  • 13
0
votes
2 answers

'MatchTimeoutInMilliseconds' error in c# generated file

Issue This error has only just started appearing in my project and I am unsure on why. I have a 'Silverlight 5' Project file which generates a file. This file contains MatchTimeoutInMilliseconds call which seems to keep erroring: …
Ben Clarke
  • 1,051
  • 4
  • 21
  • 47
0
votes
1 answer

Overridding ComponentModel attributes (ie, DisplayName) doesn't work as expected

I have two classes: public class DocumentViewModel { public virtual string DocumentNumber { get; set; } } public class PurchaseOrderViewModel : DocumentViewModel { [DisplayName("PO Number")] public override string DocumentNumber { get;…
Matt Grande
  • 11,964
  • 6
  • 62
  • 89
0
votes
1 answer

Validation doesn't fire (System.ComponentModel.DataAnnotations)

I have this class here with 2 properties Name and Age using System.ComponentModel.DataAnnotations; public class Person { [Required(AllowEmptyStrings = false)] [StringLength(25, MinimumLength = 2)] [RegularExpression(@"^[a-zA-Z]+$")] …
fubo
  • 44,811
  • 17
  • 103
  • 137
0
votes
2 answers

What is the difference between ComponentModel.DataAnnotation and decorator pattern.?

I was implementing repository decorator pattern on my project as: [Auditable] public class Product { public int Id {get; set;} public string Name {get; set;} } I got this idea from the following…
0
votes
1 answer

Custom view for PropertyGrid array editor

I have default properties window looks like next: Is it possible to change somehow this view? For example I want to show my Template.Name property value and Template.Description instead [array index] and namespase. Any possibilities to do that?
Ksice
  • 3,277
  • 9
  • 43
  • 67
0
votes
1 answer

How does the Control class, provide the ForeColor, BackColor and Font default values?

I know that component-model indicates whether a property has a default value or not, by means of ShouldSerializeValue method of PropertyDescriptor. The base windows-forms Control class, has some properties like ForeColor, BackColor and Font, that…
Miguel Angelo
  • 23,796
  • 16
  • 59
  • 82
0
votes
0 answers

WCF service prompting for credentials without ComponentModel.Container

I'm learning how to work with WCF for a project at work, so I'm trying to set up a service based on the code of a previous project. Although I succeeded, whenever I try to install the executable (with installutil) it prompts me for credentials.…
Ana Ameer
  • 671
  • 11
  • 30
0
votes
1 answer

Defining the Edit-Type (In-Place Editor) in Devexpress PropertyGrid.SelectedObject's Class

let's say i have this class public sealed class OptionsGrid { [Description("Teststring"), DisplayName("DisplaynameTest"), Category("Test")] public string Test { get; set; } } is there any chance to define which Edit (e.G. MemoEdit) should be…
Belial09
  • 694
  • 1
  • 11
  • 24
0
votes
0 answers

Set attributes to a runtime type created by reflection in Vb .Net

I've a function than create a type at runtime using reflection and I want to show it in a property grid. So my problem is how set attributes like DisplayNameAttribute or CategoryAttribute when I define this types. My function is the…