本文整理汇总了C#中IDictionaryEnumerator类的典型用法代码示例。如果您正苦于以下问题:C# IDictionaryEnumerator类的具体用法?C# IDictionaryEnumerator怎么用?C# IDictionaryEnumerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDictionaryEnumerator类属于命名空间,在下文中一共展示了IDictionaryEnumerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMessageToUser
public override void SendMessageToUser(IDictionaryEnumerator pp, string sMes, string sTitle)
{
Console.WriteLine("SendMessageToUser " + pp.Value.ToString());
string attach_post_key = "";
string auth_key = "";
m_Client.Referer = ForumPath + "/index.php?act=Msg&CODE=4&MID=" + pp.Key.ToString();
m_Response = m_Client.DownloadString(m_sForumPath + "/index.php?act=Msg&CODE=4&MID=" + pp.Key.ToString());
Match mc1 = Regex.Match(m_Response, "attach_post_key\" value\\=\"(.*)\"\\s*\\/\\>");
if (mc1.Success)
{
attach_post_key = mc1.Groups[1].Value;
}
mc1 = Regex.Match(m_Response, "auth_key\" value\\=\"(.*)\"\\s*\\/\\>");
if (mc1.Success)
{
auth_key = mc1.Groups[1].Value;
}
string POSTDATA =
"removeattachid=0" +
"&OID=0" +
"&act=Msg" +
"&CODE=04" +
"&MODE=01" +
"&attach_post_key=" + attach_post_key +
"&auth_key=" + auth_key +
"&entered_name=" + pp.Value.ToString() +
"&carbon_copy=" +
"&msg_title=" + sTitle +
"&ed-0_wysiwyg_used=0" +
"&editor_ids%5B%5D=ed-0" +
"&Post=" + sMes;
m_Response = m_Client.UploadString(m_sForumPath + "/index.php?act=msg", POSTDATA);
}
示例2: CreateEnumerator
internal override IDictionaryEnumerator CreateEnumerator()
{
IDictionaryEnumerator[] enumerators = new IDictionaryEnumerator[this._caches.Length];
int index = 0;
int length = this._caches.Length;
while (index < length)
{
enumerators[index] = this._caches[index].CreateEnumerator();
index++;
}
return new AggregateEnumerator(enumerators);
}
示例3: 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();
}
示例4: 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();
}
}
}
示例5: 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);
}
}
}
}
示例6: CacheEnumerator
public CacheEnumerator(IDictionaryEnumerator enumerator)
{
_enumerator = enumerator;
Cache.Instance._rwl.AcquireReaderLock(Cache.LOCK_TIMEOUT_MSECS);
}
示例7: CreateEnumerator
internal override IDictionaryEnumerator CreateEnumerator() {
IDictionaryEnumerator[] enumerators = new IDictionaryEnumerator[_caches.Length];
for (int i = 0, c = _caches.Length; i < c; i++) {
enumerators[i] = _caches[i].CreateEnumerator();
}
return new AggregateEnumerator(enumerators);
}
示例8: while
//SERIALIZACAO: A classe XMLSerializer irá usar este metodo para pegar um item para serializar no xml.
public DictionaryEntry this[int index]
{
get
{
if (_enumerator == null) // lazy
_enumerator = _hashTable.GetEnumerator();
// Acessar um item cuja a posicao seja anterior a ultima recebida é anormal,
// pois o XMLSerializaer irá chamar este metodo varias vezes, passando o indice
// de forma crescente.
// Mas, caso isso aconteça, então é necessario chamar o Reset() do enumerator
// pois ele trabalha 'forward-only'.
if (index < _position)
{
_enumerator.Reset();
_position = -1;
}
while (_position < index)
{
_enumerator.MoveNext();
_position++;
}
return _enumerator.Entry;
}
}
示例9: MessageDictionaryEnumerator
public MessageDictionaryEnumerator(MessageDictionary md, IDictionary hashtable)
{
this._md = md;
if (hashtable != null)
{
this._enumHash = hashtable.GetEnumerator();
}
else
{
this._enumHash = null;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:MessageDictionaryEnumerator.cs
示例10: while
// Serialization: XmlSerializer uses this one to get one item at the time
public DictionaryEntry this[int index]
{
get
{
if (_enumerator == null) // lazy initialization
_enumerator = _hashTable.GetEnumerator();
// Accessing an item that is before the current position is something that
// shouldn't normally happen because XmlSerializer calls indexer with a constantly
// increasing index that starts from zero.
// Trying to go backward requires the reset of the enumerator, followed by appropriate
// number of increments. (Enumerator acts as a forward-only iterator.)
if (index < _position)
{
_enumerator.Reset();
_position = -1;
}
while (_position < index)
{
_enumerator.MoveNext();
_position++;
}
//Checking if the object contained in Hashtable is also a Hashtable, then_
// convert same object into HashtableSerializationProxy object.
//e.g: objectH in Hashtable[Key, ObjectH] is also a Hashtable..,
// then objectH must converted into HashtableSerializationProxy, i.e. Hahtable[Key, new HashtableSerializationProxy(objectH)]
try
{
if (_enumerator.Entry.Value.GetType() == typeof(Hashtable))
{
HashtableSerializationProxy _InnerHashTableProxy = new HashtableSerializationProxy((Hashtable)_enumerator.Entry.Value);
_InnerDictionaryEntry = new DictionaryEntry(_enumerator.Entry.Key, _InnerHashTableProxy);
return _InnerDictionaryEntry;
}
else
{
return _enumerator.Entry;
}
}
catch(Exception ex)
{
return _InnerDictionaryEntry = new DictionaryEntry(_enumerator.Entry.Key, "");
}
}
}
示例11: 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();
}
示例12: EnumerableIteratorEntry
public EnumerableIteratorEntry(IPhpEnumerable/*!*/obj)
{
Debug.Assert(obj != null);
this.isValid = false;
this.enumerator = null;
this.currentKey = this.currentValue = null;
this.obj = obj;
}
示例13: rewind
public void rewind()
{
if (enumerator is PhpObject.PhpIteratorEnumerator)
((PhpObject.PhpIteratorEnumerator)enumerator).Reset(); // we can rewind() existing PhpIteratorEnumerator
else
enumerator = obj.GetForeachEnumerator(true, false, null); // we have to reinitialize (null or not PhpIteratorEnumerator)
isValid = false;// enumerator.MoveNext();
}
示例14: XPathCollectionEnumerator
public XPathCollectionEnumerator(Hashtable xpathes) {
hashEnum = xpathes.GetEnumerator();
}
示例15: Reset
public void Reset()
{
this.index = null;
}