1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
using System;
using System.Collections.Generic;
namespace WinPropertyGridString
{
public class X
{
private List<Tag> tags = new List<Tag>();
public Tag[] Tags
{
get { return tags.ToArray(); }
set
{
if (value != null)
{
tags.Clear();
tags.AddRange(value);
};
}
}
public X()
{
this.tags.AddRange(
new Tag[]{
new Tag("item1",rndPrice ), new Tag("item2",rndPrice ), new Tag("item3",rndPrice )}
);
}
private Random rnd = new Random();
private double rndPrice
{
get { return rnd.Next(100, 500); }
}
}
} |
Partager