System.Collections.Generic.List.GetEnumerator()

Here are the examples of the csharp api System.Collections.Generic.List.GetEnumerator() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2074 Examples 7

19 View Source File : EpubFile.cs
License : MIT License
Project Creator : Aeroblast

public IEnumerator<Itemref> GetEnumerator()
        {
            return items.GetEnumerator();
        }

19 View Source File : RavenDbXmlRepositoryTest.cs
License : Apache License 2.0
Project Creator : Aguafrommars

[Fact]
        public void GetAllElements_should_return_all_elements_whwn_parse_xml_failed()
        {
            var sessionMock = new Mock<IDoreplacedentSession>();
            var queryableMock = new Mock<IRavenQueryable<KeyRotationKey>>();
            var fake = new List<KeyRotationKey>
            {
                new KeyRotationKey
                {

                }
            };
            queryableMock.Setup(m => m.GetEnumerator()).Returns(fake.GetEnumerator());
            sessionMock.Setup(m => m.Query<KeyRotationKey>(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>())).Returns(queryableMock.Object);

            var provider = new ServiceCollection()
                .AddLogging()
                .AddTransient(p => new DoreplacedentSessionWrapper(sessionMock.Object))
                .BuildServiceProvider();

            var sut = new RavenDbXmlRepository<KeyRotationKey>(provider, provider.GetRequiredService<ILoggerFactory>());

            var result = sut.GetAllElements();

            replacedert.Single(result);
        }

19 View Source File : CustomPOHelper.cs
License : MIT License
Project Creator : adams85

public IEnumerator<string> GetEnumerator() => _translations.GetEnumerator();

19 View Source File : CodePatches.cs
License : GNU General Public License v3.0
Project Creator : aedenthorn

public static bool doSetVisibleWallpaper_Prefix(DecoratableLocation __instance, int whichRoom, int which)
        {
            if (!ModEntry.config.EnableMod || !ModEntry.floorsWallsDataDict.ContainsKey(__instance.Name))
                return true;

            int idx = -1;

            for (int i = 0; i < __instance.map.TileSheets.Count; i++)
            {
                if (__instance.map.TileSheets[i].Id == "walls_and_floors")
                {
                    idx = i;
                    break;
                }
            }
            if (idx == -1)
            {
                return true;
            }

            __instance.updateMap();
            List<Rectangle> rooms = __instance.getWalls();
            int tileSheetIndex = which % 16 + which / 16 * 48;
            if (whichRoom == -1)
            {
                using (List<Rectangle>.Enumerator enumerator = rooms.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Rectangle r = enumerator.Current;
                        for (int x = r.X; x < r.Right; x++)
                        {
                            if (IsFloorableOrWallpaperableTile(x, r.Y, "Back", __instance))
                            {
                                SetWallpaperTile(x, r.Y, tileSheetIndex, "Back", __instance, idx);
                            }
                            if (IsFloorableOrWallpaperableTile(x, r.Y + 1, "Back", __instance))
                            {
                                SetWallpaperTile(x, r.Y + 1, tileSheetIndex + 16, "Back", __instance, idx);
                            }
                            if (r.Height >= 3)
                            {
                                if (IsFloorableOrWallpaperableTile(x, r.Y + 2, "Buildings", __instance))
                                {
                                    SetWallpaperTile(x, r.Y + 2, tileSheetIndex + 32, "Buildings", __instance, idx);
                                }
                                if (IsFloorableOrWallpaperableTile(x, r.Y + 2, "Back", __instance))
                                {
                                    SetWallpaperTile(x, r.Y + 2, tileSheetIndex + 32, "Back", __instance, idx);
                                }
                            }
                        }
                    }
                    return false;
                }
            }
            if (rooms.Count > whichRoom)
            {
                Rectangle r2 = rooms[whichRoom];
                for (int x2 = r2.X; x2 < r2.Right; x2++)
                {
                    if (IsFloorableOrWallpaperableTile(x2, r2.Y, "Back", __instance))
                    {
                        SetWallpaperTile(x2, r2.Y, tileSheetIndex, "Back", __instance, idx);
                    }
                    if (IsFloorableOrWallpaperableTile(x2, r2.Y + 1, "Back", __instance))
                    {
                        SetWallpaperTile(x2, r2.Y + 1, tileSheetIndex + 16, "Back", __instance, idx);
                    }
                    if (r2.Height >= 3)
                    {
                        if (IsFloorableOrWallpaperableTile(x2, r2.Y + 2, "Buildings", __instance))
                        {
                            SetWallpaperTile(x2, r2.Y + 2, tileSheetIndex + 32, "Buildings", __instance, idx);
                        }
                        else if (IsFloorableOrWallpaperableTile(x2, r2.Y + 2, "Back", __instance))
                        {
                            SetWallpaperTile(x2, r2.Y + 2, tileSheetIndex + 32, "Back", __instance, idx);
                        }
                    }
                }
            }
            return false;
        }

