Click here to Skip to main content
15,916,432 members
Home / Discussions / C#
   

C#

 
AnswerRe: Round Corner in C# windows foam application Pin
Eddy Vluggen30-Apr-19 1:27
professionalEddy Vluggen30-Apr-19 1:27 
GeneralRe: Round Corner in C# windows foam application Pin
BillWoodruff30-Apr-19 18:42
professionalBillWoodruff30-Apr-19 18:42 
GeneralRe: Round Corner in C# windows foam application Pin
Eddy Vluggen1-May-19 1:03
professionalEddy Vluggen1-May-19 1:03 
AnswerRe: Round Corner in C# windows foam application Pin
Gerry Schmitz30-Apr-19 1:56
mveGerry Schmitz30-Apr-19 1:56 
AnswerRe: Round Corner in C# windows foam application Pin
BillWoodruff30-Apr-19 18:40
professionalBillWoodruff30-Apr-19 18:40 
QuestionHow to get the MaxValue using LINQ ?! Pin
Abdalla Ben Omran29-Apr-19 2:24
Abdalla Ben Omran29-Apr-19 2:24 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 3:00
mveOriginalGriff29-Apr-19 3:00 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Abdalla Ben Omran29-Apr-19 3:17
Abdalla Ben Omran29-Apr-19 3:17 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 3:55
mveOriginalGriff29-Apr-19 3:55 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Richard Deeming1-May-19 8:22
mveRichard Deeming1-May-19 8:22 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
Dave Kreskowiak29-Apr-19 3:10
mveDave Kreskowiak29-Apr-19 3:10 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los29-Apr-19 9:04
mveMaciej Los29-Apr-19 9:04 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 20:14
mveOriginalGriff29-Apr-19 20:14 
PraiseRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los29-Apr-19 20:29
mveMaciej Los29-Apr-19 20:29 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
OriginalGriff29-Apr-19 20:42
mveOriginalGriff29-Apr-19 20:42 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Luc Pattyn30-Apr-19 0:37
sitebuilderLuc Pattyn30-Apr-19 0:37 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Richard Deeming1-May-19 8:20
mveRichard Deeming1-May-19 8:20 
QuestionRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los2-May-19 8:24
mveMaciej Los2-May-19 8:24 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
Richard Deeming3-May-19 0:43
mveRichard Deeming3-May-19 0:43 
PraiseRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los3-May-19 1:25
mveMaciej Los3-May-19 1:25 
AnswerRe: How to get the MaxValue using LINQ ?! Pin
Maciej Los3-May-19 1:34
mveMaciej Los3-May-19 1:34 
GeneralRe: How to get the MaxValue using LINQ ?! Pin
Abdalla Ben Omran3-May-19 2:30
Abdalla Ben Omran3-May-19 2:30 
hi there
i have got 3 solutions which they are working very well at work so far :

1-
public static TheQFromDB GetMaxWithLINQ (List<TheQFromDB> input)
        {
            
            var max = input.OrderByDescending(s => s.SecondsDiff).First();
            return max;
        }


2-
public static TheQFromDB GetMax2 (List<TheQFromDB> input)
       {
           TheQFromDB GetItem = input.First();

           foreach (var item in input)
           {
               if (item.SecondsDiff > GetItem.SecondsDiff)
               {
                   GetItem = item;
               }
           }
           return GetItem;


3-
public static TheQFromDB GetMax (List<TheQFromDB> input)
        {
            if (input == null || input.Count < 1)
                return null;

            int MaxIndex = input.Count - 1;
            for (int CurrentIndex = input.Count -2; CurrentIndex >=0; CurrentIndex--)
            {
                if (input[MaxIndex].SecondsDiff < input[CurrentIndex].SecondsDiff)
                    MaxIndex = CurrentIndex;
            }
            //Console.WriteLine("Max Value :" + input[MaxIndex].SecondsDiff);
            return input[MaxIndex];
        }


the number 3 get the index which holding the object back .
Questiondata structure Pin
Member 1434080028-Apr-19 3:35
Member 1434080028-Apr-19 3:35 
AnswerRe: data structure Pin
OriginalGriff28-Apr-19 4:27
mveOriginalGriff28-Apr-19 4:27 
AnswerRe: data structure Pin
Luc Pattyn28-Apr-19 9:59
sitebuilderLuc Pattyn28-Apr-19 9:59 

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.