CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 4/19/2004 2:08:46 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 15 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
FancyKetsup
Asp.Net User
Class exposed as property with multiple instances.4/19/2004 2:08:46 AM

0/0

I have a font class that I am trying to develop that provides similar editing in the property browser as the way you edit fonts for WebControls. The problem I am having is if in my control I set one instance of font class to handle the font needs of the title in my control and another instance of my font class to handle the font needs of the body content they don?t work properly. The way I understand it is that the designer treats each instance of my font class as a top level property and loads it into memory but it doesn't load sub properties of the font class which is exposed as a property. Ok well great but upon recreation in the type converter if both instance read the sub properties from the class definition rather from an instance then how da-heck can I have 2 separate instances that act independently of each other. The way they act in the designer now is if I change a sub-property for the title which has it's own instance of font class it also changes the sub-properties of the body content which has its own instance of font class. Hope this makes since and any ideas on how this situation is handled. Here is snippet of how I coded the font properties of the control.

public FontInfo UserNameFont{get{return font2;}set{}}
internal FontInfo font2 = new FontInfo();

public FontInfo Font{get{return font1;}set{}}
internal FontInfo font1 = new FontInfo();

//FontInfo class
[TypeConverter(typeof(FontInfoConverter))]
public class FontInfo
{
internal string name = "Verdana";
internal string names = "Verdana";
internal bool italic = false;
internal bool underline = false;
internal bool strikeout = false;
internal bool overline = false;
internal bool bold = false
internal string size = "12px";

[Editor(typeof(System.Drawing.Design.FontNameEditor), typeof(UITypeEditor))]
[TypeConverter(typeof(FontInfoNameConverter)), NotifyParentPropertyAttribute(true)]
[DefaultValue(typeof(System.Drawing.FontFamily),"Verdana")]
public string Name{get{return name;}set{name = value;}}
[NotifyParentPropertyAttribute(true)
public string Names{get{return names;}set{names = value;}}
[DefaultValue(typeof(bool), "false"), NotifyParentPropertyAttribute(true)]
public bool Italic{get{return italic;}set{italic = value;}}
[DefaultValue(typeof(bool), "false"), NotifyParentPropertyAttribute(true)]
public bool Underline{get{return underline;}set{underline = value;}}
[DefaultValue(typeof(bool), "false"), NotifyParentPropertyAttribute(true)]
public bool Strikeout{get{return strikeout;}set{strikeout = value;}}
[DefaultValue(typeof(bool), "false"), NotifyParentPropertyAttribute(true)]
public bool Overline{get{return overline;}set{overline = value;}}
[DefaultValue(typeof(bool), "false"), NotifyParentPropertyAttribute(true)]
public bool Bold{get{return bold;}set{ bold = value;}}
public string Size{get{return size;}set{size = value;}}
}



Then I was planning on the help of the type converter for detecting which instance was being changed and change the sub-properties of each fontinfo for me which in turn are wired to the rendered output respectively. But because each instance depends on the same class definition for sub-property values it will not work independently. Any suggestions other than, duplicating the fontinfo class with a different name and type converter. I was trying to somehow grab the variable name of each instance in the font converter and change that particular instances sub-properties... but again the way I understand it even if I do figure out how to do this it still won't work properly because both instances are sharing the same set of sub-properties even though both where declared as a new instance. Any ideas?
Answering a question increases your knowledge asking a question shows your Intelligence!
1 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Book of Visual Studio .NET: A Guide for Developers Authors: Robert B. Dunaway, Pages: 369, Published: 2002
Developing Client/server Applications with Visual Basic 4 Authors: Dan Rahmel, Rahmel, Pages: 1038, Published: 1995
Beginning Access 2002 VBA Authors: Robert Smith, Dave Sussman, Ian Blackburn, Mark Horner, Martin Reid, John Colby, Paul Turley, Helmut Watson, Pages: 976, Published: 2003
Professional WCF Programming: .NET Development with the Windows Communication Foundation Authors: Scott Klein, Pages: 430, Published: 2007
Pro ASP. Net 3. 5 Server Controls and AJAX Components Authors: Rob Cameron, Dale Michalk, Pages: 740, Published: 2008
Access 2002 Desktop Developer's Handbook: Desktop Developer's Handbook Authors: Paul Litwin, Ken Getz, Mike Gunderloy, Pages: 1439, Published: 2001
Building Solutions with the Microsoft .NET Compact Framework: Architecture and Best Practices for Mobile Development Authors: Dan Fox, Jon Box, Pages: 367, Published: 2003
Developing Web Applications with Visual Basic.NET and ASP.NET Authors: John Alexander, Billy Hollis, Pages: 400, Published: 2002
Essential ASP.NET with Examples in Visual Basic .NET: With Examples in Visual Basic.Net Authors: Fritz Onion, Pages: 395, Published: 2003

Web:
How to share data across multiple instances of a class without ... This article describes how to share data across multiple instances of a ... The data member is exposed to each instance of the class that references the ...
InformIT: Designing C# Objects Using Classes > Understanding Classes In addition, there are never multiple instances of the static class data. ... When classes are exposed externally to other applications, the application ...
Mapping WMI to ODBC (Windows) Note WMI class and property qualifiers that change with the instance of a class are not exposed. WMI associations are only exposed when they are represented ...
Take advantage of strongly typed collection classes in .NET In both cases, the protected List property of the base class, which exposes the ... using an ArrayList exposed through the protected InnerList property. ...
WSRF based HelloWorld with multiple instances WSRF based ... HelloWorld WSRF with multiple instances. In first tutorials we started with ...... ...
BeansWrapper (FreeMarker 2.3.14 API) At this level of exposure, only property getters are exposed. Additionally, property getters that map to unsafe methods are not exposed (i.e. Class. ...
ewbi.develops: Access Windows Collection ... CurrentView property breaks down when faced with multiple instances. ... I added some find methods to the collection class allowing windows to be sought ...
Structures, Modules and Classes in VB exposed as a property of the class like an element of the UDT, bu .... previous chapter that now we can have multiple instances of the class based on the ...
COM Components & Class Modules To create properties of a class, we use property procedures if we want to execute ... Multiple instances of a class module can be created ...
CodeProject: WMI Provider Extensions in .NET 3.5. Free source code ... May 3, 2008 ... If your WMI class can have multiple instances, one or more of the read-only .... Attempting to update a property exposed by a singleton WMI ...




Search This Site:










how do i get the return value?

reset button does not clear pre-checked checkboxes

using #region to organize code, industry standard for usage

anonymous access to some pages, secure access to other pages

store variable

can i make chm file with visual studio?

media and application

gethhashcode

request.isauthenticated = false

data grouping display help

visual studio 2005 sp1 - vista - dataset designer

consuming web service requiring client certificate on windows 2003 server

dnn challenge

integrated windows authetication not working

selectednode of treeview takes so long to response!

problem with custom configuration handler

suggestions - creating dal using daab

can i use windows and forms authentication together?

populate dropdownlist with arraylist

javascript from code behind

loggedin template question - probably an easy answer....

stripping needless data from httpcontext.current.request.form

asp.net, themes and browsers

make asp:menu work on click

<asp:menu>

footer / screen real estate question

bug in .net? workaround needed.

optimizing asp.net application for search engines

get days, hours, minutes until a specific date

dnn 2 ? where

 
All Times Are GMT