I am in an environment that contains a RollingWindow
class where RollingWindow<T>
can be a collection of any type/object.
I would like to create a C# method to convert a RollingWindow<T>
into a List<T>
.
Essentially I'd use it in the following manner:
List<int> intList = new List<int>();
List<Record> = recordList = new List<Record>();
RollingWindow<int> intWindow = new RollingWindow<int>(20); //20 elements long
RollingWindow<Record> = recordWindow = new RollingWindow<Record>(10); //10 elements long
ConvertWindowToList(intList, intWindow); // will populate intList with 20 elements in intWindow
ConvertWindowToList(intList, intWindow); // will populate recordList with 10 elements in recordWindow
Any thoughts on how I would do this in c#?