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
1
vote
0 answers

Overriding the DefaultValue of a parent's properties

I'm inheriting a Control, with the goal of overriding the value of the DefaultValue attribute of some properties. However, to do this I need to add some boilerplate to create "proxies" to the parent class's properties, like…
fableal
  • 1,577
  • 10
  • 24
1
vote
1 answer

System.ComponentModel.IContainer takes 1 sec to declare?

I'm currently using Red Gate's Performance Profiler to optimize an application. I keep running across a declaration generated by VS and always takes around a second to declare. Its being set to null too. I don't understand why this takes a second to…
ExceptionLimeCat
  • 6,191
  • 6
  • 44
  • 77
1
vote
1 answer

What AttributeProvider of type IListSource do?

I have a user control that contains this property: [AttributeProvider(typeof(IListSource))] public object DataSource { get { return _grid.DataSource; } set { _grid.DataSource = value; } } How does this attribute affect the property? (besides…
HuBeZa
  • 4,715
  • 3
  • 36
  • 58
0
votes
1 answer

Click event delayed in ContextMenu attached to NotifyIcon

I am working on a plugin (using System.ComponentModel.Composition) for an application to place an icon in the notification area of the Windows UI. trayMenu.MenuItems.Clear(); // Create context menu items foreach( IJob job in jobs ) { MenuItem…
Oliver Salzburg
  • 21,652
  • 20
  • 93
  • 138
0
votes
0 answers

ObservableValidator - GetErrors not returning null when using Custom validation methods

I'm refactoring our platform to use Community Toolkit's MVVM instead of the homebrew MVVM my company made years ago before everything was standardized. After the refactor, I have a couple of unit tests that were expecting a null in response to the…
0
votes
1 answer

VB.NET System.ComponentModel.Component.Site tag cannot be serialized, because it's an interface

Imports System.IO.Ports Imports System.Data.SqlClient Imports System.Collections.ObjectModel Imports System.Data.Common Imports Microsoft Imports System.Data.SqlTypes Imports System.Xml Imports System.Collections.Specialized.BitVector32 Imports…
0
votes
2 answers

Simple application with opening webpage in VB

I would like to create simple exe app in VB, which will open default browser with specified page. I have this code Public Class Form1 Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click End Sub Private Sub…
pomahajbo
  • 1
  • 1
0
votes
0 answers

Winform Surface Designer how to generater resx file from component serializer

I am currently using the System.ComponentModel.Design.Serialization namespace to generate C# code. This code is compiled later by another application. var manager = new DesignerSerializationManager(host); using…
TommyBoii
  • 77
  • 1
  • 11
0
votes
0 answers

How to read the parts definition of Assembly from an AssemblyCatalog

I have a C# project runs on both .NET framework 4.6.2 and .NET core 3.1 with a most sharable code. When running in .NET framework, It is loading both the assembly and its parts definition from the x86 bin path using the AssemblyCatalog class. But,…
0
votes
1 answer

Validating Form Data For null values in web api

I have class like public class MyClass { public object Jobj{get; set;} public string summary{get; set;} public string someMethod() { //Do some work return ""; } } and a post action creating instance of this class and initialising…
0
votes
2 answers

How to get TableName and Key field value from an object we are using in C#

I have a following like classes which i am using as model for entity framework core for one of my table. After saving i am passing the object for some sort of caching work. How can i get the TableName and the value of the field which is marked as…
Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93
0
votes
1 answer

Most advanced tutorial on custom collection editor

We need to know everything on how to customize the standard .NET collection editor, where shall we look?
abenci
  • 8,422
  • 19
  • 69
  • 134
0
votes
1 answer

VisualStudio customize paste operation for my component at design-time

I created WinForm component and I want to replace some properties of my component when developer copy and then paste(not when copy but when paste) component from clipboard at design time. VisualStudio creates new copy of component and assign…
0
votes
1 answer

How IEQuatable affect the behavior of combobox

While working on combo box I found out a wired issue. Xaml looks like this
Deep
  • 1
0
votes
1 answer

Could GetMember() ever return an empty array for an enum?

Take a look at this enum extension method for getting the Description attribute: public static string GetDescription(this Enum enumValue) { var memberInfo = enumValue.GetType().GetMember(enumValue.ToString()); if (memberInfo.Length < 1) …
Lews Therin
  • 3,707
  • 2
  • 27
  • 53