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

  • Home
  • SEARCH
  • 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 391173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:02:09+00:00 2026-05-12T16:02:09+00:00

The Errors are in public IEnumerator GetEnumerator() and private sealed class d__0 Could you

  • 0

The Errors are in public IEnumerator GetEnumerator() and private sealed class d__0

Could you Gurus help to convert those unreadable/understandable code into something I or compiler understand ones…

Many Many Thanks first…

below is the code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Diagnostics;

namespace MyNmSpace.Utilities.Data
{
    [Serializable]

public class MyHashList<T> : IList<T>, ICollection<T>, IEnumerable<T>, ICollection, IEnumerable where T: DbObject
{
    // Fields
    protected Dictionary<int, T> _dict;
    protected List<int> _list;
    protected int _lowestId;

    // Methods
    public MyHashList()
    {
        this._lowestId = -2;
    }

    public virtual void Add(T item)
    {
        this.Insert(this.TheList.get_Count(), item);
    }

    public virtual void AddRange(IEnumerable<T> collection)
    {
        foreach (T local in collection)
        {
            this.Add(local);
        }
    }

    public virtual void Clear()
    {
        this.TheDict.Clear();
        this.TheList.Clear();
    }

    public MyHashList<T> Clone()
    {
        MyHashList<T> list = new MyHashList<T>();
        foreach (T local in this)
        {
            list.Add(local);
        }
        return list;
    }

    public virtual bool Contains(Predicate<T> match)
    {
        foreach (T local in this)
        {
            if (match(local))
            {
                return true;
            }
        }
        return false;
    }

    public virtual bool Contains(T item)
    {
        return (bool) (item.Id.get_HasValue() && this.ContainsId(item.Id.Value));
    }

    public virtual bool ContainsId(int id)
    {
        return (bool) ((id > -1) && this.TheDict.ContainsKey(id));
    }

    public virtual void CopyTo(T[] array, int arrayIndex)
    {
        for (int i = arrayIndex; i < (arrayIndex + this.Count); i = (int) (i + 1))
        {
            array[i] = this[i];
        }
    }

    public virtual T[] Filter(Predicate<T> match)
    {
        List<T> list = new List<T>();
        foreach (T local in this)
        {
            if (match(local))
            {
                list.Add(local);
            }
        }
        return list.ToArray();
    }

    public virtual T Find(Predicate<T> match)
    {
        foreach (T local in this)
        {
            if (match(local))
            {
                return local;
            }
        }
        return default(T);
    }

    public virtual T Find(int id)
    {
        if (!this.TheDict.ContainsKey(id))
        {
            return default(T);
        }
        return this.TheDict[id];
    }

    public virtual void ForEach(Action<T> function)
    {
        foreach (T local in this)
        {
            function(local);
        }
    }

    public IEnumerator<T> GetEnumerator()
    {
        <GetEnumerator>d__0<T> d__ = new <GetEnumerator>d__0<T>(0);
        d__.<>4__this = (MyHashList<T>) this;
        return d__;
    }

    public virtual int IndexOf(T item)
    {
        if (item.Id.get_HasValue())
        {
            return this.IndexOfId(item.Id.Value);
        }
        return -1;
    }

    public virtual int IndexOfId(int Id)
    {
        return this.TheList.IndexOf(Id);
    }

    public virtual void Insert(int index, T item)
    {
        if (item.Id.get_HasValue())
        {
            int? id = item.Id;
            if (!((id.GetValueOrDefault() < 0) && id.get_HasValue()) || !this.TheDict.ContainsKey(item.Id.Value))
            {
                goto Label_0083;
            }
        }
        item.Id = new int?(this._lowestId);
        this._lowestId = (int) (this._lowestId - 1);
    Label_0083:
        this.TheDict.Add(item.Id.Value, item);
        this.TheList.Insert(index, item.Id.Value);
    }

    public virtual bool Remove(T item)
    {
        return this.RemoveId(item.Id.Value);
    }

    public virtual void RemoveAt(int index)
    {
        this.TheDict.Remove(this.TheList.get_Item(index));
        this.TheList.RemoveAt(index);
    }

    public virtual bool RemoveId(int id)
    {
        if (this.TheDict.ContainsKey(id))
        {
            this.TheDict.Remove(id);
            this.TheList.Remove(id);
            return true;
        }
        return false;
    }

    public virtual void Sort(Comparison<int> compare)
    {
        this.TheList.Sort(compare);
    }

