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 / Visual Studio.NET / Extensibility / July 2004

Tip: Looking for answers? Try searching our database.

Redirecting Field to Property during Visual Inheritance

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Praveen Ramesh - 24 Jul 2004 14:35 GMT
I forgot the attribute that will redirect the vs.net code generator to use a
public Property in a base class instead of a private field in the base
class. Does it ring a bell anybody?

Let me give you an example:

public class MyBaseForm : Form
{
   // With this XAttribute, when the derived form below is serialized in
the designer, the code generator will apply
   // any changes to this arraylist through the MyList property.
   // What is this XAttribute?
   [XAttribute("MyList")]
   private ArrayList someList;

   public ArrayList MyList
   {
       get{return this.someList;}
   }

   ...

}

In the derived class's InitializeComponent this the code that will be
inserted by the code generator:

public class MyDerivedForm : MyBaseForm
{
   ...

   private void InitializeComponent()
   {
       ...
       this.MyList.AddRange(new int[]{1});
   }
}

Thanks
-Praveen

Signature

Praveen Ramesh
Syncfusion, Inc.
visit www.syncfusion.com for .Net Essentials
visit www.syncfusion.com/faq/winforms/ for WinForms FAQ

Josh Einstein - 24 Jul 2004 21:19 GMT
Check the docs for System.ComponentModel namespace.

I think it's AmbientValueAttribute

Signature

Josh Einstein
Einstein Technologies
--------------------------------------------------------
Add ink input to Outlook with Tablet Enhancements for Outlook! Only $19.99!
http://www.einsteinware.com

>I forgot the attribute that will redirect the vs.net code generator to use
>a
[quoted text clipped - 37 lines]
> Thanks
> -Praveen

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.