当前位置: 首页>>代码示例>>C#>>正文


C# RuntimeType.GetRuntimeAssembly方法代码示例

本文整理汇总了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();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:XmlNamespaceEncoder.cs

示例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")); 
     }
 } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:10,代码来源:StackBuilderSink.cs

示例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
开发者ID:l1183479157,项目名称:coreclr,代码行数:25,代码来源:MarshalByRefObject.cs

示例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());
        }
开发者ID:ChuangYang,项目名称:coreclr,代码行数:27,代码来源:UnitySerializationHolder.cs

示例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);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:MarshalByRefObject.cs

示例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
开发者ID:wsky,项目名称:System.Runtime.Remoting,代码行数:23,代码来源:Soap.cs


注:本文中的RuntimeType.GetRuntimeAssembly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。