怎样一句语Get属性返回 IEnumerable<Assembly>类型
游戏人间 2011-11-05 05:34:35 // Properties
private static IEnumerable<Assembly> AssembliesToSearch
{
get
{
return new <get_AssembliesToSearch>d__4(-2);
}
}
下列是红色行反编译生成的。
// Nested Types
[CompilerGenerated]
private sealed class <get_AssembliesToSearch>d__4 : IEnumerable<Assembly>, IEnumerable, IEnumerator<Assembly>, IEnumerator, IDisposable
{
// Fields
private int <>1__state;
private Assembly <>2__current;
public IEnumerator<AssemblyPart> <>7__wrap8;
private int <>l__initialThreadId;
public AssemblyPart <part>5__5;
public Stream <stream>5__7;
public StreamResourceInfo <streamResourceInfo>5__6;
// Methods
[DebuggerHidden]
public <get_AssembliesToSearch>d__4(int <>1__state)
{
this.<>1__state = <>1__state;
this.<>l__initialThreadId = Thread.CurrentThread.ManagedThreadId;
}
private void <>m__Finally9()
{
this.<>1__state = -1;
if (this.<>7__wrap8 != null)
{
this.<>7__wrap8.Dispose();
}
}
private void <>m__Finallya()
{
this.<>1__state = 2;
if (this.<stream>5__7 != null)
{
this.<stream>5__7.Dispose();
}
}
private bool MoveNext()
{
bool flag;
try
{
switch (this.<>1__state)
{
case 0:
this.<>1__state = -1;
this.<>2__current = typeof(Control).Assembly;
this.<>1__state = 1;
return true;
case 1:
this.<>1__state = -1;
this.<>7__wrap8 = Deployment.Current.Parts.GetEnumerator();
this.<>1__state = 2;
goto Label_00E9;
case 4:
this.<>1__state = 3;
this.<>m__Finallya();
goto Label_00E9;
default:
goto Label_00FF;
}
Label_0075:
this.<part>5__5 = this.<>7__wrap8.Current;
this.<streamResourceInfo>5__6 = Application.GetResourceStream(new Uri(this.<part>5__5.Source, UriKind.Relative));
this.<stream>5__7 = this.<streamResourceInfo>5__6.Stream;
this.<>1__state = 3;
this.<>2__current = this.<part>5__5.Load(this.<stream>5__7);
this.<>1__state = 4;
return true;
Label_00E9:
if (this.<>7__wrap8.MoveNext())
{
goto Label_0075;
}
this.<>m__Finally9();
Label_00FF:
flag = false;
}
fault
{
this.System.IDisposable.Dispose();
}
return flag;
}
[DebuggerHidden]
IEnumerator<Assembly> IEnumerable<Assembly>.GetEnumerator()
{
if ((Thread.CurrentThread.ManagedThreadId == this.<>l__initialThreadId) && (this.<>1__state == -2))
{
this.<>1__state = 0;
return this;
}
return new SetterValueBindingHelper.<get_AssembliesToSearch>d__4(0);
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return this.System.Collections.Generic.IEnumerable<System.Reflection.Assembly>.GetEnumerator();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
void IDisposable.Dispose()
{
switch (this.<>1__state)
{
case 2:
case 3:
case 4:
try
{
switch (this.<>1__state)
{
case 3:
case 4:
try
{
}
finally
{
this.<>m__Finallya();
}
break;
}
}
finally
{
this.<>m__Finally9();
}
break;
default:
return;
}
}
// Properties
Assembly IEnumerator<Assembly>.Current
{
[DebuggerHidden]
get
{
return this.<>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return this.<>2__current;
}
}
}