19 View Source File : RxLayout.cs
License : MIT License
Project Creator : adospace

public IEnumerator<VisualNode> GetEnumerator()
        {
            return _internalChildren.GetEnumerator();
        }

19 View Source File : SequenceToken.cs
License : MIT License
Project Creator : actions

IEnumerator IReadOnlyArray.GetEnumerator()
        {
            if (m_items?.Count > 0)
            {
                return m_items.GetEnumerator();
            }
            else
            {
                return (new TemplateToken[0] as IEnumerable<TemplateToken>).GetEnumerator();
            }
        }

19 View Source File : ZMessage.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu

public IEnumerator<ZFrame> GetEnumerator()
        {
            return _frames.GetEnumerator();
        }

19 View Source File : AdjacentSeats.cs
License : Apache License 2.0
Project Creator : 42skillz

public IEnumerator<Seat> GetEnumerator()
        {
            return _seats.GetEnumerator();
        }

19 View Source File : SimpleArray.cs
License : GNU General Public License v3.0
Project Creator : ahmed605

public IEnumerator<T> GetEnumerator()
        {
            return Values.GetEnumerator();
        }

19 View Source File : DeserializeableList.cs
License : MIT License
Project Creator : absurd-joy

public IEnumerator<T> GetEnumerator() {return _Data.GetEnumerator();}

19 View Source File : RxTableView.cs
License : MIT License
Project Creator : adospace

public IEnumerator<RxTableRoot> GetEnumerator()
        {
            return _children.GetEnumerator();
        }

19 View Source File : RxComponent.cs
License : MIT License
Project Creator : adospace

public IEnumerator<VisualNode> GetEnumerator()
        {
            return _children.GetEnumerator();
        }

19 View Source File : SequenceToken.cs
License : MIT License
Project Creator : actions

public IEnumerator<TemplateToken> GetEnumerator()
        {
            if (m_items?.Count > 0)
            {
                return m_items.GetEnumerator();
            }
            else
            {
                return (new TemplateToken[0] as IEnumerable<TemplateToken>).GetEnumerator();
            }
        }

19 View Source File : SyncList.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public IEnumerator<T> GetEnumerator()
        {
            return items.GetEnumerator();
        }

19 View Source File : GameManager.cs
License : MIT License
Project Creator : 39M

void InitWithBuildInBeatmap()
    {
        // Load beatmap
        music = RuntimeData.selectedMusic;
        if (music == null)
        {
            var beatmapreplacedet = Resources.Load<Textreplacedet>(GameConst.BEATMAP_PATH + "Bangarang");
            music = Music.FromJson(beatmapreplacedet.text);
        }
        beatmap = RuntimeData.selectedBeatmap;
        if (beatmap == null)
        {
            beatmap = music.beatmapList[0];
        }
        noteList = beatmap.noteList;
        //int remainNote = 100;
        //noteList.RemoveRange(remainNote, noteList.Count - remainNote);
        noteEnum = noteList.GetEnumerator();
        noteEnum.MoveNext();
        currentNote = noteEnum.Current;

        // Load and play audio
        audio.clip = Utils.LoadAudio(music.audioFilename);
        if (currentNote.time < noteSpawnAdvanceTime / 2)
        {
            audio.PlayDelayed(2f);
        }
        else
        {
            audio.Play();
        }

        if (music.soundEffectFilename != null && music.soundEffectFilename.Length > 0)
        {
            hitSoundClip = Utils.LoadSoundEffect(music.soundEffectFilename);
        }
        else
        {
            hitSoundClip = Utils.LoadSoundEffect(GameConst.DEFAULT_SOUND_EFFECT_FILENAME);
        }
    }

19 View Source File : CurveControlPointList.cs
License : The Unlicense
Project Creator : aeroson

IEnumerator<CurveControlPoint<TValue>> IEnumerable<CurveControlPoint<TValue>>.GetEnumerator()
        {
            return list.GetEnumerator();
        }

19 View Source File : ObservableList.cs
License : MIT License
Project Creator : Adam4lexander

public List<T>.Enumerator GetEnumerator() {
            return m_list.GetEnumerator();
        }

19 View Source File : Objects.cs
License : MIT License
Project Creator : agens-no

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

19 View Source File : ExifValueCollection.cs
License : MIT License
Project Creator : 0xC0000054

public IEnumerator<MetadataEntry> GetEnumerator()
        {
            return exifMetadata.GetEnumerator();
        }

19 View Source File : MongoDbXmlRepositoryTest.cs
License : Apache License 2.0
Project Creator : Aguafrommars

[Fact]
        public void GetAllElements_should_return_all_elements_whwn_parse_xml_failed()
        {
            var collectionMock = new Mock<IMongoCollection<KeyRotationKey>>();
            var queryableMock = new Mock<IMongoQueryable<KeyRotationKey>>();
            var fake = new List<KeyRotationKey>
            {
                new KeyRotationKey
                {

                }
            };
            queryableMock.Setup(m => m.GetEnumerator()).Returns(fake.GetEnumerator());

            var provider = new ServiceCollection()
                .AddLogging()
                .AddTransient(p => new MongoCollectionWrapper<KeyRotationKey>(collectionMock.Object, queryableMock.Object))
                .BuildServiceProvider();

            var sut = new MongoDbXmlRepository<KeyRotationKey>(provider, provider.GetRequiredService<ILoggerFactory>());

            var result = sut.GetAllElements();

            replacedert.Single(result);
        }

19 View Source File : RxGeometryGroup.cs
License : MIT License
Project Creator : adospace

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

19 View Source File : RxContentPage.cs
License : MIT License
Project Creator : adospace

public IEnumerator<VisualNode> GetEnumerator()
        {
            return _contents.GetEnumerator();
        }

19 View Source File : ExifValueCollection.cs
License : MIT License
Project Creator : 0xC0000054

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

19 View Source File : RxNavigationPage.cs
License : MIT License
Project Creator : adospace

public IEnumerator<VisualNode> GetEnumerator()
        {
            return new List<VisualNode>(new[] { _rootPage }).GetEnumerator();
        }

19 View Source File : FileCache.cs
License : Apache License 2.0
Project Creator : acarteas

public IEnumerator<KeyValuePair<string, object>> GetEnumerator(string regionName = null)
        {
            string region = "";
            if (string.IsNullOrEmpty(regionName) == false)
            {
                region = regionName;
            }

            //AC: This seems inefficient.  Wouldn't it be better to do this using a cursor?
            List<KeyValuePair<string, object>> enumerator = new List<KeyValuePair<string, object>>();

            var keys = CacheManager.GetKeys(regionName);
            foreach (string key in keys)
            {
                enumerator.Add(new KeyValuePair<string, object>(key, this.Get(key, regionName)));
            }
            return enumerator.GetEnumerator();
        }

19 View Source File : RxShellItem.cs
License : MIT License
Project Creator : adospace

public IEnumerator<IRxShellSection> GetEnumerator()
        {
            return _items.GetEnumerator();
        }

19 View Source File : RxShellSection.cs
License : MIT License
Project Creator : adospace

public IEnumerator<VisualNode> GetEnumerator()
        {
            return _items.GetEnumerator();
        }

19 View Source File : MappingToken.cs
License : MIT License
Project Creator : actions

System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            if (m_items?.Count > 0)
            {
                return m_items.GetEnumerator();
            }
            else
            {
                return (new KeyValuePair<ScalarToken, TemplateToken>[0]).GetEnumerator();
            }
        }

19 View Source File : CompositeCrmSiteMapNodeValidator.cs
License : MIT License
Project Creator : Adoxio

public IEnumerator<ICrmSiteMapNodeValidator> GetEnumerator()
		{
			return _validators.GetEnumerator();
		}

19 View Source File : CollectionAbstract.cs
License : MIT License
Project Creator : 17MKH

public IEnumerator<TEnreplacedy> GetEnumerator()
    {
        return Collection.GetEnumerator();
    }

19 View Source File : CodePatches.cs
License : GNU General Public License v3.0
Project Creator : aedenthorn

public static bool doSetVisibleFloor_Prefix(DecoratableLocation __instance, int whichRoom, int which)
        {
            if (!ModEntry.config.EnableMod || !ModEntry.floorsWallsDataDict.ContainsKey(__instance.Name))
                return true;

            int idx = -1;

            for (int i = 0; i < __instance.map.TileSheets.Count; i++)
            {
                if (__instance.map.TileSheets[i].Id == "walls_and_floors")
                {
                    idx = i;
                    break;
                }
            }
            if (idx == -1)
            {
                return true;
            }

            List<Rectangle> rooms = __instance.getFloors();
            int tileSheetIndex = 336 + which % 8 * 2 + which / 8 * 32;
            if (whichRoom == -1)
            {
                using (List<Rectangle>.Enumerator enumerator = rooms.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Rectangle r = enumerator.Current;
                        for (int x = r.X; x < r.Right; x += 2)
                        {
                            for (int y = r.Y; y < r.Bottom; y += 2)
                            {
                                if (r.Contains(x, y) && IsFloorableTile(x, y, "Back", __instance))
                                {
                                    SetFlooringTile(tileSheetIndex, x, y, r, __instance, idx);
                                }
                                if (r.Contains(x + 1, y) && IsFloorableTile(x + 1, y, "Back", __instance))
                                {
                                    SetFlooringTile(tileSheetIndex, x + 1, y, r, __instance, idx);
                                }
                                if (r.Contains(x, y + 1) && IsFloorableTile(x, y + 1, "Back", __instance))
                                {
                                    SetFlooringTile(tileSheetIndex, x, y + 1, r, __instance, idx);
                                }
                                if (r.Contains(x + 1, y + 1) && IsFloorableTile(x + 1, y + 1, "Back", __instance))
                                {
                                    SetFlooringTile(tileSheetIndex, x + 1, y + 1, r, __instance, idx);
                                }
                            }
                        }
                    }
                    return false;
                }
            }
            if (rooms.Count > whichRoom)
            {
                Rectangle r2 = rooms[whichRoom];
                for (int x2 = r2.X; x2 < r2.Right; x2 += 2)
                {
                    for (int y2 = r2.Y; y2 < r2.Bottom; y2 += 2)
                    {
                        if (r2.Contains(x2, y2) && IsFloorableTile(x2, y2, "Back", __instance))
                        {
                            SetFlooringTile(tileSheetIndex, x2, y2, r2, __instance, idx);
                        }
                        if (r2.Contains(x2 + 1, y2) && IsFloorableTile(x2 + 1, y2, "Back", __instance))
                        {
                            SetFlooringTile(tileSheetIndex, x2 + 1, y2, r2, __instance, idx);
                        }
                        if (r2.Contains(x2, y2 + 1) && IsFloorableTile(x2, y2 + 1, "Back", __instance))
                        {
                            SetFlooringTile(tileSheetIndex, x2, y2 + 1, r2, __instance, idx);
                        }
                        if (r2.Contains(x2 + 1, y2 + 1) && IsFloorableTile(x2 + 1, y2 + 1, "Back", __instance))
                        {
                            SetFlooringTile(tileSheetIndex, x2 + 1, y2 + 1, r2, __instance, idx);
                        }
                    }
                }
            }
            return false;
        }

19 View Source File : SequenceToken.cs
License : MIT License
Project Creator : actions

IEnumerator IEnumerable.GetEnumerator()
        {
            if (m_items?.Count > 0)
            {
                return m_items.GetEnumerator();
            }
            else
            {
                return (new TemplateToken[0] as IEnumerable<TemplateToken>).GetEnumerator();
            }
        }

19 View Source File : SyncList.cs
License : GNU General Public License v3.0
Project Creator : aelariane

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

19 View Source File : TextureCollection.cs
License : MIT License
Project Creator : 0xC0000054

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

19 View Source File : CurveControlPointList.cs
License : The Unlicense
Project Creator : aeroson

public List<CurveControlPoint<TValue>>.Enumerator GetEnumerator()
        {
            return list.GetEnumerator();
        }

19 View Source File : TestMutableComposite.cs
License : GNU Affero General Public License v3.0
Project Creator : active-logic

[Test] public void FuncReset_ordered(){
        var arr = new List<Func<status>>();
        x.ι = arr.GetEnumerator();
        x.ordered = true;
        o ( x.Reset(), @void() );
    }

19 View Source File : CurveControlPointList.cs
License : The Unlicense
Project Creator : aeroson

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

19 View Source File : SynchSubscribers.cs
License : MIT License
Project Creator : 3F

public IEnumerator<T> GetEnumerator()
        {
            IEnumerator<T> result;
            lock(sync) {
                result = listeners.GetEnumerator();
            }
            return result;
        }

19 View Source File : Objects.cs
License : MIT License
Project Creator : agens-no

IEnumerator<string> IEnumerable<string>.GetEnumerator() { return m_List.GetEnumerator(); }

19 View Source File : Diagnostics.cs
License : MIT License
Project Creator : adamant

public IEnumerator<Diagnostic> GetEnumerator()
        {
            return items.GetEnumerator();
        }

19 View Source File : MongoDbXmlRepositoryTest.cs
License : Apache License 2.0
Project Creator : Aguafrommars

