473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Attributes questions

I want to apply the [ComVisible(false)] attribute to the GetType method.
Problem is GetType cannot be overridden for me to apply the attribute. I
read somewhere an attribute can be applied in this situation in 2.0 but the
MS help is typically useless and google has proven fruitless. Can this be
done?

Thanks in advance,
Michael
Oct 15 '07 #1
1 1055
You can write a custom TypeDescriptionProvider. In this case you would add
the attribute to the MethodDescriptor before returning it.

Custom TypeDescriptionProviders are new to 2.0 and are a very powerful
feature indeed.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Michael C" <mi**@nospam.comwrote in message
news:O0**************@TK2MSFTNGP03.phx.gbl...
>I want to apply the [ComVisible(false)] attribute to the GetType method.
Problem is GetType cannot be overridden for me to apply the attribute. I
read somewhere an attribute can be applied in this situation in 2.0 but the
MS help is typically useless and google has proven fruitless. Can this be
done?

Thanks in advance,
Michael
Oct 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Viken Karaguesian | last post by:
Hello all, It stinks being a newbie! One thing that I'm not sure about with CSS is: where is the "proper" place to put font attibutes? This has me a little confused. Take the below style sheet...
3
by: xAvailx | last post by:
I apologize ahead of time for the long post... Background: Working on a CRM type custom application. The application is for an event management company. The company will provide the application...
1
by: George Sakkis | last post by:
Hi all, I have a few questions on object introspection of builtins and extension modules. Here's an example: >>> from datetime import date >>> d=date(2003,1,23) >>> d.__dict__ Traceback...
4
by: Wiktor Zychla | last post by:
Hello, for some reason I need to use attributes in ILAsm code and read these attributes in C# code. My problem is with the attribute declaration inside ILAsm code. I know that I define any...
16
by: Bret Pehrson | last post by:
I've converted a non-trivial C++ library to managed, and get the following unhelpful linker error: Assignment.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are...
0
by: djarmoluk | last post by:
I have a RadioButtonList (named rbAnswers) control within a repeater control. When binding to the repeater, I am trying to add an "OnChange" attribute to the individual list item controls (input...
3
by: redefined.horizons | last post by:
I've been reading about Python Classes, and I'm a little confused about how Python stores the state of an object. I was hoping for some help. I realize that you can't create an empty place holder...
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
3
by: apiringmvp | last post by:
All, So I am creating a function that gets a short blurb of html from a blog. I would like to retain all html formating and images. The code below works well, with the exception of one issue....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.