public void Attach(XpandModuleBase moduleBase) { _xpandModuleBase = moduleBase; if (RuntimeMode && !Executed(ConnectionStringHelperName)) { Application.ObjectSpaceCreated += ConnectionStringActions; Application.LoggedOff += ApplicationOnLoggedOff; Application.DatabaseVersionMismatch += ApplicationOnDatabaseVersionMismatch; } }
void ApplicationOnLoggedOff(object sender, EventArgs eventArgs) { XpandModuleBase.ObjectSpaceCreated = false; var xafApplication = ((XafApplication)sender); xafApplication.LoggedOff -= ApplicationOnLoggedOff; if (xafApplication.GetPlatform()==Platform.Win){ Application.ObjectSpaceCreated += ConnectionStringActions; } else XpandModuleBase.RemoveCall(ConnectionStringHelperName, _xpandModuleBase.ModuleManager); }
public static IList <Controller> CollectControllers(this XpandModuleBase moduleBase, Predicate <ITypeInfo> filterPredicate) { ControllersManager controllersManager = moduleBase.ModuleManager.ControllersManager; IList <Controller> controllers = filterPredicate != null ? controllersManager.CollectControllers(filterPredicate) : controllersManager.CollectControllers( info => moduleBase.AssemblyName == ReflectionHelper.GetAssemblyName(info.AssemblyInfo.Assembly)); return(controllers); }
public static ReflectionDictionary GetReflectionDictionary(XpandModuleBase moduleBase) { var externalModelBusinessClassesList = moduleBase.GetAdditionalClasses(moduleBase.Application.Modules); Type persistentAssemblyInfoType = externalModelBusinessClassesList.FirstOrDefault(type1 => typeof(IPersistentAssemblyInfo).IsAssignableFrom(type1)); if (persistentAssemblyInfoType == null) throw new ArgumentNullException("Add a business object that implements " + typeof(IPersistentAssemblyInfo).FullName + " at your AdditionalBusinessClasses (module.designer.cs)"); IEnumerable<Type> types = persistentAssemblyInfoType.Assembly.GetTypes().Where(type => (type.Namespace + "").StartsWith(persistentAssemblyInfoType.Namespace + "")); var reflectionDictionary = new ReflectionDictionary(); foreach (var type in types) { reflectionDictionary.QueryClassInfo(type); } return reflectionDictionary; }
public static ReflectionDictionary GetReflectionDictionary(XpandModuleBase moduleBase) { var externalModelBusinessClassesList = moduleBase.GetAdditionalClasses(moduleBase.Application.Modules); Type persistentAssemblyInfoType = externalModelBusinessClassesList.FirstOrDefault(type1 => typeof(IPersistentAssemblyInfo).IsAssignableFrom(type1)); if (persistentAssemblyInfoType == null) { throw new ArgumentNullException("Add a business object that implements " + typeof(IPersistentAssemblyInfo).FullName + " at your AdditionalBusinessClasses (module.designer.cs)"); } IEnumerable <Type> types = persistentAssemblyInfoType.Assembly.GetTypes().Where(type => (type.Namespace + "").StartsWith(persistentAssemblyInfoType.Namespace + "")); var reflectionDictionary = new ReflectionDictionary(); foreach (var type in types) { reflectionDictionary.QueryClassInfo(type); } return(reflectionDictionary); }
public override void UpdateNode(ModelNode node) { if (!XpandModuleBase.IsLoadingExternalModel()) { return; } var modelBoModelClassMembers = ((IModelBOModelClassMembers)node); var xpClassInfo = XpandModuleBase.Dictiorary.QueryClassInfo(((IModelClass)modelBoModelClassMembers.Parent).TypeInfo.Type); if (xpClassInfo == null) { return; } for (int index = modelBoModelClassMembers.Count - 1; index > -1; index--) { var modelClassMember = modelBoModelClassMembers[index]; var xpandCustomMemberInfo = xpClassInfo.FindMember(modelClassMember.Name) as XpandCustomMemberInfo; if (xpandCustomMemberInfo != null && xpandCustomMemberInfo.HasAttribute(typeof(ModelMemberExMemberInfoAttribute))) { modelClassMember.Remove(); } } }
ModelApplicationBase GetMasterModelCore(bool rebuild) { XpandModuleBase.DisposeManagers(); ModelApplicationBase modelApplicationBase; try { _modelBuilder = !rebuild?ModelBuilder.Create() : _modelBuilder; modelApplicationBase = _modelBuilder .UsingTypesInfo(_typesInfo) .FromModule(_moduleName) .WithApplication(_xafApplication) .Build(rebuild); } catch (CompilerErrorException e) { Tracing.Tracer.LogSeparator("CompilerErrorException"); Tracing.Tracer.LogError(e); Tracing.Tracer.LogValue("Source Code", e.SourceCode); throw; } XpandModuleBase.ReStoreManagers(); return(modelApplicationBase); }
private void StartOnServerDomain<TModulesProvider>(string connectionString, string applicationName) where TModulesProvider:ModuleBase{ var serverApplication = GetServerApplication(); serverApplication.Modules.Add(Activator.CreateInstance<TModulesProvider>()); serverApplication.ApplicationName = applicationName; serverApplication.ConnectionString = connectionString; serverApplication.Setup(); serverApplication.Logon(); var objectSpaceProvider = serverApplication.ObjectSpaceProvider; var xpoUserActivityVersionType = XpandModuleBase.GetDxBaseImplType("DevExpress.ExpressApp.Workflow.Versioning.XpoUserActivityVersion"); var engine=(WorkflowVersioningEngine) typeof(PersistentWorkflowVersioningEngine<>).MakeGenericType(xpoUserActivityVersionType).CreateInstance(objectSpaceProvider); var workflowDefinitionProvider = (IWorkflowDefinitionProvider)typeof(XpandWorkflowDefinitionProvider<>).MakeGenericType(xpoUserActivityVersionType).CreateInstance(XpandWorkFlowModule.WorkflowTypes.ToList(),engine); var xpandWorkflowServer = new XpandWorkflowServer("http://localhost:46232", workflowDefinitionProvider, objectSpaceProvider); xpandWorkflowServer.CustomizeHost += delegate (object sender, CustomizeHostEventArgs e) { // NOTE: Uncomment this section to use alternative workflow configuration. // // SqlWorkflowInstanceStoreBehavior // //e.WorkflowInstanceStoreBehavior = null; //System.ServiceModel.Activities.Description.SqlWorkflowInstanceStoreBehavior sqlWorkflowInstanceStoreBehavior = new System.ServiceModel.Activities.Description.SqlWorkflowInstanceStoreBehavior("Integrated Security=SSPI;Pooling=false;Data Source=(local);Initial Catalog=WorkflowsStore"); //sqlWorkflowInstanceStoreBehavior.RunnableInstancesDetectionPeriod = TimeSpan.FromSeconds(2); //e.Host.Description.Behaviors.Add(sqlWorkflowInstanceStoreBehavior); //e.WorkflowIdleBehavior.TimeToPersist = TimeSpan.FromSeconds(1); //e.WorkflowIdleBehavior.TimeToPersist = TimeSpan.FromSeconds(10); //e.WorkflowIdleBehavior.TimeToUnload = TimeSpan.FromSeconds(10); e.WorkflowInstanceStoreBehavior.WorkflowInstanceStore.RunnableInstancesDetectionPeriod = TimeSpan.FromSeconds(2); }; _server= xpandWorkflowServer; _server.CustomHandleException += delegate(object sender, CustomHandleServiceExceptionEventArgs e) { Tracing.Tracer.LogError(e.Exception); OnServerDomainCustomHandleException?.Invoke(this, new ExceptionEventArgs("Exception occurs:\r\n\r\n" + e.Exception.Message + "\r\n\r\n'" + e.Service.GetType() + "' service")); e.Handled = true; }; _server.Start(); }
public bool IsVisible(IModelNode node, string propertyName) { return(!XpandModuleBase.GetIsHosted(node.Application)); }
public void Attach(XpandModuleBase xpandModuleBase) { if (!xpandModuleBase.Executed<ISequenceGeneratorUser>(SequenceGeneratorHelperName)) { if (SequenceObjectType == null){ SequenceObjectType = xpandModuleBase.LoadFromBaseImpl("Xpand.Persistent.BaseImpl.SequenceObject"); ModifySequenceObjectWhenMySqlDatalayer(XafTypesInfo.Instance); } if (xpandModuleBase.RuntimeMode) { _xpandModuleBase = xpandModuleBase; Application.LoggedOff += ApplicationOnLoggedOff; } } }
public ControllerStateLogicInstaller(XpandModuleBase xpandModuleBase) : base(xpandModuleBase) { }
public AdditionalViewControlsLogicInstaller(XpandModuleBase xpandModuleBase) : base(xpandModuleBase) { }
public void Attach(XpandModuleBase xpandModuleBase, ConnectionStringHelper helper) { _xpandModuleBase = xpandModuleBase; if (!_xpandModuleBase.Executed<ISequenceGeneratorUser>(SequenceGeneratorHelperName)) { if (_xpandModuleBase.RuntimeMode) { Application.LoggedOff += ApplicationOnLoggedOff; AddToAdditionalExportedTypes(new[] { "Xpand.Persistent.BaseImpl.SequenceObject" }); helper.ConnectionStringUpdated += XpandModuleBaseOnConnectionStringUpdated; } } }
public ObjectViewsLogicInstaller(XpandModuleBase xpandModuleBase) : base(xpandModuleBase) { }
public ActionStateLogicInstaller(XpandModuleBase xpandModuleBase) : base(xpandModuleBase) { }
public void Attach(XpandModuleBase xpandModuleBase) { if (!xpandModuleBase.Executed<ISequenceGeneratorUser>(SequenceGeneratorHelperName)) { if (SequenceObjectType == null){ SequenceObjectType = xpandModuleBase.LoadFromBaseImpl("Xpand.Persistent.BaseImpl.SequenceObject"); } if (xpandModuleBase.RuntimeMode) { _xpandModuleBase = xpandModuleBase; Application.LoggedOff += ApplicationOnLoggedOff; var helper = new ConnectionStringHelper(); helper.Attach(_xpandModuleBase); helper.ConnectionStringUpdated += (sender, args) => InitializeSequenceGenerator(); } } }
public MasterDetailLogicInstaller(XpandModuleBase xpandModuleBase) : base(xpandModuleBase) { }
public static IList <Controller> CollectControllers(this XpandModuleBase moduleBase) { return(CollectControllers(moduleBase, null)); }
public ModelAdaptorLogicInstaller(XpandModuleBase xpandModuleBase) : base(xpandModuleBase) { }