[Fact]
        public void GetAllElements_should_return_all_elements()
        {
            var collectionMock = new Mock<IMongoCollection<DataProtectionKey>>();
            var queryableMock = new Mock<IMongoQueryable<DataProtectionKey>>();
            var fake = new List<DataProtectionKey>
            {
                new DataProtectionKey
                {
                    Xml = "<a/>"
                }
            };
            queryableMock.Setup(m => m.GetEnumerator()).Returns(fake.GetEnumerator());

            var provider = new ServiceCollection()
                .AddLogging()
                .AddTransient(p => new MongoCollectionWrapper<DataProtectionKey>(collectionMock.Object, queryableMock.Object))
                .BuildServiceProvider();

            var sut = new MongoDbXmlRepository<DataProtectionKey>(provider, provider.GetRequiredService<ILoggerFactory>());

            var result = sut.GetAllElements();

            replacedert.Single(result);
        }

19 View Source File : ExifValueCollection.cs
License : MIT License
Project Creator : 0xC0000054

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

19 View Source File : RavenDbXmlRepositoryTest.cs
License : Apache License 2.0
Project Creator : Aguafrommars

[Fact]
        public void GetAllElements_should_return_all_elements()
        {
            var sessionMock = new Mock<IDoreplacedentSession>();
            var queryableMock = new Mock<IRavenQueryable<DataProtectionKey>>();
            var fake = new List<DataProtectionKey>
            {
                new DataProtectionKey
                {
                    Xml = "<a/>"
                }
            };
            queryableMock.Setup(m => m.GetEnumerator()).Returns(fake.GetEnumerator());
            sessionMock.Setup(m => m.Query<DataProtectionKey>(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>())).Returns(queryableMock.Object);

            var provider = new ServiceCollection()
                .AddLogging()
                .AddTransient(p => new DoreplacedentSessionWrapper(sessionMock.Object))
                .BuildServiceProvider();

            var sut = new RavenDbXmlRepository<DataProtectionKey>(provider, provider.GetRequiredService<ILoggerFactory>());

            var result = sut.GetAllElements();

            replacedert.Single(result);
        }

19 View Source File : RxGeometryGroup.cs
License : MIT License
Project Creator : adospace

public IEnumerator<IRxGeometry> GetEnumerator()
        {
            return _internalChildren.GetEnumerator();
        }

19 View Source File : SimpleJSON.cs
License : MIT License
Project Creator : 71

public override Enumerator GetEnumerator() { return new Enumerator(m_List.GetEnumerator()); }

19 View Source File : ExifValueCollection.cs
License : MIT License
Project Creator : 0xC0000054

public IEnumerator<MetadataEntry> GetEnumerator()
        {
            return this.exifMetadata.GetEnumerator();
        }

19 View Source File : TextureCollection.cs
License : MIT License
Project Creator : 0xC0000054

public IEnumerator<Texture> GetEnumerator()
        {
            return this.items.GetEnumerator();
        }

19 View Source File : Assets.cs
License : GNU General Public License v3.0
Project Creator : 1330-Studios

[HarmonyPrefix]
            public static bool Prefix(Factory __instance, string objectId, Il2CppSystem.Action<UnityDisplayNode> onComplete) {
                using (var enumerator = allreplacedetsKnown.GetEnumerator()) {
                    while (enumerator.MoveNext()) {
                        replacedetInfo curreplacedet = enumerator.Current;
                        if (objectId.Equals(curreplacedet.CustomreplacedetName)) {
                            GameObject obj = Object.Instantiate(new GameObject(objectId + "(Clone)"), __instance.PrototypeRoot);
                            var sr = obj.AddComponent<SpriteRenderer>();
                            sr.sprite = SpriteBuilder.createBloon(CacheBuilder.Get(objectId));
                            var udn = obj.AddComponent<UnityDisplayNode>();
                            udn.transform.position = new(-3000, 0);
                            onComplete.Invoke(udn);
                            return false;
                        }
                    }
                }
                return true;
            }

19 View Source File : MappingToken.cs
License : MIT License
Project Creator : actions

public IEnumerator<KeyValuePair<ScalarToken, TemplateToken>> GetEnumerator()
        {
            if (m_items?.Count > 0)
            {
                return m_items.GetEnumerator();
            }
            else
            {
                return (new List<KeyValuePair<ScalarToken, TemplateToken>>(0)).GetEnumerator();
            }
        }

19 View Source File : RxMap.cs
License : MIT License
Project Creator : adospace

public IEnumerator<RxPin> GetEnumerator()
        {
            return _internalChildren.GetEnumerator();
        }

See More Examples