コード例 #1
0
        private PropInfoEX HydrateAsMethodPair(HuskReader reader)
        {
            MethodInfoEX set_method = MethodInfoEXHusker.INSTANCE.Hydrate(reader);
            MethodInfoEX get_method = MethodInfoEXHusker.INSTANCE.Hydrate(reader);

            return(new PropInfoEX_MethodPair(set_method, get_method));
        }
コード例 #2
0
        public override Module Hydrate(HuskReader reader)
        {
            string module_name = reader.ReadString();

            if (module_name != "")
            {
                return(reader.ReadRecurrant(AssemblyHusker.INSTANCE).GetModule(module_name));
            }

            return(null);
        }
コード例 #3
0
        public override Assembly Hydrate(HuskReader reader)
        {
            string full_name = reader.ReadString();

            if (full_name != "")
            {
                return(Assembly.Load(full_name));
            }

            return(null);
        }
コード例 #4
0
        public override FieldInfoEX Hydrate(HuskReader reader)
        {
            int metadata_token = reader.ReadInt();

            if (metadata_token != 0)
            {
                return(reader.ReadRecurrant(TypeHusker.INSTANCE).ResolveField(metadata_token));
            }

            return(null);
        }
コード例 #5
0
        public override PropInfoEX Hydrate(HuskReader reader)
        {
            byte type_token = reader.ReadByte();

            switch (type_token)
            {
            case 1: return(HydrateAsField(reader));

            case 2: return(HydrateAsMethodPair(reader));
            }

            return(null);
        }
コード例 #6
0
        private AttemptResult Read(string filename, out T data)
        {
            return(STREAM_SYSTEM.AttemptRead(filename, delegate(Stream stream, out T inner_data) {
                HuskReader reader = new HuskReader(stream);

                if (reader.VerifyVersionHeader())
                {
                    inner_data = husker.Hydrate(reader);
                    return true;
                }

                inner_data = default(T);
                return false;
            }, out data, 0));
        }
コード例 #7
0
        public override Type Hydrate(HuskReader reader)
        {
            int metadata_token = reader.ReadInt();

            if (metadata_token != 0)
            {
                Type type = reader.ReadRecurrant(ModuleHusker.INSTANCE).ResolveType(metadata_token);

                if (type.IsGenericClass())
                {
                    if (reader.ReadBoolBranch())
                    {
                        return(type.MakeGenericType(TypeListHusker.INSTANCE.Hydrate(reader).ToArray()));
                    }
                }

                return(type);
            }

            return(null);
        }
コード例 #8
0
        public override MethodInfoEX Hydrate(HuskReader reader)
        {
            int metadata_token = reader.ReadInt();

            if (metadata_token != 0)
            {
                MethodInfoEX method = reader.ReadRecurrant(TypeHusker.INSTANCE).ResolveMethod(metadata_token);

                if (method.IsGenericMethod())
                {
                    if (reader.ReadBoolBranch())
                    {
                        return(method.MakeGenericMethod(TypeListHusker.INSTANCE.Hydrate(reader).ToArray())
                               .GetMethodInfoEX());
                    }
                }

                return(method);
            }

            return(null);
        }
コード例 #9
0
        private PropInfoEX HydrateAsField(HuskReader reader)
        {
            FieldInfoEX field = FieldInfoEXHusker.INSTANCE.Hydrate(reader);

            return(new PropInfoEX_Field(field));
        }
コード例 #10
0
 static public bool VerifyVersionHeader(this HuskReader item)
 {
     return(item.VerifyHeader(VersionInfo.GetId().GetBytes()));
 }