I'm working to create a base framework for our organization for web and client-side
applications. The framework interfaces with several of our systems and provides
the business and data layer connectivity for basic operations and such.
I've ran into a snag that I just can't think myself out of.
Here's an example:
I have an object for a Student called StudentRecord. It has properties such
as name, grade, identification number, etc.
public class StudentRecord : IComparable
{
private int _studentId;
public int StudentId { get { return _studentId; } set { _studentId = value;
} }
public override string ToString() { get { return string.Format("{0} {1}",
_firstName, _lastName); }
... etc.
}
From there, I have a "roster" of students, thus a collection of those StudentRecord
objects. I would like to inherit from List<StudentRecordto provide Find,
FindAll, Sort, and other functionality to the consumer of the API. (1)*
public class StudentRoster : List<StudentRecord>
{
// I'm not providing any additional functionality here at this time,
// simply providing the easier call rather than requring them to know List<object>.
}
Now, roster.Find works just fine because, I'm assuming, the list is based
off StudentRecord.
StudentRecord studentA = roster.Find(delegate(StudentRecord x) { return x.LastName.Equals("Longnecker");
});
This returns me a populated student object based off a prior created collection
of student Objects.
I run into an issue with:
StudentRoster studentsInGrade8 = roster.FindAll(delegate (StudentRecord x)
{ return x.Grade.Equals("08"); } );
FindAll apparently returns a raw list of List<StudentRecordrather than
StudentRoster (since I haven't specified it). I've attempted to modify my
StudentRoster class to add:
public StudentRoster FindAll(Predicate<StudentRecorditem)
{
StudentRoster items = (StudentRoster) Items;
return items.FindAll(match);
}
However, that fails with the same error--it cannot convert List<StudentRecord>
to StudentRoster. I've attempted to cast it explicitly (using 'as StudentRoster'
and (StudentRoster)) to no avail.
Google hasn't turned up anything thus far and neither has MSDN (though I'm
assuming, perhaps, I'm not searching for the magical word)... What would
be the best way to create "collections of objects" that can be searched through
using Find at the public API level?
(1)* == Note that CLS does specify not to expose List<T>; however, Collection<T>
doesn't have Find, Sort, FindAll, etc. Is there a better option?
Any reference material, etc. would be greatly appreciated!
Thanks in advance.
-dl
---
David R. Longnecker
Web Developer http://blog.tiredstudent.com 5 3811
David,
You are going to have to do an explicit copy here.
Assuming you don't want to hide the FindAll method (I recommend against
it), and that you expose the constructor for your StudentRoster which takes
an IEnumerable<StudentRecord>, you can do this:
StudentRoster studentsInGrade8 = new StudentRoster(roster.FindAll(delegate
(StudentRecord x) { return x.Grade.Equals("08"); } ));
This way, the List<StudentRecordfeeds the construction of the new
StudentRoster instance.
If you really want to return a StudentRoster instance, then I would
recommend creating a static FindAll method which will take the
IList<StudentRecordimplementation and then perform the conversion to a
StudentRoster instance yourself.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"David Longnecker" <dl*********@community.nospamwrote in message
news:46************************@msnews.microsoft.c om...
I'm working to create a base framework for our organization for web and
client-side applications. The framework interfaces with several of our
systems and provides the business and data layer connectivity for basic
operations and such.
I've ran into a snag that I just can't think myself out of.
Here's an example:
I have an object for a Student called StudentRecord. It has properties
such as name, grade, identification number, etc.
public class StudentRecord : IComparable
{
private int _studentId;
public int StudentId { get { return _studentId; } set { _studentId =
value; } }
public override string ToString() { get { return string.Format("{0} {1}",
_firstName, _lastName); }
... etc.
}
From there, I have a "roster" of students, thus a collection of those
StudentRecord objects. I would like to inherit from List<StudentRecord>
to provide Find, FindAll, Sort, and other functionality to the consumer of
the API. (1)*
public class StudentRoster : List<StudentRecord>
{
// I'm not providing any additional functionality here at this time,
// simply providing the easier call rather than requring them to know
List<object>.
}
Now, roster.Find works just fine because, I'm assuming, the list is based
off StudentRecord.
StudentRecord studentA = roster.Find(delegate(StudentRecord x) { return
x.LastName.Equals("Longnecker"); });
This returns me a populated student object based off a prior created
collection of student Objects.
I run into an issue with:
StudentRoster studentsInGrade8 = roster.FindAll(delegate (StudentRecord x)
{ return x.Grade.Equals("08"); } );
FindAll apparently returns a raw list of List<StudentRecordrather than
StudentRoster (since I haven't specified it). I've attempted to modify my
StudentRoster class to add:
public StudentRoster FindAll(Predicate<StudentRecorditem)
{
StudentRoster items = (StudentRoster) Items;
return items.FindAll(match);
}
However, that fails with the same error--it cannot convert
List<StudentRecordto StudentRoster. I've attempted to cast it
explicitly (using 'as StudentRoster' and (StudentRoster)) to no avail.
Google hasn't turned up anything thus far and neither has MSDN (though I'm
assuming, perhaps, I'm not searching for the magical word)... What would
be the best way to create "collections of objects" that can be searched
through using Find at the public API level?
(1)* == Note that CLS does specify not to expose List<T>; however,
Collection<Tdoesn't have Find, Sort, FindAll, etc. Is there a better
option?
Any reference material, etc. would be greatly appreciated!
Thanks in advance.
-dl
---
David R. Longnecker
Web Developer http://blog.tiredstudent.com
Okay, wow, it hadn't even occured to me that the reference was just sorta
trying to override itself rather than create a new one--I've been staring
at this for too long today. Thanks.
So, I added two lines to my StudentRoster class. One, the IEnumerable for
creating new, and the empty one:
public class StudentRoster : List<StudentRecord>, IEnumerable
{
public StudentRoster(IEnumerable<StudentRecordrecord) : base (new
List<StudentRecord>(record)) { }
public StudentRoster() : base(new List<StudentRecord>()) { }
}
Then, as you said, the new roster works:
StudentRoster studentsInGrade9 = new StudentRoster(roster.FindAll(delegate(StudentRecor d
x) { return x.Grade.Equals("09"); }));
Console.WriteLine("There are {0} students in the ninth grade.", studentsInGrade9.Count);
The follow up I have to that is that I'm not sure how to please both keepers,
so to speak. I'm wanting to propagate down the .Find, .FindAll, and .Sort
(for example) methods, but CLS (ala FxCop) is complaining that:
"Change %OBJECT% to use Collection<T>, ReadOnlyCollection<T>
or KeyedCollection<K,V>"
Of course, Collection doesn’t have the methods of List. Is there a benefit
to this beyond 100% compliance? If so, is it documented out there ‘best
practices’ of how to create “collections that act like lists”?
Thanks!
-dl
---
David R. Longnecker
Web Developer http://blog.tiredstudent.com
David,
You are going to have to do an explicit copy here.
Assuming you don't want to hide the FindAll method (I recommend
against it), and that you expose the constructor for your
StudentRoster which takes an IEnumerable<StudentRecord>, you can do
this:
StudentRoster studentsInGrade8 = new
StudentRoster(roster.FindAll(delegate (StudentRecord x) { return
x.Grade.Equals("08"); } ));
This way, the List<StudentRecordfeeds the construction of the
new StudentRoster instance.
If you really want to return a StudentRoster instance, then I
would recommend creating a static FindAll method which will take the
IList<StudentRecordimplementation and then perform the conversion to
a StudentRoster instance yourself.
Hope this helps.
"David Longnecker" <dl*********@community.nospamwrote in message
news:46************************@msnews.microsoft.c om...
>I'm working to create a base framework for our organization for web and client-side applications. The framework interfaces with several of our systems and provides the business and data layer connectivity for basic operations and such.
I've ran into a snag that I just can't think myself out of.
Here's an example:
I have an object for a Student called StudentRecord. It has properties such as name, grade, identification number, etc.
public class StudentRecord : IComparable { private int _studentId; public int StudentId { get { return _studentId; } set { _studentId = value; } } public override string ToString() { get { return string.Format("{0} {1}", _firstName, _lastName); } ... etc.
}
From there, I have a "roster" of students, thus a collection of those StudentRecord objects. I would like to inherit from List<StudentRecordto provide Find, FindAll, Sort, and other functionality to the consumer of the API. (1)*
public class StudentRoster : List<StudentRecord> { // I'm not providing any additional functionality here at this time, // simply providing the easier call rather than requring them to know List<object>. } Now, roster.Find works just fine because, I'm assuming, the list is based off StudentRecord.
StudentRecord studentA = roster.Find(delegate(StudentRecord x) { return x.LastName.Equals("Longnecker"); });
This returns me a populated student object based off a prior created collection of student Objects.
I run into an issue with:
StudentRoster studentsInGrade8 = roster.FindAll(delegate (StudentRecord x) { return x.Grade.Equals("08"); } );
FindAll apparently returns a raw list of List<StudentRecordrather than StudentRoster (since I haven't specified it). I've attempted to modify my StudentRoster class to add:
public StudentRoster FindAll(Predicate<StudentRecorditem) {
StudentRoster items = (StudentRoster) Items; return items.FindAll(match); }
However, that fails with the same error--it cannot convert List<StudentRecordto StudentRoster. I've attempted to cast it explicitly (using 'as StudentRoster' and (StudentRoster)) to no avail.
Google hasn't turned up anything thus far and neither has MSDN (though I'm assuming, perhaps, I'm not searching for the magical word)... What would be the best way to create "collections of objects" that can be searched through using Find at the public API level?
(1)* == Note that CLS does specify not to expose List<T>; however, Collection<Tdoesn't have Find, Sort, FindAll, etc. Is there a better option?
Any reference material, etc. would be greatly appreciated!
Thanks in advance.
-dl
--- David R. Longnecker Web Developer http://blog.tiredstudent.com
David,
You don't have to add the IEnumerable interface declaration, List<T>
already does that for you.
Your class should look something like this:
public class StudentRoster : List<StudentRecord>
{
public StudentRoster(IEnumerable<StudentRecordcollection) :
base(collection)
{ }
public StudentRoster() : base()
{ }
}
There is no need for you to create a new list to pass to the base
constructor, since it is looking for an IEnumerable<T(where T is
StudentRecord in this case) as well, you can just pass it directly.
And you also don't need to create a new instance and chain the
constructor for the default parameterless constructor, since you can just
call the base constructor of List<T>.
In order to please both keepers, you would have to derive from
Collection<Tlike FxCop says. Of course, like you mention, it doesn't have
all the methods of List<T>, and you would have to implement those yourself.
You could try and create an explicit and implicit casting operator from
IEnumerable<StudentRecordto StudentRoster, and that might get you a little
further, but personally, I find that feeding the constructor of a new
StudentRoster instance works fine for me. I can see what is happening, and
I'm not polluting the type (List<T>, from which you derive) so to speak.
This brings up an interesting point. If you are not adding any
significant functionality to List<StudentRecordin the StudentRoster class,
then you really shouldn't be deriving from it. You aren't gaining anything
but a different name, and are gaining a headache in the process.
List<StudentRosterseems to work just fine here (unless there is more to
the class than you are exposing here).
Another side note, LINQ is going to make all of this moot, since you
would be able to just do:
// Get the count of students in the 9th grade. I'm using your call to
Equals since I don't know what type the Grade property
// returns. If it was a string, I'd just use ==.
int count = (from student in roster where
student.Grade.Equals("09")).Count();
Once that happens, methods on collection types for searching, ordering,
etc, etc, are going to become pretty useless.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"David Longnecker" <dl*********@community.nospamwrote in message
news:46************************@msnews.microsoft.c om...
Okay, wow, it hadn't even occured to me that the reference was just sorta
trying to override itself rather than create a new one--I've been staring
at this for too long today. Thanks.
So, I added two lines to my StudentRoster class. One, the IEnumerable for
creating new, and the empty one:
public class StudentRoster : List<StudentRecord>, IEnumerable
{
public StudentRoster(IEnumerable<StudentRecordrecord) : base (new
List<StudentRecord>(record)) { }
public StudentRoster() : base(new List<StudentRecord>()) { }
}
Then, as you said, the new roster works:
StudentRoster studentsInGrade9 = new
StudentRoster(roster.FindAll(delegate(StudentRecor d x) { return
x.Grade.Equals("09"); }));
Console.WriteLine("There are {0} students in the ninth grade.",
studentsInGrade9.Count);
The follow up I have to that is that I'm not sure how to please both
keepers, so to speak. I'm wanting to propagate down the .Find, .FindAll,
and .Sort (for example) methods, but CLS (ala FxCop) is complaining that:
"Change %OBJECT% to use Collection<T>, ReadOnlyCollection<Tor
KeyedCollection<K,V>"
Of course, Collection doesn't have the methods of List. Is there a
benefit to this beyond 100% compliance? If so, is it documented out there
'best practices' of how to create "collections that act like lists"?
Thanks!
-dl
---
David R. Longnecker
Web Developer http://blog.tiredstudent.com
>David,
You are going to have to do an explicit copy here.
Assuming you don't want to hide the FindAll method (I recommend against it), and that you expose the constructor for your StudentRoster which takes an IEnumerable<StudentRecord>, you can do this:
StudentRoster studentsInGrade8 = new StudentRoster(roster.FindAll(delegate (StudentRecord x) { return x.Grade.Equals("08"); } ));
This way, the List<StudentRecordfeeds the construction of the new StudentRoster instance.
If you really want to return a StudentRoster instance, then I would recommend creating a static FindAll method which will take the IList<StudentRecordimplementation and then perform the conversion to a StudentRoster instance yourself.
Hope this helps.
"David Longnecker" <dl*********@community.nospamwrote in message news:46************************@msnews.microsoft. com...
>>I'm working to create a base framework for our organization for web and client-side applications. The framework interfaces with several of our systems and provides the business and data layer connectivity for basic operations and such.
I've ran into a snag that I just can't think myself out of.
Here's an example:
I have an object for a Student called StudentRecord. It has properties such as name, grade, identification number, etc.
public class StudentRecord : IComparable { private int _studentId; public int StudentId { get { return _studentId; } set { _studentId = value; } } public override string ToString() { get { return string.Format("{0} {1}", _firstName, _lastName); } ... etc.
}
From there, I have a "roster" of students, thus a collection of those StudentRecord objects. I would like to inherit from List<StudentRecordto provide Find, FindAll, Sort, and other functionality to the consumer of the API. (1)*
public class StudentRoster : List<StudentRecord> { // I'm not providing any additional functionality here at this time, // simply providing the easier call rather than requring them to know List<object>. } Now, roster.Find works just fine because, I'm assuming, the list is based off StudentRecord.
StudentRecord studentA = roster.Find(delegate(StudentRecord x) { return x.LastName.Equals("Longnecker"); });
This returns me a populated student object based off a prior created collection of student Objects.
I run into an issue with:
StudentRoster studentsInGrade8 = roster.FindAll(delegate (StudentRecord x) { return x.Grade.Equals("08"); } );
FindAll apparently returns a raw list of List<StudentRecordrather than StudentRoster (since I haven't specified it). I've attempted to modify my StudentRoster class to add:
public StudentRoster FindAll(Predicate<StudentRecorditem) {
StudentRoster items = (StudentRoster) Items; return items.FindAll(match); }
However, that fails with the same error--it cannot convert List<StudentRecordto StudentRoster. I've attempted to cast it explicitly (using 'as StudentRoster' and (StudentRoster)) to no avail.
Google hasn't turned up anything thus far and neither has MSDN (though I'm assuming, perhaps, I'm not searching for the magical word)... What would be the best way to create "collections of objects" that can be searched through using Find at the public API level?
(1)* == Note that CLS does specify not to expose List<T>; however, Collection<Tdoesn't have Find, Sort, FindAll, etc. Is there a better option?
Any reference material, etc. would be greatly appreciated!
Thanks in advance.
-dl
--- David R. Longnecker Web Developer http://blog.tiredstudent.com
On May 2, 2:24 pm, "Nicholas Paldino [.NET/C# MVP]" wrote:
<snip>
Another side note, LINQ is going to make all of this moot, since you
would be able to just do:
// Get the count of students in the 9th grade. I'm using your call to
Equals since I don't know what type the Grade property
// returns. If it was a string, I'd just use ==.
int count = (from student in roster where
student.Grade.Equals("09")).Count();
Once that happens, methods on collection types for searching, ordering,
etc, etc, are going to become pretty useless.
I disagree. While LINQ has massive benefits in complex cases, just
using the extension methods (and existing methods) directly is
simpler. For instance, your query could be written equally effectively
as:
int count = roster.Count (student =student.Grade.Equals("09"));
Personally I'll save the compiler conversion stuff for more
complicated cases.
Jon
Thanks for the information on IEnumerable and cutting that down a bit.
***
This brings up an interesting point. If you are not adding any
significant functionality to List<StudentRecordin the StudentRoster
class, then you really shouldn't be deriving from it. You aren't
gaining anything but a different name, and are gaining a headache in
the process. List<StudentRosterseems to work just fine here (unless
there is more to the class than you are exposing here).
***
You are correct; at this time, the derived class simply recreates List<StudentRecord>
with a more 'friendly' name of StudentRoster. I anticipate extending it
in the future, however, and didn't want to force any dependent applications
to have to change... I'd rather work out the issues now than later and still
require the consumers of the class to change their calls.
***
Another side note, LINQ is going to make all of this moot, since you would
be able to just do:
***
Agreed 100%; I wish the day was closer. As Jon S. points out (further down
the convo), I've dinked around with the lambda expressions on a copy of the
project in Orcas and it's more intuitive, or seem so, than the anonymous
methods.
Thanks for all your help and explainations; I don't feel my eyes crossing
(quite as bad) anymore. ;)
-dl
---
David R. Longnecker
Web Developer http://blog.tiredstudent.com
David,
You don't have to add the IEnumerable interface declaration,
List<Talready does that for you.
Your class should look something like this:
public class StudentRoster : List<StudentRecord>
{
public StudentRoster(IEnumerable<StudentRecordcollection) :
base(collection)
{ }
public StudentRoster() : base()
{ }
}
There is no need for you to create a new list to pass to the base
constructor, since it is looking for an IEnumerable<T(where T is
StudentRecord in this case) as well, you can just pass it directly.
And you also don't need to create a new instance and chain the
constructor for the default parameterless constructor, since you can
just call the base constructor of List<T>.
In order to please both keepers, you would have to derive from
Collection<Tlike FxCop says. Of course, like you mention, it
doesn't have all the methods of List<T>, and you would have to
implement those yourself.
You could try and create an explicit and implicit casting operator
from IEnumerable<StudentRecordto StudentRoster, and that might get
you a little further, but personally, I find that feeding the
constructor of a new StudentRoster instance works fine for me. I can
see what is happening, and I'm not polluting the type (List<T>, from
which you derive) so to speak.
This brings up an interesting point. If you are not adding any
significant functionality to List<StudentRecordin the StudentRoster
class, then you really shouldn't be deriving from it. You aren't
gaining anything but a different name, and are gaining a headache in
the process. List<StudentRosterseems to work just fine here (unless
there is more to the class than you are exposing here).
Another side note, LINQ is going to make all of this moot, since
you would be able to just do:
// Get the count of students in the 9th grade. I'm using your call to
Equals since I don't know what type the Grade property
// returns. If it was a string, I'd just use ==.
int count = (from student in roster where
student.Grade.Equals("09")).Count();
Once that happens, methods on collection types for searching,
ordering, etc, etc, are going to become pretty useless.
"David Longnecker" <dl*********@community.nospamwrote in message
news:46************************@msnews.microsoft.c om...
>Okay, wow, it hadn't even occured to me that the reference was just sorta trying to override itself rather than create a new one--I've been staring at this for too long today. Thanks.
So, I added two lines to my StudentRoster class. One, the IEnumerable for creating new, and the empty one:
public class StudentRoster : List<StudentRecord>, IEnumerable { public StudentRoster(IEnumerable<StudentRecordrecord) : base (new List<StudentRecord>(record)) { } public StudentRoster() : base(new List<StudentRecord>()) { } }
Then, as you said, the new roster works:
StudentRoster studentsInGrade9 = new StudentRoster(roster.FindAll(delegate(StudentReco rd x) { return x.Grade.Equals("09"); })); Console.WriteLine("There are {0} students in the ninth grade.", studentsInGrade9.Count); The follow up I have to that is that I'm not sure how to please both keepers, so to speak. I'm wanting to propagate down the .Find, .FindAll, and .Sort (for example) methods, but CLS (ala FxCop) is complaining that:
"Change %OBJECT% to use Collection<T>, ReadOnlyCollection<Tor KeyedCollection<K,V>"
Of course, Collection doesn't have the methods of List. Is there a benefit to this beyond 100% compliance? If so, is it documented out there 'best practices' of how to create "collections that act like lists"?
Thanks!
-dl --- David R. Longnecker Web Developer http://blog.tiredstudent.com
>>David,
You are going to have to do an explicit copy here.
Assuming you don't want to hide the FindAll method (I recommend against it), and that you expose the constructor for your StudentRoster which takes an IEnumerable<StudentRecord>, you can do this:
StudentRoster studentsInGrade8 = new StudentRoster(roster.FindAll(delegate (StudentRecord x) { return x.Grade.Equals("08"); } ));
This way, the List<StudentRecordfeeds the construction of the new StudentRoster instance.
If you really want to return a StudentRoster instance, then I would recommend creating a static FindAll method which will take the IList<StudentRecordimplementation and then perform the conversion to a StudentRoster instance yourself. Hope this helps.
"David Longnecker" <dl*********@community.nospamwrote in message news:46************************@msnews.microsoft .com...
I'm working to create a base framework for our organization for web and client-side applications. The framework interfaces with several of our systems and provides the business and data layer connectivity for basic operations and such.
I've ran into a snag that I just can't think myself out of.
Here's an example:
I have an object for a Student called StudentRecord. It has properties such as name, grade, identification number, etc.
public class StudentRecord : IComparable { private int _studentId; public int StudentId { get { return _studentId; } set { _studentId = value; } } public override string ToString() { get { return string.Format("{0} {1}", _firstName, _lastName); } ... etc. }
From there, I have a "roster" of students, thus a collection of those StudentRecord objects. I would like to inherit from List<StudentRecordto provide Find, FindAll, Sort, and other functionality to the consumer of the API. (1)*
public class StudentRoster : List<StudentRecord> { // I'm not providing any additional functionality here at this time, // simply providing the easier call rather than requring them to know List<object>. } Now, roster.Find works just fine because, I'm assuming, the list is based off StudentRecord. StudentRecord studentA = roster.Find(delegate(StudentRecord x) { return x.LastName.Equals("Longnecker"); });
This returns me a populated student object based off a prior created collection of student Objects.
I run into an issue with:
StudentRoster studentsInGrade8 = roster.FindAll(delegate (StudentRecord x) { return x.Grade.Equals("08"); } );
FindAll apparently returns a raw list of List<StudentRecordrather than StudentRoster (since I haven't specified it). I've attempted to modify my StudentRoster class to add:
public StudentRoster FindAll(Predicate<StudentRecorditem) {
StudentRoster items = (StudentRoster) Items; return items.FindAll(match); } However, that fails with the same error--it cannot convert List<StudentRecordto StudentRoster. I've attempted to cast it explicitly (using 'as StudentRoster' and (StudentRoster)) to no avail.
Google hasn't turned up anything thus far and neither has MSDN (though I'm assuming, perhaps, I'm not searching for the magical word)... What would be the best way to create "collections of objects" that can be searched through using Find at the public API level?
(1)* == Note that CLS does specify not to expose List<T>; however, Collection<Tdoesn't have Find, Sort, FindAll, etc. Is there a better option?
Any reference material, etc. would be greatly appreciated!
Thanks in advance.
-dl
--- David R. Longnecker Web Developer http://blog.tiredstudent.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: matty.hall |
last post by:
I have two classes: a base class (BaseClass) and a class deriving from
it (DerivedClass). I have a List<DerivedClass> that for various
reasons needs to be of that type, and not a List<BaseClass>....
|
by: PJ |
last post by:
I have a class definition :
public class PagingList<T> : List<T>
{
private int pageSize, pageNumber;
public PagingList()
{
pageSize = (this.Count == 0) ? 1 : this.Count;...
|
by: Varangian |
last post by:
Hello, there
I have a problem with regards to System.Collections.Generic.List<T>
I need to pass a class with implements an interface - TestClass :
IPerson
I put this class in a...
|
by: Paul |
last post by:
Hi,
I feel I'm going around circles on this one and would appreciate some other
points of view.
From a design / encapsulation point of view, what's the best practise for
returning a private...
|
by: =?Utf-8?B?TGFycnlS?= |
last post by:
I need some help with a multilevel sorting problem with the List<>.
I have a List<ItemToSort( see below ) that needs to be sorted in the
following manner:
Sort by Level1Id ( ok that was the easy...
|
by: Iron Moped |
last post by:
I'm airing frustration here, but why does LinkedList<not support the
same sort and search methods as List<>? I want a container that does not
support random access, allows forward and reverse...
|
by: Andrew Robinson |
last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v>
depending on input parameters and options to the method.
1. Is there any way to convert from a dictionary to a list...
|
by: Zytan |
last post by:
The docs for List say "The List class is the generic equivalent of the
ArrayList class." Since List<is strongly typed, and ArrayList has
no type (is that called weakly typed?), I would assume...
|
by: Zytan |
last post by:
This returns the following error:
"Cannot modify the return value of
'System.Collections.Generic.List<MyStruct>.this' because it is
not a variable"
and I have no idea why! Do lists return copies...
|
by: Fred Mellender |
last post by:
I am trying to use reflection to output the fields (names and values) of an
arbitrary object -- an object dump to a TreeView.
It works pretty well, but I am having trouble with generic lists,...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| | |