Advertisement
Guest User

ProtoBuf ModelSerializer Example

a guest
Nov 4th, 2012
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using ProtoBuf.Meta;
  4. using DataModels;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             var model = TypeModel.Create();
  13.             model.Add(typeof(EntityState), true);
  14.             model.Add(typeof(EntityStateList), true);
  15.             model.Add(typeof(MyVector3), true);
  16.             model.Add(typeof(MyQuaternion), true);
  17.  
  18.             model.AllowParseableTypes = true;
  19.             model.AutoAddMissingTypes = true;
  20.  
  21.             model.Compile("ModelSerializer", "ModelSerializer.dll");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement