public static void Initialize(ScriptManagerConfig config) {
            if (container == null) {
                container = new DefaultContainer();
            }
            if (scriptManager == null)
                scriptManager = new DefaultScriptManagerService(config.nextUniqueId);
			foreach (var svc in config.services)
				container.RegisterServiceConfig(svc.Key, svc.Value);
			foreach (var inj in config.injections)
				container.RegisterInjection(inj.Key, inj.Value);

            foreach (ScriptManagerConfigControlRow c in config.controls) {
                scriptManager.RegisterTopLevelControl((IControl)container.CreateObjectByTypeNameWithConstructorArg(c.type, c.config));
            }
        }
示例#2
0
        public static void Initialize(ScriptManagerConfig config)
        {
            if (container == null)
            {
                container = new DefaultContainer();
            }
            if (scriptManager == null)
            {
                scriptManager = new DefaultScriptManagerService(config.nextUniqueId);
            }
            foreach (var svc in config.services)
            {
                container.RegisterServiceConfig(svc.Key, svc.Value);
            }
            foreach (var inj in config.injections)
            {
                container.RegisterInjection(inj.Key, inj.Value);
            }

            foreach (ScriptManagerConfigControlRow c in config.controls)
            {
                scriptManager.RegisterTopLevelControl((IControl)container.CreateObjectByTypeNameWithConstructorArg(c.type, c.config));
            }
        }