473,320 Members | 1,832 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,320 software developers and data experts.

Component develoment

I am developping a component that there are some properties and methods, and
one of these properties has its own properties (ex. A componen name
MYCustomers with the property ADDRESS that has NAME, NUMBER, CITY, ZIPCODE
as its own propertis) How do I create this component in a way that I can
change the ADDRESS properties values at desing time. Does any anyone can
give an example?
Jun 26 '06 #1
3 1209
Claudio,

To the property, you want to add the following attribute:

[TypeConverter(typeof(ExpandableObjectConverter))]

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claudio" <cl*****@digi.com.br> wrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
I am developping a component that there are some properties and methods,
and one of these properties has its own properties (ex. A componen name
MYCustomers with the property ADDRESS that has NAME, NUMBER, CITY, ZIPCODE
as its own propertis) How do I create this component in a way that I can
change the ADDRESS properties values at desing time. Does any anyone can
give an example?

Jun 26 '06 #2
This my component.

public class MeuClienteInfo : Component
{

string nome;

EnderecoInfo endereco; // Objeto Endereco
protected internal MeuClienteInfo()

{

InitializeComponent();

}

public MeuClienteInfo(IContainer container)

{

container.Add(this);

InitializeComponent();

}

public string Nome

{

get { return this.nome; }

set { this.nome = value; }

}

public EnderecoInfo Endereco

{

get { return this.endereco; }

set { this.endereco = value; }

}

}

public class EnderecoInfo

{

string rua;

int numero;

string bairro;

public string Rua

{

get { return this.rua; }

set { this.rua = value; }

}

public int Numero

{

get { return this.numero; }

set { this.numero = value ; }

}

public string Bairro

{

get { return this.bairro; }

set { this.bairro = value; }

}

}

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> escreveu
na mensagem news:ez**************@TK2MSFTNGP05.phx.gbl...
Claudio,

To the property, you want to add the following attribute:

[TypeConverter(typeof(ExpandableObjectConverter))]

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claudio" <cl*****@digi.com.br> wrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
I am developping a component that there are some properties and methods,
and one of these properties has its own properties (ex. A componen name
MYCustomers with the property ADDRESS that has NAME, NUMBER, CITY, ZIPCODE
as its own propertis) How do I create this component in a way that I can
change the ADDRESS properties values at desing time. Does any anyone can
give an example?


Jun 26 '06 #3
It worked fine. Thank you very much.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> escreveu
na mensagem news:ez**************@TK2MSFTNGP05.phx.gbl...
Claudio,

To the property, you want to add the following attribute:

[TypeConverter(typeof(ExpandableObjectConverter))]

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claudio" <cl*****@digi.com.br> wrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
I am developping a component that there are some properties and methods,
and one of these properties has its own properties (ex. A componen name
MYCustomers with the property ADDRESS that has NAME, NUMBER, CITY, ZIPCODE
as its own propertis) How do I create this component in a way that I can
change the ADDRESS properties values at desing time. Does any anyone can
give an example?


Jun 26 '06 #4

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

Similar topics

12
by: Chien Lau | last post by:
I had a situation occur today that's happened a number of times before and I'd like to get your take on it: Imagine... You're developing a WinForms app for a client that includes the use charts....
4
by: orangepic333 | last post by:
Could someone tell me what's the difference between the two? Is it that a class is used within an OO language while a component can be exported between OO languages? Are there other...
2
by: Edward Diener | last post by:
How does one specify in a component that a property is a pointer to another component ? How is this different from a property that is actually an embedded component ? Finally how is one notified in...
0
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
7
by: Joe | last post by:
Is it possible to have a component which is global to the entire application? I need to have a single component act sort of like a server which components in any of the forms can access. For...
0
by: bharathreddy | last post by:
In .Net COM+ components are referred to as serviced components, Namespace: System.EnterpriseServices; Advantage of Serviced Components: object pooling, database connection pooling,
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.