Can we modify properties of object which is in Queue - C#?
-
22-07-2019 - |
Question
I have used System.Collections.Queue and its object form_elements_queue
if (form_elements_queue.Count > 0)
queue_element = (RecordQueue)form_elements_queue.Peek();
I'm modifying the queue_element like below,
queue_element.Children--;
RecordQueue is my custom Type which I Enqueue in form_elements_queue.
but its not referencing the Original Queue. How can I reference the queue_element to the original object which is in the queue.
Solution
Is RecordQueue
a struct or a class? If it's a class, it should be fine.
How are you checking whether the original queue has been modified?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow