示例#1
0
        /// Called from Binder which lives in a separate dll.
        public static SystemType Register(string name,
                                          long lowerHash,
                                          long upperHash,
                                          SystemType parent)
        {
            RuntimeSystemType parentrts = HandleTable.GetHandle(parent.id) as RuntimeSystemType;

#if false
            DebugStub.WriteLine("SystemType.Register '{0}' hash0={1:x8} hash1={2:x8} Parent {3}",
                                __arglist(name, lowerHash, upperHash, parent.TypeId));

            Tracing.Log(Tracing.Debug, "Type '{0}' (parent={1:x8})",
                        name, parent.id);
            Tracing.Log(Tracing.Debug, "hash0={0:x8} hash1={1:x8}",
                        lowerHash.ToString(), upperHash.ToString());
#endif // false

            UIntPtr childHandle = parentrts.LookupChildHandle(name, lowerHash, upperHash);

#if false
            Tracing.Log(Tracing.Debug, "result UIntPtr = {0:x8}", childHandle);
#endif // false

            SystemType ret = new SystemType(childHandle);
            return(ret);
        }
示例#2
0
        private static bool IsSubtype(UIntPtr childHandle, UIntPtr parentHandle)
        {
            if (childHandle == UIntPtr.Zero)
            {
                return(false);
            }
            if (parentHandle == UIntPtr.Zero)
            {
                return(false);
            }

            RuntimeSystemType childrts = HandleTable.GetHandle(childHandle) as RuntimeSystemType;

            if (childrts == null)
            {
                DebugStub.Print("Ack! Runtime: IsSubType is null!\n");
                return(false);
            }

            bool ret = childrts.IsSubtype(parentHandle);

            if (ret)
            {
#if false
                Tracing.Log(Tracing.Debug,
                            "SystemType.IsSubtype(parent={0:x8}, child={1:x8}) = [true]",
                            parentHandle, childHandle);

                DebugStub.WriteLine("SystemType.IsSubtype(parent={0:x8}, child={1:x8}) = [true]",
                                    __arglist(parentHandle, childHandle)
                                    );
#endif
            }
            else
            {
#if false
                Tracing.Log(Tracing.Debug,
                            "SystemType.IsSubtype(parent={0:x8}, child={1:x8}) = [false]",
                            parentHandle, childHandle);

                DebugStub.WriteLine("SystemType.IsSubtype(parent={0:x8}, child={1:x8}) = [false]",
                                    __arglist(parentHandle, childHandle)
                                    );
#endif
            }
            return(ret);
        }
示例#3
0
        public static SystemType RootSystemType()
        {
            UIntPtr rootRuntimeSystemTypeHandle = RuntimeSystemType.GetRootHandle();

            return(new SystemType(rootRuntimeSystemTypeHandle));
        }