Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
AnswerRe: DoEvents() and System.Threading.Timer Pin
Luc Pattyn7-Sep-10 14:20
sitebuilderLuc Pattyn7-Sep-10 14:20 
GeneralRe: DoEvents() and System.Threading.Timer Pin
Keith Vitali8-Sep-10 0:34
Keith Vitali8-Sep-10 0:34 
GeneralRe: DoEvents() and System.Threading.Timer Pin
Luc Pattyn8-Sep-10 0:45
sitebuilderLuc Pattyn8-Sep-10 0:45 
QuestionWould like a blank string as default vaule for a combo box that is bound Pin
BraveKnightFSJ7-Sep-10 9:44
BraveKnightFSJ7-Sep-10 9:44 
AnswerRe: Would like a blank string as default vaule for a combo box that is bound Pin
Pete O'Hanlon7-Sep-10 12:23
mvePete O'Hanlon7-Sep-10 12:23 
GeneralRe: Would like a blank string as default vaule for a combo box that is bound Pin
BraveKnightFSJ7-Sep-10 12:41
BraveKnightFSJ7-Sep-10 12:41 
GeneralRe: Would like a blank string as default vaule for a combo box that is bound Pin
Pete O'Hanlon7-Sep-10 12:45
mvePete O'Hanlon7-Sep-10 12:45 
QuestionSorting a somewhat unknown list of properties Pin
MollyTheCoder7-Sep-10 4:25
MollyTheCoder7-Sep-10 4:25 
I'm trying to use reflection to generate a report from my classes. The trouble comes with class fields that are lists of other, smaller, classes that will be reported as tables. I can isolate those fields using properties ([ReportAttribute("GenerateTable")])in my class definitions, and get the next layer down with:
foreach (FieldInfo fi in FieldsThatAreLists)
{
   IList list = (IList)fi.GetValue(this);

   if (list[0] is MyClass)
   {
      List<MyClass> templist = ((List<MyClass>)list).OrderBy(mc=>mc.Index).ToList();
      list = (IList)newlist;
   }
   else if (repeat for every possible class...)

   ReportGenerate(list);
}


Since all of my (smaller) classes have a property called "Index", is it possible to eliminate the maintenance crushing if (list[0] is MyClass)... with something more elegant?

And once that's done, the ReportGenerate() method needs to sort the order of things in each class to get the report columns straight. I'm working on doing this with more properties in each class definition, but is there a simpler way?
AnswerRe: Sorting a somewhat unknown list of properties Pin
Ian Shlasko7-Sep-10 5:50
Ian Shlasko7-Sep-10 5:50 
GeneralRe: Sorting a somewhat unknown list of properties Pin
MollyTheCoder7-Sep-10 6:43
MollyTheCoder7-Sep-10 6:43 
GeneralRe: Sorting a somewhat unknown list of properties Pin
Ian Shlasko7-Sep-10 7:36
Ian Shlasko7-Sep-10 7:36 
GeneralRe: Sorting a somewhat unknown list of properties Pin
MollyTheCoder7-Sep-10 11:15
MollyTheCoder7-Sep-10 11:15 
GeneralRe: Sorting a somewhat unknown list of properties Pin
Ian Shlasko7-Sep-10 11:45
Ian Shlasko7-Sep-10 11:45 
GeneralRe: Sorting a somewhat unknown list of properties Pin
AspDotNetDev7-Sep-10 13:12
protectorAspDotNetDev7-Sep-10 13:12 
QuestionHow to print in Windows CE Pin
Medo-I7-Sep-10 3:55
Medo-I7-Sep-10 3:55 
AnswerRe: How to print in Windows CE Pin
OriginalGriff7-Sep-10 5:29
mveOriginalGriff7-Sep-10 5:29 
QuestionCreate a virtual Directory in IIS.. Pin
Gourav Vishnoi7-Sep-10 2:54
Gourav Vishnoi7-Sep-10 2:54 
AnswerRe: Create a virtual Directory in IIS.. Pin
Blue_Boy7-Sep-10 2:57
Blue_Boy7-Sep-10 2:57 
QuestionImage corruption in picturebox Pin
Sauce!7-Sep-10 0:47
Sauce!7-Sep-10 0:47 
AnswerRe: Image corruption in picturebox Pin
OriginalGriff7-Sep-10 1:16
mveOriginalGriff7-Sep-10 1:16 
GeneralRe: Image corruption in picturebox Pin
Sauce!7-Sep-10 2:10
Sauce!7-Sep-10 2:10 
AnswerRe: Image corruption in picturebox Pin
Luc Pattyn7-Sep-10 1:48
sitebuilderLuc Pattyn7-Sep-10 1:48 
GeneralRe: Image corruption in picturebox Pin
Sauce!7-Sep-10 2:12
Sauce!7-Sep-10 2:12 
GeneralRe: Image corruption in picturebox Pin
Luc Pattyn7-Sep-10 2:27
sitebuilderLuc Pattyn7-Sep-10 2:27 
QuestionHow to Unhide the Hidden form Pin
Ravindra Bisen6-Sep-10 23:36
Ravindra Bisen6-Sep-10 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.