System.Runtime.InteropServices.RegistrationServices.TypeRepresentsComType C# (CSharp) Method

TypeRepresentsComType() private method

private TypeRepresentsComType ( Type type ) : bool
type System.Type
return bool
		public virtual bool TypeRepresentsComType (Type type)
		{
			throw new NotImplementedException ();
		}

Usage Example

コード例 #1
0
        static void WriteTypes(Stream s, Type[] aTypes, int offset)
        {
            RegistrationServices regServices = new RegistrationServices();
            String name = null;

            Assembly asm = Assembly.GetExecutingAssembly();
            string asmver = asm.ImageRuntimeVersion;


            foreach (Type t in aTypes)
            {
                // only registrable managed types will show up in the manifest file
                if (!regServices.TypeRequiresRegistration(t))
                {
                    throw Fx.AssertAndThrow("User defined types must be registrable");
                }
                
                String strClsId = "{" + Marshal.GenerateGuidForType(t).ToString().ToUpperInvariant() + "}";
                name = t.FullName;

                // this type is a com imported type or Record
                if (regServices.TypeRepresentsComType(t) || t.IsValueType)
                {
                    WriteUTFChars(s, "<clrSurrogate" + Environment.NewLine, offset);
                    // attribute clsid
                    WriteUTFChars(s, "    clsid=\"" + strClsId + "\"" + Environment.NewLine, offset);    
                    
                    // attribute class
                    WriteUTFChars(s, "    name=\"" + name + "\"" + Environment.NewLine, offset);
                    // clr version
                    WriteUTFChars(s, "    runtimeVersion=\"" + asmver + "\">" + Environment.NewLine, offset);

                    WriteUTFChars(s, "</clrSurrogate>" + Environment.NewLine, offset);
                }                
            }
        }
All Usage Examples Of System.Runtime.InteropServices.RegistrationServices::TypeRepresentsComType