Hi all,
been searching for a while now, but could not find anything useful.
But since I'm new to .NET and C# maybe I just could not identify if
something was a solution for my problem...
I'm writing a small component which uses a list of name/value pairs.
But I have no idea how to implement this so that the list of strings
is exposed as a single property and can be edited at design time
like the Textbox.Lines property. Can anyone help?
Frank
Gabriel Lozano-Morán - 20 Nov 2005 19:19 GMT
With name/value pairs you mean a hashtable?
Gabriel
frank.kintrup@gmx.de - 20 Nov 2005 20:54 GMT
> With name/value pairs you mean a hashtable?
Well, not really. Internally it's just a bunch of strings like
"name=value" which are
passed to a legacy DLL via P/Invoke. Though accessing them in .NET with
a hash
interface like 'class.property["name"] = value' would be an
advantage...
Frank
InK_ - 21 Nov 2005 07:43 GMT
Hi!
I guessyou should set attribute your property as follows:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
Localizable(true), Description("Gets the collection of items displayed by
the current combo box editor."),
Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design",
typeof(UITypeEditor))]
public virtual StringCollection Items
{
get
{
return this._items;
}
}
As a result StringCollectionEditor will appear to edit your property.
Regards,
Inna Stetsyak aka InK_
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Frank