Ejemplo n.º 1
0
        public override void Register(IJsonImporterRegistry registry)
        {
            Type elementType = _arrayType.GetElementType();
            
            //
            // For sake of convenience, if the element type does not have an
            // importer already registered then we'll check if the stock has
            // one. If yes, then we'll auto-register it here at the same time
            // as registering the importer for the array type. This allows 
            // simple types like array of integers to be handles without
            // requiring the user to register the element type and
            // then the array, which can seem like extra steps for the most
            // common cases.
            //
            
            IJsonImporter importer = registry.Find(elementType);
            
            if (importer == null)
            {
                importer = JsonImporterStock.Find(elementType);
                if (importer != null)
                    registry.Register(elementType, importer);
            }

            registry.Register(_arrayType, this);
        }
 public override void Register(IJsonImporterRegistry registry)
 {
     registry.Register(typeof(NameValueCollection), this);
 }
Ejemplo n.º 3
0
 public void Register(IJsonImporterRegistry registry)
 {
     registry.RegisterFactory(typeof(Array), this);
 }
Ejemplo n.º 4
0
 public abstract void Register(IJsonImporterRegistry registry);
Ejemplo n.º 5
0
 public override void Register(IJsonImporterRegistry registry)
 {
     registry.Register(_type, this);
 }
 public override void Register(IJsonImporterRegistry registry)
 {
     registry.Register(typeof(DateTime), this);
 }
Ejemplo n.º 7
0
 public override void Register(IJsonImporterRegistry registry)
 {
     registry.Register(typeof(object), this);
 }
 public override void Register(IJsonImporterRegistry registry)
 {
     throw new NotImplementedException();
 }