Ejemplo n.º 1
0
            protected override ILStatement GenerateWriteInternal(ILValue prop, ILValue liaison, ILValue buffer)
            {
                ILBlock block = new ILBlock();

                if (IsPolymorphic())
                {
                    ILLocal type = block.CreateCementedLocal(prop.GetILTypeEX());

                    block.AddStatement(
                        new ILIf(
                            liaison.GetILField(nested_liaison_field).GetILInvoke("ValidateEX", prop).GetILIsFalse(),
                            GenerateInitialize(liaison, type)
                            )
                        );

                    block.AddStatement(buffer.GetILInvoke("WriteType", type));
                }
                else
                {
                    block.AddStatement(
                        new ILIf(
                            liaison.GetILField(nested_liaison_field).GetILIsNull(),
                            GenerateInitialize(liaison, GetPropType())
                            )
                        );
                }

                block.AddStatement(liaison.GetILField(nested_liaison_field).GetILInvoke("Write", prop, GetUpdateInterval(), buffer));
                return(block);
            }
Ejemplo n.º 2
0
        public ILLocal DefineLocal(TyonObject obj, ILValue value)
        {
            ILLocal local = block.CreateCementedLocal(value);

            object_to_local.Add(obj, local);

            if (obj.GetTyonAddress() != null)
            {
                internal_address_to_local.Add(obj.GetTyonAddress(), local);
            }

            return(local);
        }
Ejemplo n.º 3
0
            static private ILStatement GenerateInspectedObjectWrite_Polymorphic(ILValue value, ILValue buffer)
            {
                ILBlock block = new ILBlock();
                ILLocal type  = block.CreateCementedLocal(value.GetILTypeEX());

                block.AddStatement(buffer.GetILInvoke("WriteType", type));
                block.AddStatement(
                    new ILIf(
                        type.GetILIsNotNull(),
                        typeof(TypeSerializer).GetILInvoke("WriteObject", value)
                        )
                    );

                return(block);
            }