本文整理汇总了C#中System.Collections.IEnumerator类的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.IEnumerator类的具体用法?C# System.Collections.IEnumerator怎么用?C# System.Collections.IEnumerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Collections.IEnumerator类属于命名空间,在下文中一共展示了System.Collections.IEnumerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RestCollection
internal RestCollection(IEnumerator enumerator)
{
if (enumerator == null)
this._inner = new object[0];
else
{
ArrayList list = new ArrayList();
//try
//{
// object o = enumerator.Current;
// list.Add(o);
//}
//catch (InvalidOperationException)
//{
// // Just means there's no current object
//}
while (enumerator.MoveNext())
{
list.Add(enumerator.Current);
}
this._inner = list;
_count = _inner.Count-1;
}
}
示例2: EnumeratorProxy
/// <summary>
/// Initializes a new instance of the EnumeratorProxy class.
/// </summary>
/// <param name="wrapperScope">The wrapper scope.</param>
/// <param name="underlyingImplementation">The underlying implementation of the proxy.</param>
public EnumeratorProxy(IWrapperScope wrapperScope, System.Collections.IEnumerator underlyingImplementation)
{
ExceptionUtilities.CheckArgumentNotNull(wrapperScope, "wrapperScope");
ExceptionUtilities.CheckArgumentNotNull(underlyingImplementation, "underlyingImplementation");
this.Scope = wrapperScope;
this.underlyingImplementation = underlyingImplementation;
}
示例3: CurrentIterator
private System.Collections.IEnumerator CurrentIterator()
{
if (_currentIterator == null)
{
_currentIterator = _delegate.GetEnumerator();
_status = Enumerator_Status.RESET;
}
return _currentIterator;
}
示例4: VisitAll
public void VisitAll(params System.Collections.IEnumerable[] m)
{
// initialize
int n = m.Length;
int j;
System.Collections.IEnumerator[] a = new System.Collections.IEnumerator[n + 1];
for (j = 1; j <= n; j++)
{
a[j] = m[j - 1].GetEnumerator();
a[j].MoveNext();
}
a[0] = m[0].GetEnumerator();
a[0].MoveNext();
for (; ; )
{
switch (this.RunMode)
{
case RunModeEnum.SelectClauses:
VisitTableColumns(a);
break;
case RunModeEnum.CurrentRow:
VisitCurrentRow(a);
break;
case RunModeEnum.Console:
default:
Visit(a);
break;
}
// prepare to add one
j = n;
// carry if necessary
while (!a[j].MoveNext())
{
a[j].Reset();
a[j].MoveNext();
j -= 1;
}
// increase unless done
if (j == 0)
{
break; // Terminate the algorithm
}
}
}
示例5: SequenceInputStream
/// <summary>
/// Initializes a newly created <code>SequenceInputStream</code>
/// by remembering the argument, which must
/// be an <code>Enumeration</code> that produces
/// objects whose run-time type is <code>InputStream</code>.
/// </summary>
/// <remarks>
/// Initializes a newly created <code>SequenceInputStream</code>
/// by remembering the argument, which must
/// be an <code>Enumeration</code> that produces
/// objects whose run-time type is <code>InputStream</code>.
/// The input streams that are produced by
/// the enumeration will be read, in order,
/// to provide the bytes to be read from this
/// <code>SequenceInputStream</code>. After
/// each input stream from the enumeration
/// is exhausted, it is closed by calling its
/// <code>close</code> method.
/// </remarks>
/// <param name="e">an enumeration of input streams.</param>
/// <seealso cref="System.Collections.IEnumerator{E}">System.Collections.IEnumerator<E>
/// </seealso>
public SequenceInputStream(System.Collections.Generic.IEnumerator<InputStream> e)
{
this.e = e;
try
{
nextStream();
}
catch (System.IO.IOException)
{
// This should never happen
throw new System.Exception("panic");
}
}
示例6: PropertiesEnumerator
public PropertiesEnumerator(System.Collections.IEnumerator _Enmtr) { Enmtr=_Enmtr; }
示例7: Reset
public override void Reset()
{
if (cache != null)
{
iterator = cache.GetEnumerator();
}
}
示例8: GetTree
public static SyntaxTree GetTree(System.Collections.ArrayList Tokens)
{
TokenEnm = Tokens.GetEnumerator();
GetToken();
return StatementBlock();
}
示例9: OdbClient
/// <summary>
/// Create new odb client
/// </summary>
public OdbClient()
{
this.PriorityEnumerator = Priorities.GetEnumerator();
this.socket = new OdbSocket(new StreamSocket());
this.status = new OdbStatus(this.socket);
this.commands = new OdbCommands(this.socket);
this.ecu = new OdbEcu(this.socket, this.commands);
}
示例10: Next
public override Token Next(Token reusableToken)
{
System.Diagnostics.Debug.Assert(reusableToken != null);
if (iter == null)
iter = lst.GetEnumerator();
// Since this TokenStream can be reset we have to maintain the tokens as immutable
if (iter.MoveNext())
{
Token nextToken = (Token) iter.Current;
return (Token) nextToken.Clone();
}
return null;
}
示例11: VertexDeclaration
public VertexDeclaration( IGraphicsDevice graphicsDevice, VertexElement [] elements )
{
this.elements = elements.GetEnumerator ();
SharpDX.Direct3D9.Device device = graphicsDevice.Handle as SharpDX.Direct3D9.Device;
SharpDX.Direct3D9.VertexElement [] convedElements = new SharpDX.Direct3D9.VertexElement [ elements.Length + 1 ];
for ( int i = 0, offset = 0; i < elements.Length; ++i )
{
convedElements [ i ] = new SharpDX.Direct3D9.VertexElement ( 0, ( short ) offset,
ConvertType ( elements [ i ].Size ), SharpDX.Direct3D9.DeclarationMethod.Default,
ConvertType ( elements [ i ].Type ), ( byte ) elements [ i ].UsageIndex );
offset += ElementSizeToRealSize ( elements [ i ].Size );
}
convedElements [ elements.Length ] = SharpDX.Direct3D9.VertexElement.VertexDeclarationEnd;
vertexDeclaration = new SharpDX.Direct3D9.VertexDeclaration ( device, convedElements );
}
示例12: Next
public override Token Next()
{
if (cache == null)
{
// fill cache lazily
cache = new System.Collections.ArrayList();
FillCache();
iterator = cache.GetEnumerator();
}
if (!iterator.MoveNext())
{
// the cache is exhausted, return null
return null;
}
return (Token) iterator.Current;
}
示例13: IncrementToken
public override bool IncrementToken()
{
if (cache == null)
{
// fill cache lazily
cache = new System.Collections.ArrayList();
FillCache();
iterator = cache.GetEnumerator();
}
if (!iterator.MoveNext())
{
// the cache is exhausted, return false
return false;
}
// Since the TokenFilter can be reset, the tokens need to be preserved as immutable.
RestoreState((AttributeSource.State) iterator.Current);
return true;
}
示例14: Next
public override Token Next(/* in */ Token reusableToken)
{
System.Diagnostics.Debug.Assert(reusableToken != null);
if (cache == null)
{
// fill cache lazily
cache = new System.Collections.ArrayList();
FillCache(reusableToken);
iterator = cache.GetEnumerator();
}
if (!iterator.MoveNext())
{
// the cache is exhausted, return null
return null;
}
Token nextToken = (Token) iterator.Current;
return (Token) nextToken.Clone();
}
示例15: Enumerator
public Enumerator(AllIterator list, MemberInfo info)
{
this.iterator = list.GetEnumerator();
this.info = info;
}