Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6325217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:51:15+00:00 2026-05-24T16:51:15+00:00

my code : IEnumerable<Blob> bb = from element in bloblist let locationx = element.Rectangle.X

  • 0

my code :

IEnumerable<Blob> bb = from element in bloblist
    let locationx = element.Rectangle.X
    let locationy = element.Rectangle.Y
    orderby locationy  ascending ,locationx  descending
    select element;
foreach (var b0 in bb)
{
    listBox1.Items.Add(b0.Rectangle.X + "    " + b0.Rectangle.Y);
}

it’s work correctly but my purpose:

1.orderby locationy ascending ,locationx descending

2.if locationy[i+1]-locationy[i]<10

3.then : orderby locationx descending , locationy ascending

4.continue

example:

Sorted(x,y)   Desired
---------    ---------
   x  y      x   y
   30 0      35  7
   35 7      30  0
   15 20     30  27
   25 25     25  25
   30 27     15  20

could anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:51:16+00:00Added an answer on May 24, 2026 at 4:51 pm

    It’s hard to tell exactly what you are asking for, but it looks like this should get you to the desired value:

    bloblist.Select(item => new { X = item.Rectangle.X, Y = item.Rectangle.Y })
            .OrderByDescending(item => item.X)
            .ToList()
            .ForEach(item =>
            {
                listBox1.Items.Add(item.X + " " + item.Y);
            });
    

    That should give you a set of (X,Y) pairs sorted by descending X value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is some code that I'm trying to convert from IList to IEnumerable :
let's have this code : class MyList : IEnumerable, IEnumerator { int[] A =
Behold the C# code: IEnumerable<int> innerMethod(int parameter) { foreach(var i in Enumerable.Range(0, parameter)) {
Noob question: Consider the following C# code: public IEnumerable<xpto> CalculatedList { get { foreach(var
I've written the following code for retrieving the StructureId s from an IEnumerable<Structure> :
Consider the following C# code: IEnumerable numbers = Enumerable.Range(0, 10); var evens = from
Suppose we got a code like this: IEnumerable<Foo> A = meh(); IEnumerable<Foo> B =
The following code: public interface ISomeData { IEnumerable<string> Data { get; } } public
I'm writing code that looks similar to this: public IEnumerable<T> Unfold<T>(this T seed) {
I have the following code (calling a method returning IEnumerable): FibonacciWithLinq.Skip(delegate() { return 5;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.