本文整理汇总了C#中System.MarshalByRefObject.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# MarshalByRefObject.GetType方法的具体用法?C# MarshalByRefObject.GetType怎么用?C# MarshalByRefObject.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.MarshalByRefObject
的用法示例。
在下文中一共展示了MarshalByRefObject.GetType方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetObjectSink
public IMessageSink GetObjectSink(MarshalByRefObject obj, IMessageSink nextSink)
{
if (obj.GetType().GetCustomAttributes(typeof(ONContextAttribute), true).Length > 0)
nextSink = new ONContextInterceptor(obj, nextSink, mOnContextClass);
return nextSink;
}
示例2: MockingProxy
public MockingProxy(MarshalByRefObject wrappedInstance, IInterceptor interceptor, IMockMixin mockMixin)
: base(wrappedInstance.GetType())
{
this.WrappedInstance = wrappedInstance;
this.interceptor = interceptor;
this.mockMixin = mockMixin;
}
示例3: Unregister
public void Unregister(MarshalByRefObject obj) {
ILease lease = (ILease)RemotingServices.GetLifetimeService(obj);
Debug.Assert(lease.CurrentState == LeaseState.Active);
lease.Unregister(this);
lock(this._lock) {
this._leaseList.Remove(lease);
Logger.Debug(this, "Stopped sponsoring lease #" + lease.GetHashCode() + " for proxy to " + obj.GetType().Name + ", id = #" + obj.GetHashCode() + ", url = " + RemotingServices.GetObjectUri(obj));
}
}
示例4: PostProcess
public void PostProcess(IMethodCallMessage callMsg, ref IMethodReturnMessage retMsg, MarshalByRefObject target)
{
Type type = target.GetType();
MethodInfo mi = type.GetMethod("UpdateSetting");
if (mi == null) return;
Settings = (Dictionary<string, string>)callMsg.Properties["_settings"];
if (Settings != null)
{
foreach (KeyValuePair<string, string> setting in Settings)
{
mi.Invoke(target, new object[] { setting.Key, setting.Value });
}
}
}
示例5: ServerIdentity
internal ServerIdentity(MarshalByRefObject obj, Context serverCtx) : base(obj is ContextBoundObject)
{
if (obj != null)
{
if (!RemotingServices.IsTransparentProxy(obj))
{
this._srvType = obj.GetType();
}
else
{
this._srvType = RemotingServices.GetRealProxy(obj).GetProxiedType();
}
}
this._srvCtx = serverCtx;
this._serverObjectChain = null;
this._stackBuilderSink = null;
}
示例6: ServerIdentity
// Creates a new server identity. This form is used by RemotingServices.Wrap
//
internal ServerIdentity(MarshalByRefObject obj, Context serverCtx) : base(obj is ContextBoundObject)
{
if(null != obj)
{
if(!RemotingServices.IsTransparentProxy(obj))
{
_srvType = obj.GetType();
}
else
{
RealProxy rp = RemotingServices.GetRealProxy(obj);
_srvType = rp.GetProxiedType();
}
}
_srvCtx = serverCtx;
_serverObjectChain = null;
_stackBuilderSink = null;
_refCount = 0;
}
示例7: MyProxy
public MyProxy(MarshalByRefObject target)
: base(target.GetType())
{
this.target = target;
}
示例8: PrevalentSystemProxy
public PrevalentSystemProxy(PrevalenceEngine engine, MarshalByRefObject system) : base(system.GetType())
{
_engine = engine;
_system = system;
}
示例9: MarshallableProxy
public MarshallableProxy(MarshalByRefObject targetObject, InvocationDelegate invoker)
: this(targetObject.GetType(), targetObject, invoker)
{
}
示例10: PrepareLocationFwdStream
private Stream PrepareLocationFwdStream(string host, ushort port,
MarshalByRefObject target) {
// loc fwd ior
byte[] objectKey = IorUtil.GetObjectKeyForObj(target);
string repositoryID = Repository.GetRepositoryID(target.GetType());
// this server support GIOP 1.2 --> create an GIOP 1.2 profile
InternetIiopProfile profile = new InternetIiopProfile(new GiopVersion(1, 2), host,
port, objectKey);
profile.AddTaggedComponent(Services.CodeSetService.CreateDefaultCodesetComponent(m_codec));
Ior locFwdTarget = new Ior(repositoryID, new IorProfile[] { profile });
CdrOutputStreamImpl iorStream = new CdrOutputStreamImpl(new MemoryStream(),
0, new GiopVersion(1, 2));
locFwdTarget.WriteToStream(iorStream);
uint encodedIorLength = (uint)iorStream.GetPosition();
// create the location fwd reply
MemoryStream sourceStream = new MemoryStream();
CdrOutputStreamImpl cdrOut = new CdrOutputStreamImpl(sourceStream, 0, new GiopVersion(1, 2));
cdrOut.WriteOpaque(m_giopMagic);
// version
cdrOut.WriteOctet(1);
cdrOut.WriteOctet(2);
// flags
cdrOut.WriteOctet(0);
// msg-type: reply
cdrOut.WriteOctet(1);
// msg-length
cdrOut.WriteULong(28 + encodedIorLength);
// request-id
cdrOut.WriteULong(5);
// reply-status: location fwd
cdrOut.WriteULong(3);
// one service context to enforce alignement requirement for giop 1.2
cdrOut.WriteULong(1);
cdrOut.WriteULong(162739); // service context id
cdrOut.WriteULong(2); // length of svc context
cdrOut.WriteBool(true);
cdrOut.WriteBool(false);
// svc context end
// body: 8 aligned
cdrOut.ForceWriteAlign(Aligns.Align8);
locFwdTarget.WriteToStream(cdrOut);
sourceStream.Seek(0, SeekOrigin.Begin);
return sourceStream;
}
示例11: CreateIorForObjectFromThisDomain
/// <summary>
/// creates an IOR for an object hosted in the local appdomain.
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
internal static Ior CreateIorForObjectFromThisDomain(MarshalByRefObject obj) {
return CreateIorForObjectFromThisDomain(obj, obj.GetType(), false);
}
示例12: Write174_MarshalByRefObject
private void Write174_MarshalByRefObject(string n, string ns, MarshalByRefObject o, bool isNullable, bool needType)
{
if (o == null)
{
if (isNullable)
{
base.WriteNullTagLiteral(n, ns);
}
}
else if (!needType)
{
System.Type type = o.GetType();
if (type != typeof(MarshalByRefObject))
{
if (type != typeof(Controller))
{
throw base.CreateUnknownTypeException(o);
}
this.Write175_Controller(n, ns, (Controller) o, isNullable, true);
}
}
}