有人能帮俺解释一下下面这段代码吗?主要是private sealed class <get_CacheItems>d__0这一个类,"<>"符号是干什么用的,有相关的教程吗?internal class HashStorage : AbstractStorage
{
private Hashtable maps; public override bool Add(ICacheItem item)
{
if (item == null)
{
throw new ArgumentNullException();
}
bool flag = false;
CacheItem item2 = null;
lock (this.maps.SyncRoot)
{
item2 = (CacheItem) this.maps[item.Key];
if (item2 == null)
{
this.maps[item.Key] = item;
flag = true;
}
else
{
item2.Value = item.Value;
}
}
if (flag)
{
base.OnCacheItemAdded(item);
return flag;
}
base.OnCacheItemValueChanged(item2);
return flag;
} public override object Clone()
{
lock (this.maps.SyncRoot)
{
return this.maps.Clone();
}
} public override bool Contains(object key)
{
return this.maps.Contains(key);
} public override void Flush()
{
lock (this.maps.SyncRoot)
{
this.maps.Clear();
}
} public override ICacheItem GetData(object key)
{
if (key == null)
{
return null;
}
CacheItem item = (CacheItem) this.maps[key];
if (item == null)
{
return null;
}
base.OnCacheItemHit(item);
return item;
} public override void Init(int capacity)
{
this.maps = new Hashtable(capacity);
} public override void Remove(object key)
{
if (key != null)
{
CacheItem item = null;
lock (this.maps.SyncRoot)
{
item = (CacheItem) this.maps[key];
this.maps.Remove(key);
}
if (item != null)
{
base.OnCacheItemRemoved(item);
}
}
} public override IEnumerable<ICacheItem> CacheItems
{
get
{
<get_CacheItems>d__0 d__ = new <get_CacheItems>d__0(-2);
d__.<>4__this = this;
return d__;
}
} public override int Size
{
get
{
return this.maps.Count;
}
} [CompilerGenerated]
private sealed class <get_CacheItems>d__0 : IEnumerable<ICacheItem>, IEnumerable, IEnumerator<ICacheItem>, IEnumerator, IDisposable
{
private int <>1__state;
private ICacheItem <>2__current;
public HashStorage <>4__this;
public IEnumerator <>7__wrap2;
public IDisposable <>7__wrap3;
public object <citem>5__1; [DebuggerHidden]
public <get_CacheItems>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
} private bool MoveNext()
{
try
{
switch (this.<>1__state)
{
case 0:
this.<>1__state = -1;
this.<>7__wrap2 = this.<>4__this.maps.Values.GetEnumerator();
this.<>1__state = 1;
while (this.<>7__wrap2.MoveNext())
{
this.<citem>5__1 = this.<>7__wrap2.Current;
this.<>2__current = (ICacheItem) this.<citem>5__1;
this.<>1__state = 2;
return true;
Label_007F:
this.<>1__state = 1;
}
this.<>1__state = -1;
this.<>7__wrap3 = this.<>7__wrap2 as IDisposable;
if (this.<>7__wrap3 != null)
{
this.<>7__wrap3.Dispose();
}
break; case 2:
goto Label_007F;
}
return false;
}
fault
{
((IDisposable) this).Dispose();
}
} [DebuggerHidden]
IEnumerator<ICacheItem> IEnumerable<ICacheItem>.GetEnumerator()
{
if (Interlocked.CompareExchange(ref this.<>1__state, 0, -2) == -2)
{
return this;
}
HashStorage.<get_CacheItems>d__0 d__ = new HashStorage.<get_CacheItems>d__0(0);
d__.<>4__this = this.<>4__this;
return d__;
} [DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return this.System.Collections.Generic.IEnumerable<UFSoft.UBF.Util.Cache.ICacheItem>.GetEnumerator();
} [DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
} void IDisposable.Dispose()
{
switch (this.<>1__state)
{
case 1:
case 2:
try
{
}
finally
{
this.<>1__state = -1;
this.<>7__wrap3 = this.<>7__wrap2 as IDisposable;
if (this.<>7__wrap3 != null)
{
this.<>7__wrap3.Dispose();
}
}
break;
}
} ICacheItem IEnumerator<ICacheItem>.Current
{
[DebuggerHidden]
get
{
return this.<>2__current;
}
} object IEnumerator.Current
{
[DebuggerHidden]
get
{
return this.<>2__current;
}
}
}
}
{
private Hashtable maps; public override bool Add(ICacheItem item)
{
if (item == null)
{
throw new ArgumentNullException();
}
bool flag = false;
CacheItem item2 = null;
lock (this.maps.SyncRoot)
{
item2 = (CacheItem) this.maps[item.Key];
if (item2 == null)
{
this.maps[item.Key] = item;
flag = true;
}
else
{
item2.Value = item.Value;
}
}
if (flag)
{
base.OnCacheItemAdded(item);
return flag;
}
base.OnCacheItemValueChanged(item2);
return flag;
} public override object Clone()
{
lock (this.maps.SyncRoot)
{
return this.maps.Clone();
}
} public override bool Contains(object key)
{
return this.maps.Contains(key);
} public override void Flush()
{
lock (this.maps.SyncRoot)
{
this.maps.Clear();
}
} public override ICacheItem GetData(object key)
{
if (key == null)
{
return null;
}
CacheItem item = (CacheItem) this.maps[key];
if (item == null)
{
return null;
}
base.OnCacheItemHit(item);
return item;
} public override void Init(int capacity)
{
this.maps = new Hashtable(capacity);
} public override void Remove(object key)
{
if (key != null)
{
CacheItem item = null;
lock (this.maps.SyncRoot)
{
item = (CacheItem) this.maps[key];
this.maps.Remove(key);
}
if (item != null)
{
base.OnCacheItemRemoved(item);
}
}
} public override IEnumerable<ICacheItem> CacheItems
{
get
{
<get_CacheItems>d__0 d__ = new <get_CacheItems>d__0(-2);
d__.<>4__this = this;
return d__;
}
} public override int Size
{
get
{
return this.maps.Count;
}
} [CompilerGenerated]
private sealed class <get_CacheItems>d__0 : IEnumerable<ICacheItem>, IEnumerable, IEnumerator<ICacheItem>, IEnumerator, IDisposable
{
private int <>1__state;
private ICacheItem <>2__current;
public HashStorage <>4__this;
public IEnumerator <>7__wrap2;
public IDisposable <>7__wrap3;
public object <citem>5__1; [DebuggerHidden]
public <get_CacheItems>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
} private bool MoveNext()
{
try
{
switch (this.<>1__state)
{
case 0:
this.<>1__state = -1;
this.<>7__wrap2 = this.<>4__this.maps.Values.GetEnumerator();
this.<>1__state = 1;
while (this.<>7__wrap2.MoveNext())
{
this.<citem>5__1 = this.<>7__wrap2.Current;
this.<>2__current = (ICacheItem) this.<citem>5__1;
this.<>1__state = 2;
return true;
Label_007F:
this.<>1__state = 1;
}
this.<>1__state = -1;
this.<>7__wrap3 = this.<>7__wrap2 as IDisposable;
if (this.<>7__wrap3 != null)
{
this.<>7__wrap3.Dispose();
}
break; case 2:
goto Label_007F;
}
return false;
}
fault
{
((IDisposable) this).Dispose();
}
} [DebuggerHidden]
IEnumerator<ICacheItem> IEnumerable<ICacheItem>.GetEnumerator()
{
if (Interlocked.CompareExchange(ref this.<>1__state, 0, -2) == -2)
{
return this;
}
HashStorage.<get_CacheItems>d__0 d__ = new HashStorage.<get_CacheItems>d__0(0);
d__.<>4__this = this.<>4__this;
return d__;
} [DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return this.System.Collections.Generic.IEnumerable<UFSoft.UBF.Util.Cache.ICacheItem>.GetEnumerator();
} [DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
} void IDisposable.Dispose()
{
switch (this.<>1__state)
{
case 1:
case 2:
try
{
}
finally
{
this.<>1__state = -1;
this.<>7__wrap3 = this.<>7__wrap2 as IDisposable;
if (this.<>7__wrap3 != null)
{
this.<>7__wrap3.Dispose();
}
}
break;
}
} ICacheItem IEnumerator<ICacheItem>.Current
{
[DebuggerHidden]
get
{
return this.<>2__current;
}
} object IEnumerator.Current
{
[DebuggerHidden]
get
{
return this.<>2__current;
}
}
}
}
解决方案 »
- 一个的WCF的问题,关于数据契约和消息契约
- 【简单问题】listBox中元素比较
- C#中,点击dataGridView某列任一单元格,在该单元格旁边弹出另一个窗体
- 请问怎样实现这样的人员排班表功能?不求有代码,只求思路,谢谢
- 请问这个进度条方法怎么用 急急急
- 快被折磨死了,程序运行上几次就会出现这个错误,晕了!
- 请大家帮帮忙呀? 问题解决了给300分呀!
- 各位大神,求帮助啊。关于richtextbox中搜寻关键字着色的问题
- 如何编程实现像资源管理器“发送到”或者用文件拖动启动一个执行文件的功能?
- 关于SendMessage的问题????
- 模态对话框的返回值问题
- winform:判断多个comboBox框输入的数据是不是有重复
要还原,你先得大致了解这些代码中哪些特殊符号是混淆工具加上去。
比如:private sealed class <get_CacheItems>d__0
直接重构成 get_CacheItems_d__0,其实初看了一下,就要是把代码中的<>的不合语法的地方去掉就可以了。