private void BuildSystemManager(AbcFile abc) { var superType = _compiler.ImportType(abc, "mx.managers.SystemManager"); var flexModuleFactoryInterface = FlexTypes.GetFlexModuleFactoryInterface(abc); if (HasCrossDomainRsls) { // Cause the CrossDomainRSLItem class to be linked into this application. var crossDomainRSLItem = _compiler.ImportType(abc, "mx.core.CrossDomainRSLItem"); Debug.Assert(crossDomainRSLItem != null); } var instance = new AbcInstance(true) { Name = DefineSystemManagerName(abc), Flags = AbcClassFlags.FinalSealed, //ProtectedNamespace = abc.DefineProtectedNamespace(NameMxSysManager), Type = _compiler.FlexAppType, BaseTypeName = superType.Name, BaseInstance = superType }; instance.Interfaces.Add(flexModuleFactoryInterface.Name); instance.Initializer = abc.DefineMethod( Sig.@void(), code => { code.ConstructSuper(); code.ReturnVoid(); }); instance.Class.Initializer = abc.DefineEmptyMethod(); abc.AddInstance(instance); _mxSystemManager = instance; BuildSystemManagerCreate(abc, instance); BuildSystemManagerInfo(abc, instance); abc.DefineScript(instance); abc.DefineEmptyScript(); }
private void RegisterEffectTriggers(AbcFile app, AbcCode code) { if (_effects.Count == 0) { return; } var effectManager = _compiler.ImportType(app, "mx.effects.EffectManager"); var mn = app.DefineName(QName.MxInternal("registerEffectTrigger")); foreach (var pair in _effects) { code.Getlex(effectManager); code.PushString(pair.Key); code.PushString(pair.Value); code.CallVoid(mn, 2); } }
public AbcInstance GetFlexModuleFactoryInterface(AbcFile app) { return(_flexModuleFactoryInterface ?? (_flexModuleFactoryInterface = _compiler.ImportType(app, MX.IFlexModuleFactory))); }