Ejemplo n.º 1
0
        public override void Setup(XafApplication application)
        {
            base.Setup(application);
            if (RuntimeMode)
            {
                ApplicationHelper.Instance.Initialize(application);
            }
            CheckApplicationTypes();
            var helper = new ConnectionStringHelper();

            helper.Attach(this);
            var generatorHelper = new SequenceGeneratorHelper();

            generatorHelper.Attach(this, helper);

            if (Executed("Setup"))
            {
                return;
            }

            if (ManifestModuleName == null)
            {
                ManifestModuleName = application.GetType().Assembly.ManifestModule.Name;
            }

            application.SetupComplete += ApplicationOnSetupComplete;
            application.SettingUp     += ApplicationOnSettingUp;
        }
Ejemplo n.º 2
0
        public override void Setup(XafApplication application)
        {
            lock (XafTypesInfo.Instance) {
                if (RuntimeMode && XafTypesInfo.PersistentEntityStore == null)
                {
                    XafTypesInfo.SetPersistentEntityStore(new XpandXpoTypeInfoSource((TypesInfo)application.TypesInfo));
                }
            }
            base.Setup(application);
            CheckApplicationTypes();
            if (RuntimeMode)
            {
                ApplicationHelper.Instance.Initialize(application);
                var helper = new ConnectionStringHelper();
                helper.Attach(this);
                var generatorHelper = new SequenceGeneratorHelper();
                generatorHelper.Attach(this);
                helper.ConnectionStringUpdated += (sender, args) => generatorHelper.InitializeSequenceGenerator();
            }

            if (Executed("Setup"))
            {
                return;
            }
            if (ManifestModuleName == null)
            {
                ManifestModuleName = application.GetType().Assembly.ManifestModule.Name;
            }
            application.CreateCustomUserModelDifferenceStore += OnCreateCustomUserModelDifferenceStore;
            application.SetupComplete += ApplicationOnSetupComplete;
            application.SettingUp     += ApplicationOnSettingUp;
            application.CreateCustomCollectionSource += ApplicationOnCreateCustomCollectionSource;
            if (RuntimeMode)
            {
                application.LoggedOn += (sender, args) => RuntimeMemberBuilder.CreateRuntimeMembers(application.Model);
            }
        }