本文整理汇总了C#中RuntimeType.GetRuntimeAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimeType.GetRuntimeAssembly方法的具体用法?C# RuntimeType.GetRuntimeAssembly怎么用?C# RuntimeType.GetRuntimeAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuntimeType
的用法示例。
在下文中一共展示了RuntimeType.GetRuntimeAssembly方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetXmlNamespaceForTypeNamespace
internal static string GetXmlNamespaceForTypeNamespace(RuntimeType type, string dynamicUrl)
{
string str = type.Namespace;
RuntimeAssembly runtimeAssembly = type.GetRuntimeAssembly();
StringBuilder builder = new StringBuilder(0x100);
Assembly assembly = typeof(string).Module.Assembly;
if (runtimeAssembly == assembly)
{
builder.Append(SoapServices.namespaceNS);
builder.Append(str);
}
else
{
builder.Append(SoapServices.fullNS);
builder.Append(str);
builder.Append('/');
builder.Append(runtimeAssembly.GetSimpleName());
}
return builder.ToString();
}
示例2: VerifyNotIRemoteDispatch
[System.Security.SecurityCritical] // auto-generated
private static void VerifyNotIRemoteDispatch(RuntimeType reflectedType)
{
if(reflectedType.FullName.Equals(sIRemoteDispatch) &&
reflectedType.GetRuntimeAssembly().GetSimpleName().Equals(sIRemoteDispatchAssembly))
{
throw new RemotingException(
Environment.GetResourceString("Remoting_CantInvokeIRemoteDispatch"));
}
}
示例3: CanCastToXmlTypeHelper
[System.Security.SecuritySafeCritical] // auto-generated
internal static bool CanCastToXmlTypeHelper(RuntimeType castType, MarshalByRefObject o)
{
if (castType == null)
throw new ArgumentNullException("castType");
Contract.EndContractBlock();
// MarshalByRefObject's can only be casted to MarshalByRefObject's or interfaces.
if (!castType.IsInterface && !castType.IsMarshalByRef)
return false;
// figure out xml type name
String xmlTypeName = null;
String xmlTypeNamespace = null;
if (!SoapServices.GetXmlTypeForInteropType(castType, out xmlTypeName, out xmlTypeNamespace))
{
// There's no registered interop type name, so just use the default.
xmlTypeName = castType.Name;
xmlTypeNamespace =
SoapServices.CodeXmlNamespaceForClrTypeNamespace(
castType.Namespace, castType.GetRuntimeAssembly().GetSimpleName());
}
return o.CanCastToXmlType(xmlTypeName, xmlTypeNamespace);
} // CanCastToXmlType
示例4: GetUnitySerializationInfo
internal static void GetUnitySerializationInfo(SerializationInfo info, RuntimeType type)
{
if (type.GetRootElementType().IsGenericParameter)
{
type = AddElementTypes(info, type);
info.SetType(typeof(UnitySerializationHolder));
info.AddValue("UnityType", GenericParameterTypeUnity);
info.AddValue("GenericParameterPosition", type.GenericParameterPosition);
info.AddValue("DeclaringMethod", type.DeclaringMethod, typeof(MethodBase));
info.AddValue("DeclaringType", type.DeclaringType, typeof(Type));
return;
}
int unityType = RuntimeTypeUnity;
if (!type.IsGenericTypeDefinition && type.ContainsGenericParameters)
{
// Partial instantiation
unityType = PartialInstantiationTypeUnity;
type = AddElementTypes(info, type);
info.AddValue("GenericArguments", type.GetGenericArguments(), typeof(Type[]));
type = (RuntimeType)type.GetGenericTypeDefinition();
}
GetUnitySerializationInfo(info, unityType, type.FullName, type.GetRuntimeAssembly());
}
示例5: CanCastToXmlTypeHelper
internal static bool CanCastToXmlTypeHelper(RuntimeType castType, MarshalByRefObject o)
{
if (castType == null)
{
throw new ArgumentNullException("castType");
}
if (!castType.IsInterface && !castType.IsMarshalByRef)
{
return false;
}
string xmlType = null;
string xmlTypeNamespace = null;
if (!SoapServices.GetXmlTypeForInteropType(castType, out xmlType, out xmlTypeNamespace))
{
xmlType = castType.Name;
xmlTypeNamespace = SoapServices.CodeXmlNamespaceForClrTypeNamespace(castType.Namespace, castType.GetRuntimeAssembly().GetSimpleName());
}
return o.CanCastToXmlType(xmlType, xmlTypeNamespace);
}
示例6: GetXmlNamespaceForTypeNamespace
[System.Security.SecurityCritical] // auto-generated
internal static String GetXmlNamespaceForTypeNamespace(RuntimeType type, String dynamicUrl)
{
String typeNamespace = type.Namespace;
RuntimeAssembly assem = type.GetRuntimeAssembly();
StringBuilder sb = new StringBuilder(256);
Assembly systemAssembly = typeof(String).Module.Assembly;
if(assem == systemAssembly)
{
sb.Append(SoapServices.namespaceNS);
sb.Append(typeNamespace);
}
else
{
sb.Append(SoapServices.fullNS);
sb.Append(typeNamespace);
sb.Append('/');
sb.Append(assem.GetSimpleName());
}
return sb.ToString();
} // GetXmlNamespaceForTypeNamespace