scripts
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
|
||||
namespace System.Runtime.Remoting.Contexts
|
||||
{
|
||||
// Token: 0x020003B9 RID: 953
|
||||
internal class DynamicPropertyCollection
|
||||
{
|
||||
// Token: 0x1700071D RID: 1821
|
||||
// (get) Token: 0x0600260A RID: 9738 RVA: 0x0007D9E0 File Offset: 0x0007BBE0
|
||||
public bool HasProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._properties.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600260B RID: 9739 RVA: 0x0007D9F0 File Offset: 0x0007BBF0
|
||||
public bool RegisterDynamicProperty(IDynamicProperty prop)
|
||||
{
|
||||
bool flag;
|
||||
lock (this)
|
||||
{
|
||||
if (this.FindProperty(prop.Name) != -1)
|
||||
{
|
||||
throw new InvalidOperationException("Another property by this name already exists");
|
||||
}
|
||||
ArrayList arrayList = new ArrayList(this._properties);
|
||||
DynamicPropertyCollection.DynamicPropertyReg dynamicPropertyReg = new DynamicPropertyCollection.DynamicPropertyReg();
|
||||
dynamicPropertyReg.Property = prop;
|
||||
IContributeDynamicSink contributeDynamicSink = prop as IContributeDynamicSink;
|
||||
if (contributeDynamicSink != null)
|
||||
{
|
||||
dynamicPropertyReg.Sink = contributeDynamicSink.GetDynamicSink();
|
||||
}
|
||||
arrayList.Add(dynamicPropertyReg);
|
||||
this._properties = arrayList;
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x0600260C RID: 9740 RVA: 0x0007DA98 File Offset: 0x0007BC98
|
||||
public bool UnregisterDynamicProperty(string name)
|
||||
{
|
||||
bool flag;
|
||||
lock (this)
|
||||
{
|
||||
int num = this.FindProperty(name);
|
||||
if (num == -1)
|
||||
{
|
||||
throw new RemotingException("A property with the name " + name + " was not found");
|
||||
}
|
||||
this._properties.RemoveAt(num);
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x0600260D RID: 9741 RVA: 0x0007DB10 File Offset: 0x0007BD10
|
||||
public void NotifyMessage(bool start, IMessage msg, bool client_site, bool async)
|
||||
{
|
||||
ArrayList properties = this._properties;
|
||||
if (start)
|
||||
{
|
||||
foreach (object obj in properties)
|
||||
{
|
||||
DynamicPropertyCollection.DynamicPropertyReg dynamicPropertyReg = (DynamicPropertyCollection.DynamicPropertyReg)obj;
|
||||
if (dynamicPropertyReg.Sink != null)
|
||||
{
|
||||
dynamicPropertyReg.Sink.ProcessMessageStart(msg, client_site, async);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (object obj2 in properties)
|
||||
{
|
||||
DynamicPropertyCollection.DynamicPropertyReg dynamicPropertyReg2 = (DynamicPropertyCollection.DynamicPropertyReg)obj2;
|
||||
if (dynamicPropertyReg2.Sink != null)
|
||||
{
|
||||
dynamicPropertyReg2.Sink.ProcessMessageFinish(msg, client_site, async);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600260E RID: 9742 RVA: 0x0007DC18 File Offset: 0x0007BE18
|
||||
private int FindProperty(string name)
|
||||
{
|
||||
for (int i = 0; i < this._properties.Count; i++)
|
||||
{
|
||||
if (((DynamicPropertyCollection.DynamicPropertyReg)this._properties[i]).Property.Name == name)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Token: 0x04000ED9 RID: 3801
|
||||
private ArrayList _properties = new ArrayList();
|
||||
|
||||
// Token: 0x020003BA RID: 954
|
||||
private class DynamicPropertyReg
|
||||
{
|
||||
// Token: 0x04000EDA RID: 3802
|
||||
public IDynamicProperty Property;
|
||||
|
||||
// Token: 0x04000EDB RID: 3803
|
||||
public IDynamicMessageSink Sink;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user