0
這可能太簡單了。請幫助。LinQ收集一個基本問題
List<Line> listLines = new List<Line>();
foreach (Point p in currentPointsLines)
{
Line l = new Line();
l.Tag = p;
l.X1 = AnotherList[(int)p.X].CenterX; //AnotherList is of type Rectangle
l.Y1 = AnotherList[(int)p.X].CenterY;
l.X2 = AnotherList[(int)p.Y].CenterX;
l.Y2 = AnotherList[(int)p.Y].CenterY;
listLines.Add(l);
}
現在我想查詢該listLines收集得到具有Tag屬性= 1
如何將l.Tag轉換爲點在這個非常相同的行:-) – 2010-09-09 09:25:13
@Tintu:編輯。這只是一個表演,就好像它發生在其他地方一樣。 – 2010-09-09 09:28:12
謝謝Skeet.Guess,這將解決我的問題。 – 2010-09-09 09:29:55