Hello,gile.My lines in the Line<Line> are all defined with "new Line()".They are not selected form any drawings.This is my circumstances:
... //Other code
Line myLine = new Line(ptStart,ptEnd);
LineLst.Add(myLine);
... //more other code
/*I have define lots of Lines in this way,and add all of them to the LineLst.
But I didn't add them to any Database.
Now I want to remove the lines from the list one by one until the LineLst is empty.
So,I should dispose them.*/
while(LineLst.Count() > 0)
{
Line fristLine = LineLst.First(); //Obtain the first line.
LineLst.Remove(firstLine); //Remove it form the List, so the loop can stop when the List is empty
...//Some other useful code
//At the end,the loop line need to be disposed
firstLine.Dispose();
}
I didn't add them to a Database.So, is my way right?
Or,should I just ues the code below:
LineLst.First().Dispose();