public virtual void RegisterSerialization(long root,
                                           IglRegisterType registryToken,
                                           Dictionary <string, long> specials)
 {
     _script.SpecialInitializations.AddLast(
         new IglSpecialSerialization(_idCounter++, root, registryToken, specials));
 }
        /// <summary>
        ///     Register the data, and related types associated with the
        ///     objType passed into this function
        /// </summary>
        /// <param name="objType"></param>
        public void RegisterType(Type objType)
        {
            if (_typeMap.TryGetId(objType, out var igl))
            {
                return;
            }

            var name = objType.AssemblyQualifiedName;

            if (string.IsNullOrEmpty(name))
            {
                return;
            }

            igl = new IglRegisterType(_idCounter++, objType.AssemblyQualifiedName);
            _typeMap.Map(igl, objType);

            _script.TypeDef.AddLast(igl);
            objType.ResolveRelatedTypes(_knownTypes);
            foreach (var type in _knownTypes)
            {
                RegisterType(type);
            }
        }
 public void RegisterSerialization(object o, IglRegisterType regToken, SerializationInfo info)
 {
     _serializationWork.AddWorkFor(Tuple.Create(o, regToken, info));
 }