本文整理汇总了C#中IDictionaryEnumerator.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionaryEnumerator.MoveNext方法的具体用法?C# IDictionaryEnumerator.MoveNext怎么用?C# IDictionaryEnumerator.MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDictionaryEnumerator
的用法示例。
在下文中一共展示了IDictionaryEnumerator.MoveNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PackageKeys
internal static void PackageKeys(IDictionaryEnumerator dicEnu, out string keyPackage, out int keyCount)
{
StringBuilder keys = new StringBuilder(1024);
keyCount = 0;
while (dicEnu.MoveNext())
{
keys.Append(dicEnu.Key + "\"");
keyCount++;
}
keyPackage = keys.ToString();
}
示例2: Populate
/// <summary>
/// Populates the trees' right list with objects contained in the enumerator.
/// </summary>
/// <param name="e"></param>
public void Populate(IDictionaryEnumerator e)
{
if (e != null)
{
if (_rightList == null) _rightList = new ArrayList();
if (e is RedBlackEnumerator)
{
while (e.MoveNext())
{
HashVector tbl = e.Value as HashVector;
_rightList.AddRange(tbl.Keys);
}
}
else
{
while (e.MoveNext())
{
_rightList.Add(e.Key);
}
}
}
}
示例3: MinifierResourceStrings
/// <summary>
/// Constructs a new instance of <see cref="MinifierResourceStrings"/>.
/// </summary>
/// <param name="enumerator">The dictionary to enumerate for values.</param>
public MinifierResourceStrings(IDictionaryEnumerator enumerator)
{
this.NameValuePairs = new Dictionary<string, string>();
if (enumerator != null)
{
// use the IDictionaryEnumerator to add properties to the collection
while (enumerator.MoveNext())
{
// get the property name
string propertyName = enumerator.Key.ToString();
// set the name/value in the resource object
this.NameValuePairs[propertyName] = enumerator.Value.ToString();
}
}
}
示例4: SetEnumerator
private void SetEnumerator(int i)
{
if (_enumerator == null)
{
_enumerator = _dictionary.GetEnumerator();
_enumerator.MoveNext();
}
if (_currentIndex > i)
{
_currentIndex = 0;
_enumerator.Reset();
_enumerator.MoveNext();
}
for (; _currentIndex < i; _currentIndex++)
_enumerator.MoveNext();
}
示例5: SearchId
/// <summary> A SearchId is only created from an ArrayVar object. The ArrayVar
/// constructs a new SearchId object by passing it's current keys
/// stored as an enumeration, a unique string that ArrayVar creates,
/// and an index value used for future SearchId objects.
///
/// </summary>
/// <param name="e">initial Enumeration
/// </param>
/// <param name="s">String as the unique identifier for the searchId
/// </param>
/// <param name="e">index value for this object
/// </param>
internal SearchId(IDictionaryEnumerator e, string s, int i)
{
enum_Renamed = e;
str = s;
index = i;
hasMore = enum_Renamed.MoveNext();
if (hasMore)
entry = enum_Renamed.Entry;
}
示例6: KeyValueIteratorSequence
public KeyValueIteratorSequence(IDictionaryEnumerator iter)
{
this.iter = iter;
if(iter != null) {
hasNext = iter.MoveNext();
}
}
示例7: Load
public ILocalizer Load(IDictionaryEnumerator reader, out IEnumerable<string> missing, out IEnumerable<string> extra)
{
var lmissing = new List<string>();
var lextra = new List<string>();
var newLocalizer = new Localizer();
while (reader.MoveNext())
{
var entry = (DictionaryEntry) reader.Current;
var fullKey = (string)entry.Key;
var semi = fullKey.LastIndexOf(SEPARATOR[0]);
var key = fullKey.Substring(0, semi);
var type = fullKey.Substring(semi + 1);
var val = (string)entry.Value;
if (type == "VALUE")
{
newLocalizer.Add(key, val);
}
else if (type == "LIST")
{
newLocalizer.Add(key, val.SplitList().ToArray());
}
else if (type == "TEMPLATE")
{
var elements = key.SplitList();
var usage = elements.First();
var fields = elements.Skip(1);
var patterns = val.SplitList();
var template = new TemplateAttribute((TemplateUsage)Enum.Parse(typeof(TemplateUsage), usage), patterns.ToArray());
foreach (var field in fields)
{
newLocalizer.Add(field, template);
}
}
}
// Find missing and extra keys
lmissing.AddRange(_translations.Keys.Except(newLocalizer._translations.Keys));
lmissing.AddRange(_arrayTranslations.Keys.Except(newLocalizer._arrayTranslations.Keys));
lmissing.AddRange(_templateTranslations.Keys.Except(newLocalizer._templateTranslations.Keys));
lextra.AddRange(newLocalizer._translations.Keys.Except(_translations.Keys));
lextra.AddRange(newLocalizer._arrayTranslations.Keys.Except(_arrayTranslations.Keys));
lextra.AddRange(newLocalizer._templateTranslations.Keys.Except(_templateTranslations.Keys));
missing = lmissing;
extra = lextra;
return newLocalizer;
}
示例8: WriteDictionary
/// <summary>
/// Write an dictionary to a <see cref="TextWriter"/>
/// </summary>
/// <param name="writer">the writer to write to</param>
/// <param name="repository">a <see cref="ILoggerRepository"/> to use for object conversion</param>
/// <param name="value">the value to write to the writer</param>
/// <remarks>
/// <para>
/// Writes the <see cref="IDictionaryEnumerator"/> to a writer in the form:
/// </para>
/// <code>
/// {key1=value1, key2=value2, key3=value3}
/// </code>
/// <para>
/// If the <see cref="ILoggerRepository"/> specified
/// is not null then it is used to render the key and value to text, otherwise
/// the object's ToString method is called.
/// </para>
/// </remarks>
protected static void WriteDictionary(TextWriter writer, ILoggerRepository repository, IDictionaryEnumerator value) {
writer.Write("{");
bool first = true;
// Write out all the dictionary key value pairs
while (value.MoveNext()) {
if (first) {
first = false;
} else {
writer.Write(", ");
}
WriteObject(writer, repository, value.Key);
writer.Write("=");
WriteObject(writer, repository, value.Value);
}
writer.Write("}");
}
示例9: DictEnumKeysToString
private static String DictEnumKeysToString(IDictionaryEnumerator e) {
StringBuilder sb = new StringBuilder(256);
if (e.MoveNext()) {
sb.Append(EncodeTab(e.Key));
while (e.MoveNext()) {
sb.Append("\t");
sb.Append(EncodeTab(e.Key));
}
}
return sb.ToString();
}
示例10: MoveNext
public bool MoveNext()
{
var currentScopeMoveNext = _currentScope.MoveNext();
if (_inParentScope == false)
return currentScopeMoveNext;
if (currentScopeMoveNext)
return true;
_inParentScope = false;
_currentScope = _localScope;
return _currentScope.MoveNext();
}
示例11: BuildResources
protected MediaResource[] BuildResources(string Interface, IDictionaryEnumerator en)
{
ArrayList a = new ArrayList();
while(en.MoveNext())
{
FileInfo f = (FileInfo)en.Value;
MediaResource mr;
ResourceBuilder.ResourceAttributes resInfo = new ResourceBuilder.ResourceAttributes();
resInfo.contentUri = "file://" + f.FullName;
resInfo.protocolInfo = ProtocolInfoString.CreateHttpGetProtocolInfoString(f);
mr = ResourceBuilder.CreateResource(resInfo);
OpenSource.UPnP.AV.Extensions.MetaData.Finder.PopulateMetaData(mr,f);
a.Add(mr);
}
return((MediaResource[])a.ToArray(typeof(MediaResource)));
}
示例12: DictEnumKeysToString
private static string DictEnumKeysToString(IDictionaryEnumerator e)
{
StringBuilder builder = new StringBuilder(0x100);
if (e.MoveNext())
{
builder.Append(EncodeTab(e.Key));
while (e.MoveNext())
{
builder.Append("\t");
builder.Append(EncodeTab(e.Key));
}
}
return builder.ToString();
}
示例13: VerifyDictionaryEnumerator
static int VerifyDictionaryEnumerator(IDictionaryEnumerator de, IterationOrder order)
{
long prev = long.MinValue;
if (order == IterationOrder.DescentOrder)
prev = long.MaxValue;
int i = 0;
while (de.MoveNext())
{
DictionaryEntry e1 = (DictionaryEntry)de.Current;
DictionaryEntry e2 = de.Entry;
Tests.Assert(e1.Equals(e2));
long k = (long)e1.Key;
long k2 = (long)de.Key;
Tests.Assert(k == k2);
RecordFull v1 = (RecordFull)e1.Value;
RecordFull v2 = (RecordFull)de.Value;
Tests.Assert(v1.Equals(v2));
Tests.Assert(v1.Int32Val == k);
if (order == IterationOrder.AscentOrder)
Tests.Assert(k >= prev);
else
Tests.Assert(k <= prev);
prev = k;
i++;
}
Tests.VerifyDictionaryEnumeratorDone(de);
return i;
}
示例14: VerifyDictionaryEnumerator
static int VerifyDictionaryEnumerator(IDictionaryEnumerator de, IterationOrder order)
{
string prev = "";
if (order == IterationOrder.DescentOrder)
prev = "9999999999999999999";
int i = 0;
while (de.MoveNext())
{
DictionaryEntry e1 = (DictionaryEntry)de.Current;
DictionaryEntry e2 = de.Entry;
Tests.Assert(e1.Equals(e2));
string k = (string)e1.Key;
string k2 = (string)de.Key;
Tests.Assert(k == k2);
RecordFull v1 = (RecordFull)e1.Value;
RecordFull v2 = (RecordFull)de.Value;
Tests.Assert(v1.Equals(v2));
Tests.Assert(v1.StrVal == k);
if (order == IterationOrder.AscentOrder)
Tests.Assert(k.CompareTo(prev) >= 0);
else
Tests.Assert(k.CompareTo(prev) <= 0);
prev = k;
i++;
}
Tests.VerifyDictionaryEnumeratorDone(de);
return i;
}
示例15: ReadFloat
private static float ReadFloat(IDictionaryEnumerator enumerator)
{
var value = float.Parse((string)enumerator.Current);
enumerator.MoveNext();
return value;
}