Пример #1
0
        public virtual void Deserialize(object incoming)
        {
            var data = (Serial.FBComponent)incoming;

            ID     = FlatbufferSerializer.GetOrCreateDeserialize <UID>(data.Id);
            Entity = FlatbufferSerializer.GetOrCreateDeserialize <UID>(data.Entity);
        }
Пример #2
0
    public override void Deserialize(object data)
    {
        var input = (Serial./*name|pre#FB:ComponentName*/ FBGenTemplateComponent /*endname*/)data;

/*block:inheritance_deser*/ base.Deserialize(input.BaseData);
/*endblock:inheritance_deser*/
/*block:d_default*/        /*name:name*/ state /*endname*/ = (/*name:type*/ State /*endname*/)input./*name|fu:name*/ State /*endname*/; // string
/*endblock:d_default*/
/*block:d_nonprim*/     /*name:name*/ testUID /*endname*/ = FlatbufferSerializer.GetOrCreateDeserialize </*name:type*/ UID /*endname*/>(input./*name|fu:name*/ TestUID /*endname*/);
/*endblock:d_nonprim*/
/*block:d_prim_list*/        /*name:name*/ testListPrimitive /*endname*/ = FlatbufferSerializer.DeserializeList </*name:innertype:*/ int /*endname*/>(input./*name|fu,post#BufferPosition:name*/ TestListPrimitiveBufferPosition /*endname*/, input./*name|fu,pre#Get,post#Array:name*/ GetTestListPrimitiveArray /*endname*/);
/*endblock:d_prim_list*/
/*block:d_nonprim_list*/ {
            var tempList = new System.Collections.Generic.List <object>(); // first create List<object> of all results and then pass this to the Create-method. Didn't find a better way,yet Generics with T? do not work for interfaces
            for (int i = 0; i < input./*name|fu,post#Length:name*/ TestListUIDLength /*endname*/; i++)
            {
                tempList.Add(input./*name|fu:name*/ TestListUID/*endname*/ (i));
            }
            /*name:name*/ testListUID /*endname*/ = FlatbufferSerializer.DeserializeList </*name:innertype*/ UID /*endname*/, Serial./*name|pre#FB:innertype*/ FBUID /*endname*/>(input./*name|fu,post#BufferPosition:name*/ TestListUIDBufferPosition /*endname*/, input./*name|fu,post#Length:name*/ TestListUIDLength /*endname*/, tempList);
        }
/*endblock:d_nonprim_list*/
    }