System.Attribute Class
Information   Base Types   Related Resources

Base class for custom attributes.

  • Namespace: System
  • First seen in: .NET v1.0.3705
  • Last seen in: .NET v1.1.4322
  • Last changed in: .NET v1.0.3705
  • Assembly: mscorlib.dll

  • System.Object
  • View this type on MSDN
  • View this type on WinFX 247
    Articles (16)Discussions (106)MembersRotorChanges
    Discussions

    Page: 12345
    Custom Attribute Browser/Dumper (VIP replies)
    Develop.com's DOTNET List
    This shouldn't be very hard... you can call Attribute.GetCustomAttributes(yourAssembly). Look it up, it returns an array of Attributes you can then manipulate. Hopefully this will help you. Brian Original Message From: Ethan Smith [mailto:ethan.smith@POBOX.COM] Sent: Wednesday, February 27, 2002 3:49 PM To: DOTNET@DISCUSS.DEVELOP.COM Subject: [DOTNET] Custom Attribute Browser/Dumper Hi All, Do any...
    Accessing Custom Attributes in an HttpModule (VIP replies)
    microsoft.public.dotnet.framework.aspnet
    I have a custom attribute that I attach to certain pages in my application and I want to inspect each page request as it is made to see if the custom attribute is attached to the underlying page class. If is attached I want to perform some action. How can I access custom attributes from an HttpModule? I have to pass a target to the System.Attribute.GetCustomAttribute() call to attempt to retrieve ...
    Adding designer support to a custom tree control (VIP replies)
    microsoft.public.dotnet.languages.csharp
    Hey all... I posted this in the vs.net ide group too, but people are not answering, so I figured that it might be more appropriate here. I'm not sure if I'm adding a designer to my code properly. I'm only adding it to the tree node, where each custom tree node is then added to a normal tree control. I'm trying to get an add in to interact with the property window in VS.Net. Basically, I created a ...
    button control and cancel submit (VIP replies)
    microsoft.public.dotnet.framework.aspnet.webcontrols
    I use Attribute.Add to call a javascript function client side from an asp:button control. The javascript function opens a window. My problem is that the submit event fires after the javascript code executes. When I view the source in "running documents" I see that the button is declared as "type submit", even when I provide a commandName, which I thought changed a submit button into a command butt...
    C# Attributes (VIP replies)
    microsoft.public.dotnet.languages.csharp
    Hi, I am trying to grasp a better underestanding of C# Attributes . I don't see them as a very usefull capability. Could anyone refer me to resources show me best practices and how can I improve my code using attributes? Thanks, Allan
    Convert from C# to VB (VIP replies)
    microsoft.public.dotnet.languages.vb
    how can i convert this public NumPointsPropertyDescriptor(PointsPropertyTab owner) : base("NumPoints", new Attribute[]{CategoryAttribute.Data, RefreshPropertiesAttribute.All}) { this.owner owner; } to VB.NET thks JSB
    create an instance of type 'System.Attribute' (VIP replies)
    microsoft.public.dotnet.framework.windowsforms
    I created a BindingListView that subclasses from ListView ... when switch to designer mode I get ... The designer must create an instance of type 'System.Attribute' but it cannot because the type is declared as abstract. Poor designer. Anyone know how I can help him out?
    DataListItem in DataList does not render attributes/Tooltips (VIP replies)
    microsoft.public.dotnet.framework.aspnet.webcontrols
    I've added a datalist (DataList1) to my web form. In code behind, i'm trying to render the "title" and "style" attribute on each DataListItem. But there appears to be a bug in the DataListItem because it ignores any attributes assigned to it. running on win2003 server, .Net Framework 1.1 example DataList1.RepeatLayout RepeatLayout.Table; // the datalistitem should be renderd as a tablecell //loop ...
    Design time Shadow Property of a Control Container (VIP replies)
    microsoft.public.dotnet.framework.windowsforms
    I have a UserControl ("CustomContainer") to which I am adding instances of another custom control ("CustomTextBox"). When the CustomTextBox instance accesses a particular property of the CustomContainer it's on, it needs to be "redirected" to a "shadow" property maintained by the CustomContainer's designer ("CustomContainerDesigner"). Unfortunately, the CustomTextBox keeps referring to the CustomC...
    Docs for Attribute.GetCustomAttributes() (VIP replies)
    Develop.com's DOTNET List
    Hi all, I found in the beta 2 docs a description of the exceptions thrown for Attribute.GetCustomAttributes(). This method is overloaded many times, and most of the signatures have an explanation that ArgumentException is thrown if "element is not type attributeType". The same exception is thrown if "attributeType is not derived from Attribute." However, it doesn't seem possible that element can b...
    error when trying to add inherited form (VIP replies)
    microsoft.public.dotnet.framework.windowsforms.designtime
    Hiya, I get an error when I try to add a particular type of "inherited form" to my app. I try to add it thru the following steps: 1) right click the selected project 2) Add 3) inherited form error An exception System.ExecutionEngineException has occurred in the default domain \error The debugger chokes in the following lines of a Utility.vb class: code For Each attr As System.Attribute In type.Get...
    GetCustomAttribute not working properly. Please help (VIP replies)
    microsoft.public.dotnet.vjsharp
    Hi, GetCustomAttribute method returns the first custom attribute applied to the type, if any custom attributes are applied to the type. But in the follwoing code it retuning null in the following line AuthorsAttribute authAttr ((AuthorsAttribute)(Attribute.GetCustomAttribute(mInfo, AuthorsAttribute.class.ToType()))); Can any one help me out or is it that custom attributes are not supported by J#. ...
    Have custom add-in interact with property window (VIP replies)
    microsoft.public.vsnet.ide
    Hi all, I'm trying to get an add in to interact with the property window in VS.Net. Basically, I created a tool window containing a custom tree control. When the user clicks on a tree node, I want certain properties to show up in the property window. My understanding is that I need to create a designer for the component, and override the prefilterproperties method. The problem right now is that wh...
    Locked property (VIP replies)
    microsoft.public.dotnet.languages.vb
    I'm writing my first windows control library. A simple textbox with some numeric facilities. Well, there is a strange thing that happen. I want to add a locked property. As many other property, because it's a default property, I must shadow it, but unfortunately, despite the other properties shadowed, for instance tabindex, locked continue to stay in design category also if I set it up to behaviou...
    Method based attributes used as delegates (VIP replies)
    microsoft.public.dotnet.languages.csharp
    I am no expert on attributes, but I have used them, but I am stumped by this one ... basically is it possible to get the attributes from a method used as a delegate? For example, I have a method called [TileSizeAttribute(40, 70)] private void listView1 DrawItem(object sender, DrawListViewItemEventArgs e) { // stuff } that I am setting via ... listView1.DrawItem listView1 DrawItem Then in DrawItem ...
    Persisting control properties at design time (VIP replies)
    microsoft.public.dotnet.framework.aspnet.buildingcontrols
    Sorry, this is a 2nd post related to this problem, but I've now set up my MSDN e mail id, so I wanted to post with this e mail. I'm trying to build some custom controls/components for use with ASP.NET. I have ControlParent (I've tried this where ControlParent is a Control, and also where it's a WebControl descendent) and ComponentChild (a Component descendent). ControlParent has a ControlParent.Co...
    Problem Using C#-defined Custom Attributes in JScript.NET (VIP replies)
    microsoft.public.dotnet.languages.csharp
    I can't seem to get dynamically compiled JScript code to use C# defined custom attributes. I have a simple attribute and a class defined in a C# assembly: namespace MyNamespace { [AttributeUsage(AttributeTargets.All)] public abstract class MyCsharpAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class)] public class MyCsharpClassAttribute : MyCsharpAttribute { } public class MyCsClass { ...
    Problem Using C#-defined Custom Attributes in JScript.NET (VIP replies)
    microsoft.public.dotnet.languages.jscript
    I can't seem to get dynamically compiled JScript code to use C# defined custom attributes. I have a simple attribute and a class defined in a C# assembly: namespace MyNamespace { [AttributeUsage(AttributeTargets.All)] public abstract class MyCsharpAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class)] public class MyCsharpClassAttribute : MyCsharpAttribute { } public class MyCsClass { ...
    PropertyGrid and Static class (VIP replies)
    microsoft.public.dotnet.framework.windowsforms.controls
    Does anyone knows how to assign a static class to the property grid?? It gives me compile time error because I am assigning the class directly (as it is static) Thank You Niraj Bhatt CyberView Technology Ltd Tel.: 0207 761 3037
    PropertyGrid question (VIP replies)
    microsoft.public.dotnet.framework.windowsforms
    If I base a PropertyGrid control on a class, I have a certain amount of control on which public properties exposed by the class appear in the control via the [Browsable(true)] attribute of the property. I need to have a finer degree of control since (based upon a number of factors) I may either want to show or hide certain properties, and do not want to create a separate class for all possible com...
    Readonly property vs function (VIP replies)
    microsoft.public.dotnet.languages.vb
    With a Class is there any difference between a readonly property and function besides having to use Get/End Get. Are there any performance/resource advantages for either. Thanks Fred
    reflection and CustomAttributes (VIP replies)
    microsoft.public.dotnet.languages.csharp
    Hello, I still have some problems with custom attributes and I ask someone for a helpful hand. In the appendix is the trivial ILAsm code with single custom attribute. The code compiles OK but then I cannot use reflection to load the assembly to read custom attributes because following code surprisingly fails in (*) line: public static void PrintAttributes( Assembly a ) { foreach ( Type t in a.GetT...
    What Control is Microsoft Using Here? (VIP replies)
    microsoft.public.dotnet.framework.windowsforms
    Can anyone tell me what type of control Microsoft is using on the project properties pages in Visual Studio .Net? To see it right click on a project and select Properties. The control I'm interested in is the one in the middle displaying the Application, Project, and Wrapper Assembly data. It appears to be the perfect combination of a treeview with a datagrid. Not sure. I'm assuming that Visual St...
    What Control is Microsoft Using Here? (VIP replies)
    microsoft.public.dotnet.framework.windowsforms.controls
    Can anyone tell me what type of control Microsoft is using on the project properties pages in Visual Studio .Net? To see it right click on a project and select Properties. The control I'm interested in is the one in the middle displaying the Application, Project, and Wrapper Assembly data. It appears to be the perfect combination of a treeview with a datagrid. Not sure. I'm assuming that Visual St...
    newbie question: How to read AssemblyTitle assembly attribute
    Develop.com's DOTNET List
    Are you making sure that the attribute you're trying to read is an assembly level attribute? For example it should be in the form of: [assembly: MyAttribute("hello")] Brian Original Message From: Sean Greer (SBI Chico) [mailto:Sean.Greer@BI TECH.COM] Sent: Wednesday, April 17, 2002 1:10 PM To: DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [DOTNET] newbie question: How to read AssemblyTitle assembly attr...
    Ad
    MBR BootFX
    Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
     
     Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
    Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com