¡@

Home 

c# Programming Glossary: iterating

Editing dictionary values in a foreach loop

http://stackoverflow.com/questions/1070766/editing-dictionary-values-in-a-foreach-loop

you can not add or remove items from a dictionary while iterating over them. However I don't understand why you can't simply change.. of changes which you'll apply after you've finished iterating. For example Copying keys first List string keys new List string..

LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value

http://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret

at the implementation there but basically it's a case of iterating through the data remembering the maximum element we've seen..

Performance difference for control structures 'for' and 'foreach' in C#

http://stackoverflow.com/questions/1124753/performance-difference-for-control-structures-for-and-foreach-in-c-sharp

condition EDIT For those of you who are claiming that iterating over a List T with foreach produces the same code as the for..

ILookup<TKey, TVal> vs. IGrouping<TKey, TVal>

http://stackoverflow.com/questions/1337539/ilookuptkey-tval-vs-igroupingtkey-tval

TVal is a sequence of those similar to what you get when iterating over an IDictionary TKey TVal An ILookup TKey TVal is more like..

Deciding on when to use XmlDocument vs XmlReader

http://stackoverflow.com/questions/1505075/deciding-on-when-to-use-xmldocument-vs-xmlreader

processing involved in XmlReader read calls when I'm iterating over child nodes. So I say all that to ask this What are the..

How to remove elements from a generic list while iterating over it?

http://stackoverflow.com/questions/1582285/how-to-remove-elements-from-a-generic-list-while-iterating-over-it

to remove elements from a generic list while iterating over it I am looking for a better 'pattern' for working with..

How does foreach work when looping through function results?

http://stackoverflow.com/questions/1632810/how-does-foreach-work-when-looping-through-function-results

code you really want the file to be closed when you finish iterating and the compiler implements IDisposable cunningly to make that..

Remove Item in Dictionary based on Value

http://stackoverflow.com/questions/1636885/remove-item-in-dictionary-based-on-value

not made the loop will be modifying the collection it is iterating over causing an exception to be thrown on the next attempt to..

Random.Next returns always the same values

http://stackoverflow.com/questions/1654887/random-next-returns-always-the-same-values

see why this is happening. In the foreach cycle I am iterating through a class A collection and for each class I call the Count..

Tips for optimizing C#/.NET programs [closed]

http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs

as you find them through careful debugging analysis keep iterating until you ship or fail. Performance is a feature. Performance..

How to modify or delete items from an enumerable collection while iterating through it in C#

http://stackoverflow.com/questions/308466/how-to-modify-or-delete-items-from-an-enumerable-collection-while-iterating-thro

modify or delete items from an enumerable collection while iterating through it in C# I have to delete some rows from a data table... I've heard that it is not ok to change a collection while iterating through it. So instead of a for loop in which I check if a row..

In .NET, which loop runs faster, 'for' or 'foreach'?

http://stackoverflow.com/questions/365615/in-net-which-loop-runs-faster-for-or-foreach

same. For example just an example of how it should be for iterating an array of 1000 strings for is better than foreach for iterating.. an array of 1000 strings for is better than foreach for iterating over IList non generic strings foreach is better than for A..

c# (WinForms-App) export DataSet to Excel

http://stackoverflow.com/questions/373925/c-sharp-winforms-app-export-dataset-to-excel

change it a bit to make it use your DataSet instead iterating through the DataTables in it . It also does some basic formatting..

How do you get the index of the current iteration of a foreach loop?

http://stackoverflow.com/questions/43021/how-do-you-get-the-index-of-the-current-iteration-of-a-foreach-loop

foreach share improve this question The foreach is for iterating over collections that implement IEnumerable . It does this by..

How to distinguish between multiple input devices in C#

http://stackoverflow.com/questions/587840/how-to-distinguish-between-multiple-input-devices-in-c-sharp

know if this is causing the scanning not to work. When iterating over the deviceNames here is the list of devices I found using..

Why is LINQ .Where(predicate).First() faster than .First(predicate)?

http://stackoverflow.com/questions/8663897/why-is-linq-wherepredicate-first-faster-than-firstpredicate

the first expression would be faster because it can stop iterating over the list as soon as the predicate is satisfied whereas..

Can I get more than 1000 records from a DirectorySearcher in Asp.Net?

http://stackoverflow.com/questions/90652/can-i-get-more-than-1000-records-from-a-directorysearcher-in-asp-net

but will require more frequent calls to the server when iterating over a large number of results. by default the search isn't..

What are the pros and cons of writing C#/Xaml vs. C++/Xaml WinRT applications in Windows8? [closed]

http://stackoverflow.com/questions/10031929/what-are-the-pros-and-cons-of-writing-c-xaml-vs-c-xaml-winrt-applications-in

applications eg reflection based tools such as DI IoC . Iterating application code may be easier via .NET as .NET compiles quicker..

Iterating through the Alphabet - C# a-caz

http://stackoverflow.com/questions/1011732/iterating-through-the-alphabet-c-sharp-a-caz

through the Alphabet C# a caz Hi i have question about iterate..

Generating permutations of a set (most efficiently)

http://stackoverflow.com/questions/11208446/generating-permutations-of-a-set-most-efficiently

thing is that I'm not happy with the speed of the code. Iterating over all permutations of an array of size 11 takes about 4 seconds...

Iterating through all nodes in XML file

http://stackoverflow.com/questions/2915294/iterating-through-all-nodes-in-xml-file

through all nodes in XML file I want to iterate through all..

C# Iterating through an enum? (Indexing a System.Array)

http://stackoverflow.com/questions/482729/c-sharp-iterating-through-an-enum-indexing-a-system-array

Iterating through an enum Indexing a System.Array I have the following..

Distinction between iterator and enumerator

http://stackoverflow.com/questions/716238/distinction-between-iterator-and-enumerator

generator functions share improve this question Iterating means repeating some steps while enumerating means going through..

Get installed applications in a system

http://stackoverflow.com/questions/908850/get-installed-applications-in-a-system

.net installer installation share improve this question Iterating through the registry key SOFTWARE Microsoft Windows CurrentVersion..

Sorted Dictionary in C#

http://stackoverflow.com/questions/931891/sorted-dictionary-in-c-sharp

you won't have to change the rest of your code. Edit Iterating on SortedLists You just access the elements by index var Rand..