Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / September 2004

Tip: Looking for answers? Try searching our database.

How to use DefaultValue attribute with an enum

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roy Chastain - 27 Aug 2004 17:01 GMT
I have the following code for the property ContentType in class that implements IExtenderProvider

public class foo: Component, IExtenderProvider
{
        [System.ComponentModel.Category("Validation"),
            DefaultValue(typeof(KMS.Core.Forms.Validation.ContentType_Enum),
                "KMS.Core.Forms.Validation.ContentType_Enum.String")]
        public virtual ContentType_Enum GetContentType (Control target)
        {
            ....
        }
}

This code does not realize that String is the default value property ContentType.  I suspect some syntax issue, but do not see the
problem.

Ideas?

Thanks
-------------------------------------------
Roy Chastain
KMSystems, Inc.
Joey Calisay - 05 Sep 2004 01:46 GMT
What do you mean not realized?  property is still serialized even if
ContentType is ContentType_Enum.String?

> I have the following code for the property ContentType in class that implements IExtenderProvider
>
[quoted text clipped - 18 lines]
> Roy Chastain
> KMSystems, Inc.
Hakan Dolas - 08 Sep 2004 15:02 GMT
Should be like the following I guess :

   [Category("Validation"),
DefaultValue(typeof(KMS.Core.Forms.Validation.ContentType_Enum), "String")]
   public virtual ContentType_Enum GetContentType (Control target)
   {
       ...
   }

> I have the following code for the property ContentType in class that implements IExtenderProvider
>
[quoted text clipped - 18 lines]
> Roy Chastain
> KMSystems, Inc.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.