    void ICollection.CopyTo(Array array, int arrayIndex)
    {
        this.CopyTo((T[]) array, arrayIndex);
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        return this.GetEnumerator();
    }

    // Properties
    public int Count
    {
        get
        {
            return this.TheList.get_Count();
        }
    }

    public T this[int index]
    {
        get
        {
            return this.TheDict[this.TheList.get_Item(index)];
        }
        set
        {
            this.RemoveAt(index);
            this.Insert(index, value);
        }
    }

    bool ICollection<T>.IsReadOnly
    {
        get
        {
            return false;
        }
    }

    bool ICollection.IsSynchronized
    {
        get
        {
            return false;
        }
    }

    object ICollection.SyncRoot
    {
        get
        {
            return this;
        }
    }

    protected virtual Dictionary<int, T> TheDict
    {
        get
        {
            if (this._dict == null)
            {
                this._dict = new Dictionary<int, T>();
            }
            return this._dict;
        }
    }

    protected virtual List<int> TheList
    {
        get
        {
            if (this._list == null)
            {
                this._list = new List<int>();
            }
            return this._list;
        }
    }

    // Nested Types
    [CompilerGenerated]
    private sealed class <GetEnumerator>d__0 : IEnumerator<T>, IEnumerator, IDisposable
    {
        // Fields
        private int <>1__state;
        private T <>2__current;
        public MyHashList<T> <>4__this;
        public List<int>.Enumerator <>7__wrap2;
        public int <id>5__1;

        // Methods
        [DebuggerHidden]
        public <GetEnumerator>d__0(int <>1__state)
        {
            this.<>1__state = <>1__state;
        }

        private bool MoveNext()
        {
            bool flag;
            try
            {
                switch (this.<>1__state)
                {
                    case 0:
                        this.<>1__state = -1;
                        this.<>7__wrap2 = this.<>4__this.TheList.GetEnumerator();
                        this.<>1__state = 1;
                        goto Label_0083;

                    case 2:
                        this.<>1__state = 1;
                        goto Label_0083;

                    default:
                        goto Label_00A8;
                }
            Label_0044:
                this.<id>5__1 = this.<>7__wrap2.Current;
                this.<>2__current = this.<>4__this.TheDict[this.<id>5__1];
                this.<>1__state = 2;
                return true;
            Label_0083:
                if (this.<>7__wrap2.MoveNext())
                {
                    goto Label_0044;
                }
                this.<>1__state = -1;
                this.<>7__wrap2.Dispose();
            Label_00A8:
                flag = false;
            }
            fault
            {
                ((IDisposable) this).Dispose();
            }
            return flag;
        }

        [DebuggerHidden]
        void IEnumerator.Reset()
        {
            throw new NotSupportedException();
        }

        void IDisposable.Dispose()
        {
            switch (this.<>1__state)
            {
                case 1:
                case 2:
                    break;

                default:
                    return;
                    try
                    {
                    }
                    finally
                    {
                        this.<>1__state = -1;
                        this.<>7__wrap2.Dispose();
                    }
                    break;
            }
        }

        // Properties
        T IEnumerator<T>.Current
        {
            [DebuggerHidden]
            get
            {
                return this.<>2__current;
            }
        }

        object IEnumerator.Current
        {
            [DebuggerHidden]
            get
            {
                return this.<>2__current;
            }
        }
    }
}
  • 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-12T16:02:10+00:00Added an answer on May 12, 2026 at 4:02 pm

    I can at least help you understand why this is produced. It’s probably because the original code used an iterator block, which is translated into a confusing mix of labels and gotos that make up a state machine. It’s one of the things that Reflector cannot properly translate back to the original code.

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

Sidebar

Ask A Question

Stats

  • Questions 208k
  • Answers 208k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One easy way (not necessarily the fastest, but probably fast… May 12, 2026 at 9:33 pm
  • Editorial Team
    Editorial Team added an answer expect { some_method }.to raise_error RSpec 1 Syntax: lambda {… May 12, 2026 at 9:33 pm
  • Editorial Team
    Editorial Team added an answer class Throw(object): pass throw = Throw() # easy sentinel hack… May 12, 2026 at 9:33 pm

Related Questions

I've got an error in my build which says: Error 12 Cannot implicitly convert
Executive Summary: When assertion errors are thrown in the threads, the unit test doesn't
I have app that uses ClickOnce deployment. It works on about a dozen machines
Here's the scenario: I run compc on a source directory to recompile an already
What is the code required to redirect the browser to a new page with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.