IRemotingTypeInfo.TypeName Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el nombre completo del objeto de servidor en un objeto ObjRef.
public:
property System::String ^ TypeName { System::String ^ get(); void set(System::String ^ value); };
public string TypeName { get; set; }
public string TypeName { [System.Security.SecurityCritical] get; [System.Security.SecurityCritical] set; }
member this.TypeName : string with get, set
[<get: System.Security.SecurityCritical>]
[<set: System.Security.SecurityCritical>]
member this.TypeName : string with get, set
Public Property TypeName As String
Valor de propiedad
Nombre completo del objeto de servidor en un objeto ObjRef.
- Atributos
Excepciones
El autor de la llamada inmediato realiza la llamada mediante una referencia a la interfaz y no tiene permiso de infraestructura.
Ejemplos
ObjRef^ objRefSample = RemotingServices::GetObjRefForProxy( myRemoteObject );
Console::WriteLine( "***ObjRef Details***" );
Console::WriteLine( "URI:\t {0}", objRefSample->URI );
array<Object^>^channelData = objRefSample->ChannelInfo->ChannelData;
Console::WriteLine( "Channel Info:" );
for each(Object^ o in channelData)
Console::WriteLine("\t{0}", o->ToString());
IEnvoyInfo^ envoyInfo = objRefSample->EnvoyInfo;
if ( envoyInfo == nullptr )
{
Console::WriteLine( "This ObjRef does not have envoy information." );
}
else
{
IMessageSink^ envoySinks = envoyInfo->EnvoySinks;
Console::WriteLine( "Envoy Sink Class: {0}", envoySinks );
}
IRemotingTypeInfo^ typeInfo = objRefSample->TypeInfo;
Console::WriteLine( "Remote type name: {0}", typeInfo->TypeName );
Console::WriteLine( "Can my Object cast to a Bitmap? {0}", typeInfo->CanCastTo( System::Drawing::Bitmap::typeid, objRefSample ) );
Console::WriteLine( "Is this Object from this AppDomain? {0}", objRefSample->IsFromThisAppDomain() );
Console::WriteLine( "Is this Object from this process? {0}", objRefSample->IsFromThisProcess() );
ObjRef objRefSample = RemotingServices.GetObjRefForProxy(myRemoteObject);
Console.WriteLine("***ObjRef Details***");
Console.WriteLine("URI:\t{0}", objRefSample.URI);
object[] channelData = objRefSample.ChannelInfo.ChannelData;
Console.WriteLine("Channel Info:");
foreach(object o in channelData)
Console.WriteLine("\t{0}", o.ToString());
IEnvoyInfo envoyInfo = objRefSample.EnvoyInfo;
if (envoyInfo == null) {
Console.WriteLine("This ObjRef does not have envoy information.");
}
else {
IMessageSink envoySinks = envoyInfo.EnvoySinks;
Console.WriteLine("Envoy Sink Class: {0}", envoySinks);
}
IRemotingTypeInfo typeInfo = objRefSample.TypeInfo;
Console.WriteLine("Remote type name: {0}", typeInfo.TypeName);
Console.WriteLine("Can my object cast to a Bitmap? {0}",
typeInfo.CanCastTo(typeof(System.Drawing.Bitmap), objRefSample));
Console.WriteLine("Is this object from this AppDomain? {0}", objRefSample.IsFromThisAppDomain());
Console.WriteLine("Is this object from this process? {0}", objRefSample.IsFromThisProcess());
Dim objRefSample As ObjRef = RemotingServices.GetObjRefForProxy(myRemoteObject)
Console.WriteLine("***ObjRef Details***")
Console.WriteLine("URI:" + ControlChars.Tab + "{0}", objRefSample.URI)
Dim channelData As Object() = objRefSample.ChannelInfo.ChannelData
Console.WriteLine("Channel Info:")
Dim o As Object
For Each o In channelData
Console.WriteLine(ControlChars.Tab + "{0}", o.ToString())
Next o
Dim envoyInfo As IEnvoyInfo = objRefSample.EnvoyInfo
If envoyInfo Is Nothing Then
Console.WriteLine("This ObjRef does not have envoy information.")
Else
Dim envoySinks As IMessageSink = envoyInfo.EnvoySinks
Console.WriteLine("Envoy Sink Class: {0}", envoySinks)
End If
Dim typeInfo As IRemotingTypeInfo = objRefSample.TypeInfo
Console.WriteLine("Remote type name: {0}", typeInfo.TypeName)
Console.WriteLine("Can my object cast to a Bitmap? {0}", typeInfo.CanCastTo(GetType(System.Drawing.Bitmap), objRefSample))
Console.WriteLine("Is this object from this AppDomain? {0}", objRefSample.IsFromThisAppDomain())
Console.WriteLine("Is this object from this process? {0}", objRefSample.IsFromThisProcess())
Se aplica a
Col·laboreu amb nosaltres a GitHub
La font d'aquest contingut es pot trobar al GitHub, on també podeu crear i revisar problemes i sol·licituds d'extracció. Per obtenir més informació, consulteu la nostra guia per a col·laboradors.