のセットをループすることに問題がありXElements
ます。動作は私が期待したものではありません。
私のコードの短い書き直されたバージョンなので、私の問題を簡単に得ることができます(C#のコンソールアプリ)
IEnumerable<XElement> q = from c in xml.Descendants(aw + "wd")
where (....)
select c;
...
//--------------------------------------------------------------------
IEnumerable<XElement> currRow = q.OrderBy(yyy => (int)yyy.Attribute("t"));
int xValue = 10;
currRow = currRow.Where(yyy => (int)yyy.Attribute("t") < xValue);
xValue = 20;
//Here, the currRow gets a new value automatically. I don't want this!
//--------------------------------------------------------------------
//This is want i want to acheive:
IEnumerable<XElement> currRow = q.OrderBy(yyy => (int)yyy.Attribute("t"));
int xValue = 10;
currRow = currRow.Where(yyy => (int)yyy.Attribute("t") < xValue);
//do somthing with currRow
xValue = 20;
currRow = currRow.Where(yyy => (int)yyy.Attribute("t") < xValue);
//do somthing else with currRow
xValue = 30;
currRow = currRow.Where(yyy => (int)yyy.Attribute("t") < xValue);
// etc....
何か案は?