Adding collection to component

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<p align=left><font face=Arial size=2></font> 
<p align=left>Good day all;
<p align=left> 
<p align=left>Im trying to understand how to add a collection to a component for design-time integration. Technically, I want a Dictionary but I imagine the logic is similar. I simply want the user, at design time, to be able to build the dictionary with nice collection editor that pops up in so many of the .net built in controls.
<p align=left> 
<p align=left>Before you simply post a url in response to this, please know that I have done a lot of searching on the subject. Unfortunately, all of the examples that I have found are wrapped in pages of code that isnt (I hope) salient to what I want to do. I cant imagine that it really takes pages of code to do this.
<p align=left> 
<p align=left>In my ignorance, the below code is what seemed natural to me.
<p align=left>  <font size=2>
</font><font color="#0000ff" size=2>private</font><font size=2> </font><font color="#2b91af" size=2>Dictionary</font><font size=2><</font><font color="#0000ff" size=2>string</font><font size=2>, </font><font color="#0000ff" size=2>int</font><font size=2>> registers = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#2b91af" size=2>Dictionary</font><font size=2><</font><font color="#0000ff" size=2>string</font><font size=2>, </font><font color="#0000ff" size=2>int</font><font size=2>>();</font>
<p align=left><font size=2> 
[</font><font color="#2b91af" size=2>Description</font><font size=2> (</font><font color="#a31515" size=2>"Enter names and values here"</font><font size=2>)]</font><font size=2>
</font><font color="#0000ff" size=2>public</font><font size=2> </font><font color="#2b91af" size=2>Dictionary</font><font size=2><</font><font color="#0000ff" size=2>string</font><font size=2>, </font><font color="#0000ff" size=2>int</font><font size=2>> Registers
{
</font><font color="#0000ff" size=2>get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> modbusRegisters;}
</font><font color="#0000ff" size=2>set</font><font size=2> { modbusRegisters = </font><font color="#0000ff" size=2>value</font><font size=2>; }
}
 
<p align=left> 
<p align=left>Thanks</font>

View the full article
 
Back
Top