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
3
votes
1 answer

Override Visual Studio's Treatment of Component-Derived Class

Is there any way to tell Visual Studio that I want to treat my class as a regular class and not a component? My class is declared like this: public class WebDavClient : WebClient { } I guess that, because WebClient derives from…
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
3
votes
1 answer

C# Using and Compiling Windows.Form

I am working on coding a GUI with C#. I'm following this simple tutorial to get started. To compile, I need to reference System.Windows.Forms.DLL System.Drawing.DLL, so I type csc /r:System.Windows.Forms.DLL /r:System.Drawing.DLL…
Veech
  • 1,397
  • 2
  • 12
  • 20
2
votes
1 answer

Is there a Silverlight equivalent of ITypedList?

I have a collection of objects, each of which holds a set of name-value pairs. The names are the same across all objects. I'd like to show these as columns in a data grid. In Winforms/WPF I'd use ITypedList with some PropertyDescriptor instances…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
2
votes
1 answer

Entity Framework 6 not compatible with Data Annotations from system.componentmodel.annotations(net standard compatible) assembly?

I'm trying to use Entity Framework with a set of entities defined as a part of net standard2.0 nuget package. The project that uses Entity framework is a net472 project. When I'm building the model in tests, I'm seeing the below…
2
votes
3 answers

Could not load file or assembly System.ComponentModel.Annotations, Version=4.2.0.0

I realise this question has been asked, but I have tried all of the suggested solutions I can find. I have a Load Testing project (with a .loadtest file and class that inherits from Microsoft.VisualStudio.TestTools.WebTesting.WebTest). It has to…
2
votes
1 answer

How to dispose of a Forms.Timer on the Compact Framework

On the Compact Framework, the System.Windows.Forms.Timer class doesn't support the system.componentmodel constructor: new Timer() is supported: http://msdn.microsoft.com/en-us/library/aa335543(v=vs.71).aspx new Timer(IContainer container) is not…
Rich
  • 15,048
  • 2
  • 66
  • 119
2
votes
1 answer

format dateTime in a datagridview bind to a bindinglist

i've: - Datagridview - BindingSource - BindingList I associate the BindingList to a class that contain a dateTime property. The datagridview show the value as 'dd/mm/yy hh:MM'. I want to format as 'hh:MM:ss'. I know that there is a mode to set the…
Marcello
  • 438
  • 5
  • 21
2
votes
1 answer

Trying to start a windows service from a windows application giving System.ComponentModel.Win32Exception: Access is denied

I am trying to develop a windows application to start/stop and monitor status of two particular services. The problem is I am getting System.ComponentModel.Win32Exception: Access is denied Note that both services are local system The…
IanCian
  • 1,098
  • 2
  • 16
  • 34
2
votes
1 answer

CategoryAttribute returns "Misc" for category named as "Default"

I have a class named CommonKeys.cs and it contains a property as below, public class Test { private SolidBrush _backgroundbrush; [CategoryAttribute("Default")] public SolidBrush BackgroundBrush { get { return…
Amal
  • 576
  • 1
  • 6
  • 26
2
votes
1 answer

Can a TargetInvocationException thrown from reflection have a null InnerException

Whilst browsing the source code for System.ComponentModel.DataAnnotations.CustomValidationAttribute here, I saw the following code (shortened): try { methodInfo.Invoke(null, methodParams); } catch (TargetInvocationException ex) { if…
H Bellamy
  • 22,405
  • 23
  • 76
  • 114
2
votes
2 answers

Enumerate Form Controls

I have this C# code to enumerate controls of a Form instance: private void button1_Click(object sender, EventArgs e) { textBox1.Text = ""; Form2 form2 = new Form2(); foreach (Control control in form2.Controls) { …
Uros Calakovic
2
votes
0 answers

Use ComponentModel attributes to auto generate DataGridView columns with custom DataGridViewColumn types?

I'm attempting to use the System.ComponentModel property attributes such as [Browsable(true)] to auto generate columns based on a Datasource defined as a BindingList but am having issues figuring out how to change the column types…
CoryG
  • 2,429
  • 3
  • 25
  • 60
2
votes
3 answers

Recreating "Font" Property Behavior

Controls that inherit off of System.Web.UI.WebControls.WebControl have a property called Font. The type is System.Web.Ui.WebControls.FontInfo. When working with these controls in the designer, it breaks out the Font property into multiple…
2
votes
1 answer

Declaring an IsInDesignMode Property for use in wpf using vb.net

In one of his blog posts Laurent Bugnion demonstrated the following code snippet as a means of detecting the desingtime mode for wpf private static bool? _isInDesignMode; /// /// Gets a value indicating whether the control is in design…
Dom Sinclair
  • 2,458
  • 1
  • 30
  • 47
2
votes
1 answer

Disposal of a Running BackgroundWorker

I have seen many questions on SO regarding the disposal of a BackgroundWorker in a Windows Forms application, and it appears that the consensus is that they do not need to be manually disposed in most situations. However, I have a question…
JNYRanger
  • 6,829
  • 12
  • 53
  • 81