本文整理汇总了C#中System.Collections.IEnumerator类的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.IEnumerator类的具体用法?C# System.Collections.IEnumerator怎么用?C# System.Collections.IEnumerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Collections.IEnumerator类属于命名空间,在下文中一共展示了System.Collections.IEnumerator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:david-mcneil,项目名称:stringtemplate,代码行数:25,代码来源:RestCollection.cs
示例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;
}
开发者ID:larsenjo,项目名称:odata.net,代码行数:13,代码来源:EnumeratorProxy.cs
示例3: CurrentIterator
private System.Collections.IEnumerator CurrentIterator()
{
if (_currentIterator == null)
{
_currentIterator = _delegate.GetEnumerator();
_status = Enumerator_Status.RESET;
}
return _currentIterator;
}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:ObjectSetCollection4Facade.cs
示例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
}
}
}
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:53,代码来源:Rule_Freq.cs
示例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");
}
}
开发者ID:sangnvus,项目名称:technical-docs,代码行数:35,代码来源:SequenceInputStream.cs
示例6: PropertiesEnumerator
public PropertiesEnumerator(System.Collections.IEnumerator _Enmtr) { Enmtr=_Enmtr; }
开发者ID:shintadono,项目名称:Free.Database.Dao.Net,代码行数:1,代码来源:Property.cs
示例7: NuGenFilterIterator
public NuGenFilterIterator(System.Collections.IEnumerator iter, NuGenFilterIterator.Predicate predicate)
{
this.iter = iter;
this.predicate = predicate;
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:5,代码来源:NuGenFilterIterator.cs
示例8: QueryDefsEnumerator
public QueryDefsEnumerator(System.Collections.IEnumerator _Enmtr) { Enmtr=_Enmtr; }
开发者ID:shintadono,项目名称:Free.Database.Dao.Net,代码行数:1,代码来源:QueryDef.cs
示例9: EnumeratorBase
public EnumeratorBase(System.Collections.IEnumerator inner)
{
this.inner = inner;
}
开发者ID:josecohenca,项目名称:xmlconvertsql,代码行数:4,代码来源:Asn1OutXml.cs
示例10: Reset
public override void Reset()
{
if (cache != null)
{
iterator = cache.GetEnumerator();
}
}
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:7,代码来源:CachingTokenFilter.cs
示例11: GetTree
public static SyntaxTree GetTree(System.Collections.ArrayList Tokens)
{
TokenEnm = Tokens.GetEnumerator();
GetToken();
return StatementBlock();
}
开发者ID:samwiise,项目名称:DistributedMatlab,代码行数:8,代码来源:SyntaxAnalyzer.cs
示例12: 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);
}
开发者ID:stanislavhacker,项目名称:OdbCommunicator,代码行数:13,代码来源:OdbClient.cs
示例13: 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;
}
开发者ID:carrie901,项目名称:mono,代码行数:13,代码来源:SinkTokenizer.cs
示例14: 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 );
}
开发者ID:Daramkun,项目名称:Misty,代码行数:17,代码来源:VertexDeclaration.cs
示例15: 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;
}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:18,代码来源:CachingTokenFilter.cs
示例16: 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;
}
开发者ID:carrie901,项目名称:mono,代码行数:19,代码来源:CachingTokenFilter.cs
示例17: 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();
}
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:20,代码来源:CachingTokenFilter.cs
示例18: Enumerator
public Enumerator(AllIterator list, MemberInfo info)
{
this.iterator = list.GetEnumerator();
this.info = info;
}
开发者ID:Phil-Ruben,项目名称:Residuals,代码行数:5,代码来源:xmloperations.cs
示例19: Next
public override bool Next()
{
if (termEnum == null)
return false;
// another term in this field?
if (termEnum.Next() && (System.Object) termEnum.Term().Field() == (System.Object) field)
return true; // yes, keep going
termEnum.Close(); // close old termEnum
// find the next field with terms, if any
if (fieldIterator == null)
{
System.Collections.Comparer comparer = System.Collections.Comparer.Default;
System.Collections.SortedList newList = new System.Collections.SortedList();
if (Enclosing_Instance.fieldToReader != null)
{
if (Enclosing_Instance.fieldToReader.Count > 0)
{
int index = 0;
while (comparer.Compare(Enclosing_Instance.fieldToReader.GetKey(index), field) < 0)
index++;
for (; index < Enclosing_Instance.fieldToReader.Count; index++)
{
newList.Add(Enclosing_Instance.fieldToReader.GetKey(index), Enclosing_Instance.fieldToReader[Enclosing_Instance.fieldToReader.GetKey(index)]);
}
}
}
fieldIterator = newList.Keys.GetEnumerator();
fieldIterator.MoveNext();
System.Object generatedAux = fieldIterator.Current; // Skip field to get next one
}
while (fieldIterator.MoveNext())
{
field = ((System.String) fieldIterator.Current);
termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms(new Term(field));
Term term = termEnum.Term();
if (term != null && (System.Object) term.Field() == (System.Object) field)
return true;
else
termEnum.Close();
}
return false; // no more fields
}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:47,代码来源:ParallelReader.cs
示例20: Enumerator
public Enumerator(FieldDeclarationCollection collection)
{
this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
}
开发者ID:spib,项目名称:nhcontrib,代码行数:4,代码来源:FieldDeclarationCollection.cs
注:本文中的System.Collections.IEnumerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论