System.Resources.ResourceReader.ResourceEnumerator.MoveNext C# (CSharp) Méthode

MoveNext() public méthode

public MoveNext ( ) : bool
Résultat bool
            public bool MoveNext()
            {
                if (_currentName == _reader._numResources - 1 || _currentName == ENUM_DONE) {
                    _currentIsValid = false;
                    _currentName = ENUM_DONE;
                    return false;
                }
                _currentIsValid = true;
                _currentName++;
                return true;
            }
        

Usage Example

 /// <summary>Retrieves the type name and data content of a named resource from an open resource file or stream.</summary>
 /// <param name="resourceName">The name of a resource.</param>
 /// <param name="resourceType">When this method returns, contains a string that is the type name of the retrieved type. This parameter is passed uninitialized.</param>
 /// <param name="resourceData">When this method returns, contains a byte array that is the binary representation of the retrieved type. This parameter is passed uninitialized.</param>
 /// <exception cref="T:System.ArgumentNullException">
 ///   <paramref name="resourceName" /> is null.</exception>
 /// <exception cref="T:System.ArgumentException">
 ///   <paramref name="resourceName" /> does not exist.</exception>
 /// <exception cref="T:System.FormatException">The retrieved resource data is corrupted.</exception>
 /// <exception cref="T:System.InvalidOperationException">The current <see cref="T:System.Resources.ResourceReader" /> object is not initialized. The probable cause is that the <see cref="T:System.Resources.ResourceReader" /> object is closed.</exception>
 public void GetResourceData(string resourceName, out string resourceType, out byte[] resourceData)
 {
     if (resourceName == null)
     {
         throw new ArgumentNullException("resourceName");
     }
     ResourceReader.ResourceEnumerator resourceEnumerator = new ResourceReader.ResourceEnumerator(this);
     while (resourceEnumerator.MoveNext())
     {
         if ((string)resourceEnumerator.Key == resourceName)
         {
             this.GetResourceDataAt(resourceEnumerator.Index, out resourceType, out resourceData);
             return;
         }
     }
     throw new ArgumentException(string.Format("Specified resource not found: {0}", resourceName));
 }
All Usage Examples Of System.Resources.ResourceReader.ResourceEnumerator::MoveNext
ResourceReader.ResourceEnumerator