Solved

Linq and Points

Posted on 2014-04-04
1
256 Views
Last Modified: 2016-02-15
I'm looking for a way to use Linq to return the maximum X value from a list(Of Point)
0
Comment
Question by:Dodsworth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39977517
Try something like:
            List<System.Drawing.Point> list = new List<System.Drawing.Point>()
            {
                new System.Drawing.Point(10, 3),
                new System.Drawing.Point(5, 4),
                new System.Drawing.Point(12, 2)
            };

            var point = (from p in list
                        orderby p.X descending
                        select p).First();

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What are the simplest ways to create a Merge Sort? 3 37
Where is this file? 3 33
WPF user control poped up from a window 1 35
How to force output to ascii 2 41
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question