Beispiel #1
0
 public static void AddToPacket(ILazyValue value, Packet packet)
 {
     packet.AddInt32(value.RawValue);
     packet.AddInt32(value.Rate);
     packet.AddInt32(value.Upkeep);
     packet.AddInt32(value.Limit);
     packet.AddUInt32(UnixDateTime.DateTimeToUnix(value.LastRealizeTime.ToUniversalTime()));
 }
Beispiel #2
0
 public virtual void RegisterType(Type type, ILazyValue lazyInstance, params object[] options)
 {
     if (type == null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     if (lazyInstance == null)
     {
         throw new ArgumentNullException(nameof(lazyInstance));
     }
     Mappings.RegisterType(type, lazyInstance, options);
 }
Beispiel #3
0
        public TypeResolverTypeMappingContext RegisterType(Type type, ILazyValue lazyInstance, object[] options, bool addToList = true)
        {
            var fullName = type?.FullName;
            var result   = new TypeResolverTypeMappingContext(fullName, null, options)
            {
                ToType = type,
                ToName = fullName,

                LazyInstance = lazyInstance,

                MappingType = MappingType.Singleton
            };

            if (addToList)
            {
                RegisterContext(result);
            }
            return(result);
        }
Beispiel #4
0
        public virtual void RegisterType(string name, ILazyValue lazyInstance, params object[] options)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (Exists(name))
            {
                throw new InvalidOperationException("Name already exists.");
            }
            if (lazyInstance == null)
            {
                throw new ArgumentNullException(nameof(lazyInstance));
            }
            var result = Mappings.RegisterType(null, lazyInstance, options, addToList: false);

            //result.StrongName = name;
            //result.BindingStrongName = name;
            result.BindingNames.Add(name);
            Mappings.RegisterContext(result);
        }
Beispiel #5
0
 public void RegisterType(Type type, ILazyValue lazyInstance, params object[] options)
 {
     throw new NotImplementedException();
 }