From ff173f1958aee689292f53785bacdf71c274661b Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Fri, 30 Jan 2026 19:47:18 +0400 Subject: [PATCH] autogenerate VB --- ...NonPersistentObjectsDemo.Module.Web.vbproj | 44 +-- .../Properties/AssemblyInfo.vb | 29 ++ .../WebModule.Designer.vb | 73 ++-- .../WebModule.vb | 65 ++-- ...NonPersistentObjectsDemo.Module.Win.vbproj | 45 +-- .../Properties/AssemblyInfo.vb | 29 ++ .../WinModule.Designer.vb | 73 ++-- .../WinModule.vb | 65 ++-- .../BusinessObjects/DemoData.vb | 81 ++-- .../NonPersistentObjectBase.vb | 107 +++--- .../BusinessObjects/PersistentObjects.vb | 151 ++++---- .../BusinessObjects/ProductView.vb | 174 +++++---- .../NonPersistentObjectActivatorController.vb | 93 ++--- .../ProductViewNestedCollectionController.vb | 35 +- .../DatabaseUpdate/Updater.vb | 140 +++---- .../Module.Designer.vb | 91 ++--- VB/NonPersistentObjectsDemo.Module/Module.vb | 96 +++-- .../NonPersistentObjectsDemo.Module.vbproj | 44 +-- .../Properties/AssemblyInfo.vb | 29 ++ VB/NonPersistentObjectsDemo.Web/Default.aspx | 6 +- .../Default.aspx.designer.vb | 55 ++- .../Default.aspx.vb | 27 +- VB/NonPersistentObjectsDemo.Web/Error.aspx | 4 +- .../Error.aspx.designer.vb | 313 ++++++++-------- VB/NonPersistentObjectsDemo.Web/Error.aspx.vb | 129 +++---- VB/NonPersistentObjectsDemo.Web/Global.asax | 2 +- .../Global.asax.vb | 133 +++---- VB/NonPersistentObjectsDemo.Web/Login.aspx | 4 +- .../Login.aspx.designer.vb | 71 ++-- VB/NonPersistentObjectsDemo.Web/Login.aspx.vb | 18 +- .../NonPersistentObjectsDemo.Web.vbproj | 84 +---- .../Properties/AssemblyInfo.vb | 29 ++ .../WebApplication.vb | 349 ++++++++++-------- .../NonPersistentObjectsDemo.Win.vbproj | 95 +---- VB/NonPersistentObjectsDemo.Win/Program.vb | 94 ++--- .../Properties/AssemblyInfo.vb | 29 ++ .../WinApplication.Designer.vb | 273 +++++++------- .../WinApplication.vb | 107 +++--- .../XafSplashScreen.Designer.vb | 347 ++++++++--------- .../XafSplashScreen.vb | 84 +++-- ...ObjectsEditLinkedPersistentObjectsDemo.sln | 3 +- 41 files changed, 1873 insertions(+), 1847 deletions(-) create mode 100644 VB/NonPersistentObjectsDemo.Module.Web/Properties/AssemblyInfo.vb create mode 100644 VB/NonPersistentObjectsDemo.Module.Win/Properties/AssemblyInfo.vb create mode 100644 VB/NonPersistentObjectsDemo.Module/Properties/AssemblyInfo.vb create mode 100644 VB/NonPersistentObjectsDemo.Web/Properties/AssemblyInfo.vb create mode 100644 VB/NonPersistentObjectsDemo.Win/Properties/AssemblyInfo.vb diff --git a/VB/NonPersistentObjectsDemo.Module.Web/NonPersistentObjectsDemo.Module.Web.vbproj b/VB/NonPersistentObjectsDemo.Module.Web/NonPersistentObjectsDemo.Module.Web.vbproj index ae3b5d5..3035fe5 100644 --- a/VB/NonPersistentObjectsDemo.Module.Web/NonPersistentObjectsDemo.Module.Web.vbproj +++ b/VB/NonPersistentObjectsDemo.Module.Web/NonPersistentObjectsDemo.Module.Web.vbproj @@ -1,62 +1,44 @@ - + + On Debug AnyCPU {EFD113F7-1ED0-472C-8EBE-B1A7CAFB6C2B} Library - + Properties + + NonPersistentObjectsDemo.Module.Web v4.5.2 512 - On - Binary - Off - On true full false bin\Debug\ - true - true + DEBUG,TRACE prompt - true + 4 pdbonly true bin\Release\ - false - true + TRACE prompt - true + 4 true bin\EasyTest\ - true - true - EASYTEST=True + TRACE,DEBUG,EASYTEST full AnyCPU prompt - true - - - - - - - - - - - - False @@ -207,7 +189,7 @@ Component - + WebModule.vb @@ -233,11 +215,11 @@ - - + \ No newline at end of file diff --git a/VB/NonPersistentObjectsDemo.Module.Web/Properties/AssemblyInfo.vb b/VB/NonPersistentObjectsDemo.Module.Web/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..fa201d0 --- /dev/null +++ b/VB/NonPersistentObjectsDemo.Module.Web/Properties/AssemblyInfo.vb @@ -0,0 +1,29 @@ +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + +' The following GUID is for the ID of the typelib if this project is exposed to COM + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' + + diff --git a/VB/NonPersistentObjectsDemo.Module.Web/WebModule.Designer.vb b/VB/NonPersistentObjectsDemo.Module.Web/WebModule.Designer.vb index af4f58e..6c03429 100644 --- a/VB/NonPersistentObjectsDemo.Module.Web/WebModule.Designer.vb +++ b/VB/NonPersistentObjectsDemo.Module.Web/WebModule.Designer.vb @@ -1,41 +1,42 @@ -Namespace NonPersistentObjectsDemo.Module.Web - Partial Public Class NonPersistentObjectsDemoAspNetModule - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing +Namespace NonPersistentObjectsDemo.[Module].Web - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + Partial Class NonPersistentObjectsDemoAspNetModule - #Region "Component Designer generated code" + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - ' - ' NonPersistentObjectsDemoAspNetModule - ' - Me.RequiredModuleTypes.Add(GetType(NonPersistentObjectsDemo.Module.NonPersistentObjectsDemoModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.FileAttachments.Web.FileAttachmentsAspNetModule)) - 'this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.Web.ReportsAspNetModuleV2)); - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Scheduler.Web.SchedulerAspNetModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ScriptRecorder.Web.ScriptRecorderAspNetModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.TreeListEditors.Web.TreeListEditorsAspNetModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Validation.Web.ValidationAspNetModule)) - End Sub + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() + End If - #End Region - End Class + MyBase.Dispose(disposing) + End Sub + +#Region "Component Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + ' + ' NonPersistentObjectsDemoAspNetModule + ' + Me.RequiredModuleTypes.Add(GetType(NonPersistentObjectsDemo.[Module].NonPersistentObjectsDemoModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.FileAttachments.Web.FileAttachmentsAspNetModule)) + 'this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.Web.ReportsAspNetModuleV2)); + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Scheduler.Web.SchedulerAspNetModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ScriptRecorder.Web.ScriptRecorderAspNetModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.TreeListEditors.Web.TreeListEditorsAspNetModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Validation.Web.ValidationAspNetModule)) + End Sub +#End Region + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module.Web/WebModule.vb b/VB/NonPersistentObjectsDemo.Module.Web/WebModule.vb index cd440ac..efac6f6 100644 --- a/VB/NonPersistentObjectsDemo.Module.Web/WebModule.vb +++ b/VB/NonPersistentObjectsDemo.Module.Web/WebModule.vb @@ -1,44 +1,39 @@ -Imports System -Imports System.Linq -Imports System.Text +Imports System Imports System.ComponentModel Imports DevExpress.ExpressApp -Imports DevExpress.ExpressApp.DC Imports System.Collections.Generic -Imports DevExpress.ExpressApp.Model -Imports DevExpress.ExpressApp.Editors -Imports DevExpress.ExpressApp.Actions Imports DevExpress.ExpressApp.Updating -Imports DevExpress.ExpressApp.Model.Core -Imports DevExpress.ExpressApp.Model.DomainLogics -Imports DevExpress.ExpressApp.Model.NodeGenerators Imports DevExpress.Persistent.BaseImpl Namespace NonPersistentObjectsDemo.Module.Web - ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.ModuleBase. - - Public NotInheritable Partial Class NonPersistentObjectsDemoAspNetModule - Inherits ModuleBase - 'private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { - ' e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web"); - ' e.Handled = true; - '} - Private Sub Application_CreateCustomUserModelDifferenceStore(ByVal sender As Object, ByVal e As CreateCustomModelDifferenceStoreEventArgs) - e.Store = New ModelDifferenceDbStore(DirectCast(sender, XafApplication), GetType(ModelDifference), False, "Web") - e.Handled = True - End Sub - Public Sub New() - InitializeComponent() - End Sub - Public Overrides Function GetModuleUpdaters(ByVal objectSpace As IObjectSpace, ByVal versionFromDB As Version) As IEnumerable(Of ModuleUpdater) - Return ModuleUpdater.EmptyModuleUpdaters - End Function - Public Overrides Sub Setup(ByVal application As XafApplication) - MyBase.Setup(application) - 'application.CreateCustomModelDifferenceStore += Application_CreateCustomModelDifferenceStore; - AddHandler application.CreateCustomUserModelDifferenceStore, AddressOf Application_CreateCustomUserModelDifferenceStore - ' Manage various aspects of the application UI and behavior at the module level. - End Sub - End Class + + ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.ModuleBase. + Public NotInheritable Partial Class NonPersistentObjectsDemoAspNetModule + Inherits ModuleBase + + 'private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { + ' e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web"); + ' e.Handled = true; + '} + Private Sub Application_CreateCustomUserModelDifferenceStore(ByVal sender As Object, ByVal e As CreateCustomModelDifferenceStoreEventArgs) + e.Store = New ModelDifferenceDbStore(CType(sender, XafApplication), GetType(ModelDifference), False, "Web") + e.Handled = True + End Sub + + Public Sub New() + InitializeComponent() + End Sub + + Public Overrides Function GetModuleUpdaters(ByVal objectSpace As IObjectSpace, ByVal versionFromDB As Version) As IEnumerable(Of ModuleUpdater) + Return ModuleUpdater.EmptyModuleUpdaters + End Function + + Public Overrides Sub Setup(ByVal application As XafApplication) + MyBase.Setup(application) + 'application.CreateCustomModelDifferenceStore += Application_CreateCustomModelDifferenceStore; + AddHandler application.CreateCustomUserModelDifferenceStore, AddressOf Application_CreateCustomUserModelDifferenceStore + ' Manage various aspects of the application UI and behavior at the module level. + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module.Win/NonPersistentObjectsDemo.Module.Win.vbproj b/VB/NonPersistentObjectsDemo.Module.Win/NonPersistentObjectsDemo.Module.Win.vbproj index a6a0475..9fcb9d9 100644 --- a/VB/NonPersistentObjectsDemo.Module.Win/NonPersistentObjectsDemo.Module.Win.vbproj +++ b/VB/NonPersistentObjectsDemo.Module.Win/NonPersistentObjectsDemo.Module.Win.vbproj @@ -1,63 +1,44 @@ - + + On Debug AnyCPU {72D644CD-C193-4572-B2E3-CA82819A1627} Library - + Properties + + NonPersistentObjectsDemo.Module.Win v4.5.2 512 - On - Binary - Off - On true full false bin\Debug\ - true - true + DEBUG,TRACE prompt - true + 4 pdbonly true bin\Release\ - false - true + TRACE prompt - true + 4 true bin\EasyTest\ - true - true - EASYTEST=True + TRACE,DEBUG,EASYTEST full AnyCPU prompt - true - - - - - - - - - - - - - False @@ -237,7 +218,7 @@ - + Component @@ -271,11 +252,11 @@ - - + \ No newline at end of file diff --git a/VB/NonPersistentObjectsDemo.Module.Win/Properties/AssemblyInfo.vb b/VB/NonPersistentObjectsDemo.Module.Win/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..134d492 --- /dev/null +++ b/VB/NonPersistentObjectsDemo.Module.Win/Properties/AssemblyInfo.vb @@ -0,0 +1,29 @@ +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + +' The following GUID is for the ID of the typelib if this project is exposed to COM + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' + + diff --git a/VB/NonPersistentObjectsDemo.Module.Win/WinModule.Designer.vb b/VB/NonPersistentObjectsDemo.Module.Win/WinModule.Designer.vb index cdd7a52..e442a8a 100644 --- a/VB/NonPersistentObjectsDemo.Module.Win/WinModule.Designer.vb +++ b/VB/NonPersistentObjectsDemo.Module.Win/WinModule.Designer.vb @@ -1,41 +1,42 @@ -Namespace NonPersistentObjectsDemo.Module.Win - Partial Public Class NonPersistentObjectsDemoWindowsFormsModule - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing +Namespace NonPersistentObjectsDemo.[Module].Win - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + Partial Class NonPersistentObjectsDemoWindowsFormsModule - #Region "Component Designer generated code" + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - ' - ' NonPersistentObjectsDemoWindowsFormsModule - ' - Me.RequiredModuleTypes.Add(GetType(NonPersistentObjectsDemo.Module.NonPersistentObjectsDemoModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule)) - 'this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.Win.ReportsWindowsFormsModuleV2)); - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Scheduler.Win.SchedulerWindowsFormsModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ScriptRecorder.Win.ScriptRecorderWindowsFormsModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditorsWindowsFormsModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Validation.Win.ValidationWindowsFormsModule)) - End Sub + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() + End If - #End Region - End Class + MyBase.Dispose(disposing) + End Sub + +#Region "Component Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + ' + ' NonPersistentObjectsDemoWindowsFormsModule + ' + Me.RequiredModuleTypes.Add(GetType(NonPersistentObjectsDemo.[Module].NonPersistentObjectsDemoModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule)) + 'this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.Win.ReportsWindowsFormsModuleV2)); + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Scheduler.Win.SchedulerWindowsFormsModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ScriptRecorder.Win.ScriptRecorderWindowsFormsModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditorsWindowsFormsModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Validation.Win.ValidationWindowsFormsModule)) + End Sub +#End Region + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module.Win/WinModule.vb b/VB/NonPersistentObjectsDemo.Module.Win/WinModule.vb index c53f375..d9cc290 100644 --- a/VB/NonPersistentObjectsDemo.Module.Win/WinModule.vb +++ b/VB/NonPersistentObjectsDemo.Module.Win/WinModule.vb @@ -1,44 +1,39 @@ -Imports System -Imports System.Linq -Imports System.Text +Imports System Imports System.ComponentModel Imports DevExpress.ExpressApp -Imports DevExpress.ExpressApp.DC Imports System.Collections.Generic -Imports DevExpress.ExpressApp.Model -Imports DevExpress.ExpressApp.Editors -Imports DevExpress.ExpressApp.Actions Imports DevExpress.ExpressApp.Updating -Imports DevExpress.ExpressApp.Model.Core -Imports DevExpress.ExpressApp.Model.DomainLogics -Imports DevExpress.ExpressApp.Model.NodeGenerators Imports DevExpress.Persistent.BaseImpl Namespace NonPersistentObjectsDemo.Module.Win - ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.ModuleBase. - - Public NotInheritable Partial Class NonPersistentObjectsDemoWindowsFormsModule - Inherits ModuleBase - 'private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { - ' e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Win"); - ' e.Handled = true; - '} - Private Sub Application_CreateCustomUserModelDifferenceStore(ByVal sender As Object, ByVal e As CreateCustomModelDifferenceStoreEventArgs) - e.Store = New ModelDifferenceDbStore(DirectCast(sender, XafApplication), GetType(ModelDifference), False, "Win") - e.Handled = True - End Sub - Public Sub New() - InitializeComponent() - End Sub - Public Overrides Function GetModuleUpdaters(ByVal objectSpace As IObjectSpace, ByVal versionFromDB As Version) As IEnumerable(Of ModuleUpdater) - Return ModuleUpdater.EmptyModuleUpdaters - End Function - Public Overrides Sub Setup(ByVal application As XafApplication) - MyBase.Setup(application) - 'application.CreateCustomModelDifferenceStore += Application_CreateCustomModelDifferenceStore; - AddHandler application.CreateCustomUserModelDifferenceStore, AddressOf Application_CreateCustomUserModelDifferenceStore - ' Manage various aspects of the application UI and behavior at the module level. - End Sub - End Class + + ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.ModuleBase. + Public NotInheritable Partial Class NonPersistentObjectsDemoWindowsFormsModule + Inherits ModuleBase + + 'private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { + ' e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Win"); + ' e.Handled = true; + '} + Private Sub Application_CreateCustomUserModelDifferenceStore(ByVal sender As Object, ByVal e As CreateCustomModelDifferenceStoreEventArgs) + e.Store = New ModelDifferenceDbStore(CType(sender, XafApplication), GetType(ModelDifference), False, "Win") + e.Handled = True + End Sub + + Public Sub New() + InitializeComponent() + End Sub + + Public Overrides Function GetModuleUpdaters(ByVal objectSpace As IObjectSpace, ByVal versionFromDB As Version) As IEnumerable(Of ModuleUpdater) + Return ModuleUpdater.EmptyModuleUpdaters + End Function + + Public Overrides Sub Setup(ByVal application As XafApplication) + MyBase.Setup(application) + 'application.CreateCustomModelDifferenceStore += Application_CreateCustomModelDifferenceStore; + AddHandler application.CreateCustomUserModelDifferenceStore, AddressOf Application_CreateCustomUserModelDifferenceStore + ' Manage various aspects of the application UI and behavior at the module level. + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/DemoData.vb b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/DemoData.vb index 489cc63..92d3006 100644 --- a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/DemoData.vb +++ b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/DemoData.vb @@ -1,45 +1,46 @@ -Imports System -Imports System.Collections.Generic -Imports System.Linq -Imports System.Text -Imports System.Threading.Tasks +Imports System Imports DevExpress.ExpressApp Namespace NonPersistentObjectsDemo.Module.BusinessObjects - Friend Class DemoDataCreator - Private ObjectSpace As IObjectSpace - Public Sub New(ByVal objectSpace As IObjectSpace) - Me.ObjectSpace = objectSpace - End Sub - Public Sub CreateDemoObjects() - Dim rnd = New Random() - If ObjectSpace.GetObjectsCount(GetType(Product), Nothing) = 0 Then - Dim c1 = CreateCategory("Beverages") - Dim c4 = CreateCategory("Cheeses") - Dim c5 = CreateCategory("Breads") - CreateProduct(c1, "Chai", 18.0D) - CreateProduct(c1, "Soda", 12.0D) - CreateProduct(c4, "Queso Cabrales", 21.5D) - CreateProduct(c4, "Queso Manchego La Pastora", 38.0D) - CreateProduct(c4, "Gorgonzola Telino", 12.5D) - CreateProduct(c4, "Mascarpone Fabioli", 32.0D) - CreateProduct(c4, "Geitost", 2.5D) - CreateProduct(c5, "Gustaf's Knäckebröd", 21.0D) - CreateProduct(c5, "Tunnbröd", 9.0D) - End If - End Sub - Private Function CreateProduct(ByVal category As Category, ByVal model As String, ByVal price As Decimal) As Product - Dim product = ObjectSpace.CreateObject(Of Product)() - product.Model = model - product.Category = category - product.Price = price - Return product - End Function - Private Function CreateCategory(ByVal name As String) As Category - Dim category = ObjectSpace.CreateObject(Of Category)() - category.Name = name - Return category - End Function - End Class + Friend Class DemoDataCreator + + Private ObjectSpace As IObjectSpace + + Public Sub New(ByVal objectSpace As IObjectSpace) + Me.ObjectSpace = objectSpace + End Sub + + Public Sub CreateDemoObjects() + Dim rnd = New Random() + If ObjectSpace.GetObjectsCount(GetType(Product), Nothing) = 0 Then + Dim c1 = CreateCategory("Beverages") + Dim c4 = CreateCategory("Cheeses") + Dim c5 = CreateCategory("Breads") + CreateProduct(c1, "Chai", 18.0D) + CreateProduct(c1, "Soda", 12.0D) + CreateProduct(c4, "Queso Cabrales", 21.5D) + CreateProduct(c4, "Queso Manchego La Pastora", 38.0D) + CreateProduct(c4, "Gorgonzola Telino", 12.5D) + CreateProduct(c4, "Mascarpone Fabioli", 32.0D) + CreateProduct(c4, "Geitost", 2.5D) + CreateProduct(c5, "Gustaf's Knäckebröd", 21.0D) + CreateProduct(c5, "Tunnbröd", 9.0D) + End If + End Sub + + Private Function CreateProduct(ByVal category As Category, ByVal model As String, ByVal price As Decimal) As Product + Dim product = ObjectSpace.CreateObject(Of Product)() + product.Model = model + product.Category = category + product.Price = price + Return product + End Function + + Private Function CreateCategory(ByVal name As String) As Category + Dim category = ObjectSpace.CreateObject(Of Category)() + category.Name = name + Return category + End Function + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/NonPersistentObjectBase.vb b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/NonPersistentObjectBase.vb index e3d8e1e..80acc3f 100644 --- a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/NonPersistentObjectBase.vb +++ b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/NonPersistentObjectBase.vb @@ -1,60 +1,63 @@ -Imports System -Imports System.Collections.Generic +Imports System Imports System.ComponentModel Imports System.Linq -Imports System.Text -Imports System.Threading.Tasks Imports DevExpress.ExpressApp -Imports DevExpress.ExpressApp.DC -Imports DevExpress.Persistent.Base Namespace NonPersistentObjectsDemo.Module.BusinessObjects + Public MustInherit Class NonPersistentObjectBase + Implements INotifyPropertyChanged, IObjectSpaceLink - Public MustInherit Class NonPersistentObjectBase - Implements INotifyPropertyChanged, IObjectSpaceLink - -'INSTANT VB NOTE: The field objectSpace was renamed since Visual Basic does not allow fields to have the same name as other class members: - Private objectSpace_Conflict As IObjectSpace - Protected ReadOnly Property ObjectSpace() As IObjectSpace - Get - Return objectSpace_Conflict - End Get - End Property - Private Property IObjectSpaceLink_ObjectSpace() As IObjectSpace Implements IObjectSpaceLink.ObjectSpace - Get - Return objectSpace_Conflict - End Get - Set(ByVal value As IObjectSpace) - If objectSpace_Conflict IsNot value Then - OnObjectSpaceChanging() - objectSpace_Conflict = value - OnObjectSpaceChanged() - End If - End Set - End Property - Protected Overridable Sub OnObjectSpaceChanging() - End Sub - Protected Overridable Sub OnObjectSpaceChanged() - End Sub - Protected Function FindPersistentObjectSpace(ByVal type As Type) As IObjectSpace - Return DirectCast(ObjectSpace, NonPersistentObjectSpace).AdditionalObjectSpaces.FirstOrDefault(Function(os) os.IsKnownType(type)) - End Function - Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged - Protected Sub OnPropertyChanged(ByVal propertyName As String) - PropertyChangedEvent?.Invoke(Me, New PropertyChangedEventArgs(propertyName)) - End Sub - Protected Sub SetPropertyValue(Of T)(ByVal name As String, ByRef field As T, ByVal value As T) - If Not Equals(field, value) Then - field = value - OnPropertyChanged(name) - End If - End Sub - - Public ReadOnly Property This() As Object - Get - Return Me - End Get - End Property - End Class + Private objectSpaceField As IObjectSpace + + Protected ReadOnly Property ObjectSpaceProp As IObjectSpace + Get + Return objectSpaceField + End Get + End Property + + Private Property ObjectSpace As IObjectSpace Implements IObjectSpaceLink.ObjectSpace + Get + Return objectSpaceField + End Get + + Set(ByVal value As IObjectSpace) + If objectSpaceField IsNot value Then + OnObjectSpaceChanging() + objectSpaceField = value + OnObjectSpaceChanged() + End If + End Set + End Property + + Protected Overridable Sub OnObjectSpaceChanging() + End Sub + + Protected Overridable Sub OnObjectSpaceChanged() + End Sub + + Protected Function FindPersistentObjectSpace(ByVal type As Type) As IObjectSpace + Return CType(ObjectSpaceProp, NonPersistentObjectSpace).AdditionalObjectSpaces.FirstOrDefault(Function(os) os.IsKnownType(type)) + End Function + + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged + + Protected Sub OnPropertyChanged(ByVal propertyName As String) + RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName)) + End Sub + + Protected Sub SetPropertyValue(Of T)(ByVal name As String, ByRef field As T, ByVal value As T) + If Not Equals(field, value) Then + field = value + OnPropertyChanged(name) + End If + End Sub + + + Public ReadOnly Property This As Object + Get + Return Me + End Get + End Property + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/PersistentObjects.vb b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/PersistentObjects.vb index f9c474c..4ea8fbf 100644 --- a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/PersistentObjects.vb +++ b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/PersistentObjects.vb @@ -1,79 +1,86 @@ -Imports System -Imports System.Collections.Generic -Imports System.Linq -Imports System.Text -Imports System.Threading.Tasks Imports DevExpress.Persistent.Base Imports DevExpress.Persistent.BaseImpl Imports DevExpress.Xpo Namespace NonPersistentObjectsDemo.Module.BusinessObjects - - Public Class Product - Inherits BaseObject - - Public Sub New(ByVal session As Session) - MyBase.New(session) - End Sub - - Private _Model As String - Public Property Model() As String - Get - Return _Model - End Get - Set(ByVal value As String) - SetPropertyValue(Of String)(NameOf(Model), _Model, value) - End Set - End Property - Private _Category As Category - Public Property Category() As Category - Get - Return _Category - End Get - Set(ByVal value As Category) - SetPropertyValue(Of Category)(NameOf(Category), _Category, value) - End Set - End Property - - Public ReadOnly Property DisplayName() As String - Get - Return CStr(EvaluateAlias(NameOf(DisplayName))) - End Get - End Property - Private _Price As Decimal - Public Property Price() As Decimal - Get - Return _Price - End Get - Set(ByVal value As Decimal) - SetPropertyValue(Of Decimal)(NameOf(Price), _Price, value) - End Set - End Property - Protected Overrides Sub OnChanged(ByVal propertyName As String, ByVal oldValue As Object, ByVal newValue As Object) - MyBase.OnChanged(propertyName, oldValue, newValue) - If propertyName = NameOf(Category) OrElse propertyName = NameOf(Model) Then - OnChanged(NameOf(DisplayName)) - End If - End Sub - End Class - - - Public Class Category - Inherits BaseObject - - Public Sub New(ByVal session As Session) - MyBase.New(session) - End Sub - - Private _Name As String - Public Property Name() As String - Get - Return _Name - End Get - Set(ByVal value As String) - SetPropertyValue(Of String)(NameOf(Name), _Name, value) - End Set - End Property - End Class + + Public Class Product + Inherits BaseObject + + Public Sub New(ByVal session As Session) + MyBase.New(session) + End Sub + + Private _Model As String + + Public Property Model As String + Get + Return _Model + End Get + + Set(ByVal value As String) + SetPropertyValue(Of String)(NameOf(Product.Model), _Model, value) + End Set + End Property + + Private _Category As Category + + Public Property Category As Category + Get + Return _Category + End Get + + Set(ByVal value As Category) + SetPropertyValue(NameOf(Product.Category), _Category, value) + End Set + End Property + + + Public ReadOnly Property DisplayName As String + Get + Return CStr(EvaluateAlias(NameOf(Product.DisplayName))) + End Get + End Property + + Private _Price As Decimal + + Public Property Price As Decimal + Get + Return _Price + End Get + + Set(ByVal value As Decimal) + SetPropertyValue(Of Decimal)(NameOf(Product.Price), _Price, value) + End Set + End Property + + Protected Overrides Sub OnChanged(ByVal propertyName As String, ByVal oldValue As Object, ByVal newValue As Object) + MyBase.OnChanged(propertyName, oldValue, newValue) + If Equals(propertyName, NameOf(Product.Category)) OrElse Equals(propertyName, NameOf(Product.Model)) Then + OnChanged(NameOf(Product.DisplayName)) + End If + End Sub + End Class + + + Public Class Category + Inherits BaseObject + + Public Sub New(ByVal session As Session) + MyBase.New(session) + End Sub + + Private _Name As String + + Public Property Name As String + Get + Return _Name + End Get + + Set(ByVal value As String) + SetPropertyValue(Of String)(NameOf(Category.Name), _Name, value) + End Set + End Property + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/ProductView.vb b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/ProductView.vb index 6ce07c1..b17016c 100644 --- a/VB/NonPersistentObjectsDemo.Module/BusinessObjects/ProductView.vb +++ b/VB/NonPersistentObjectsDemo.Module/BusinessObjects/ProductView.vb @@ -1,92 +1,102 @@ -Imports System +Imports System Imports System.Collections.Generic Imports System.ComponentModel -Imports System.Linq -Imports System.Text -Imports System.Threading.Tasks Imports DevExpress.Data.Filtering Imports DevExpress.ExpressApp Imports DevExpress.Persistent.Base Namespace NonPersistentObjectsDemo.Module.BusinessObjects - - - Public Class ProductView - Inherits NonPersistentObjectBase - - Private _AllProducts As IList(Of Product) - Public ReadOnly Property AllProducts() As IList(Of Product) - Get - If _AllProducts Is Nothing Then - _AllProducts = ObjectSpace.GetObjects(Of Product)() - End If - Return _AllProducts - End Get - End Property - Private _Category As Category - - Public Property Category() As Category - Get - Return _Category - End Get - Set(ByVal value As Category) - If value IsNot Category Then - _Category = value - OnPropertyChanged(NameOf(Category)) - UpdateProducts() - OnPropertyChanged(NameOf(Products)) - End If - End Set - End Property - Private Sub UpdateProducts() - If _Products IsNot Nothing Then - ObjectSpace.ApplyCriteria(_Products, CriteriaOperator.Parse("? is null or Category = ?", Category, Category)) - End If - End Sub - Private _Products As IList(Of Product) - Public ReadOnly Property Products() As IList(Of Product) - Get - If _Products Is Nothing Then - _Products = ObjectSpace.GetObjects(Of Product)() - UpdateProducts() - End If - Return _Products - End Get - End Property - End Class - - Friend Class ProductViewAdapter - Private objectSpace As NonPersistentObjectSpace - Private isDirty As Boolean = True - - Public Sub New(ByVal npos As NonPersistentObjectSpace) - Me.objectSpace = npos - AddHandler objectSpace.ObjectGetting, AddressOf ObjectSpace_ObjectGetting - AddHandler objectSpace.Reloaded, AddressOf ObjectSpace_Reloaded - AddHandler objectSpace.ModifiedChanging, AddressOf ObjectSpace_ModifiedChanging - End Sub - Private Sub ObjectSpace_ModifiedChanging(ByVal sender As Object, ByVal e As ObjectSpaceModificationEventArgs) - If e.MemberInfo IsNot Nothing Then - If e.MemberInfo.Owner.Type Is GetType(ProductView) AndAlso e.MemberInfo.Name = NameOf(ProductView.Category) Then - e.Cancel = True - End If - End If - End Sub - Private Sub ObjectSpace_Reloaded(ByVal sender As Object, ByVal e As EventArgs) - isDirty = True - End Sub - Private Sub ObjectSpace_ObjectGetting(ByVal sender As Object, ByVal e As ObjectGettingEventArgs) - If TypeOf e.SourceObject Is ProductView Then - Dim obj = CType(e.SourceObject, ProductView) - If isDirty Then - Dim clone = New ProductView() - clone.Category = objectSpace.GetObject(Of Category)(obj.Category) - e.TargetObject = clone - isDirty = False - End If - End If - End Sub - End Class + + + Public Class ProductView + Inherits NonPersistentObjectBase + Private _AllProducts As IList(Of Product) + + Public ReadOnly Property AllProducts As IList(Of Product) + Get + If _AllProducts Is Nothing Then + _AllProducts = ObjectSpaceProp.GetObjects(Of Product)() + End If + + Return _AllProducts + End Get + End Property + + Private _Category As Category + + + Public Property Category As Category + Get + Return _Category + End Get + + Set(ByVal value As Category) + If value IsNot Category Then + _Category = value + OnPropertyChanged(NameOf(ProductView.Category)) + UpdateProducts() + OnPropertyChanged(NameOf(ProductView.Products)) + End If + End Set + End Property + + Private Sub UpdateProducts() + If _Products IsNot Nothing Then + ObjectSpaceProp.ApplyCriteria(_Products, CriteriaOperator.Parse("? is null or Category = ?", Category, Category)) + End If + End Sub + + Private _Products As IList(Of Product) + + Public ReadOnly Property Products As IList(Of Product) + Get + If _Products Is Nothing Then + _Products = ObjectSpaceProp.GetObjects(Of Product)() + UpdateProducts() + End If + + Return _Products + End Get + End Property + End Class + + Friend Class ProductViewAdapter + + Private objectSpace As NonPersistentObjectSpace + + Private isDirty As Boolean = True + + Public Sub New(ByVal npos As NonPersistentObjectSpace) + objectSpace = npos + AddHandler objectSpace.ObjectGetting, AddressOf ObjectSpace_ObjectGetting + AddHandler objectSpace.Reloaded, AddressOf ObjectSpace_Reloaded + AddHandler objectSpace.ModifiedChanging, AddressOf ObjectSpace_ModifiedChanging + End Sub + + Private Sub ObjectSpace_ModifiedChanging(ByVal sender As Object, ByVal e As ObjectSpaceModificationEventArgs) + If e.MemberInfo IsNot Nothing Then + If e.MemberInfo.Owner.Type Is GetType(ProductView) AndAlso Equals(e.MemberInfo.Name, NameOf(ProductView.Category)) Then + e.Cancel = True + End If + End If + End Sub + + Private Sub ObjectSpace_Reloaded(ByVal sender As Object, ByVal e As EventArgs) + isDirty = True + End Sub + + Private Sub ObjectSpace_ObjectGetting(ByVal sender As Object, ByVal e As ObjectGettingEventArgs) + If TypeOf e.SourceObject Is ProductView Then + Dim obj = CType(e.SourceObject, ProductView) + If isDirty Then + Dim clone = New ProductView() + clone.Category = objectSpace.GetObject(obj.Category) + e.TargetObject = clone + isDirty = False + End If + End If + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/Controllers/NonPersistentObjectActivatorController.vb b/VB/NonPersistentObjectsDemo.Module/Controllers/NonPersistentObjectActivatorController.vb index e7f895f..c695d83 100644 --- a/VB/NonPersistentObjectsDemo.Module/Controllers/NonPersistentObjectActivatorController.vb +++ b/VB/NonPersistentObjectsDemo.Module/Controllers/NonPersistentObjectActivatorController.vb @@ -1,53 +1,54 @@ -Imports System -Imports System.Collections.Generic -Imports System.Linq -Imports System.Text -Imports System.Threading.Tasks Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Model Imports DevExpress.ExpressApp.SystemModule Imports NonPersistentObjectsDemo.Module.BusinessObjects Namespace NonPersistentObjectsDemo.Module.Controllers - Public Class NonPersistentObjectActivatorController - Inherits WindowController - - Private showNavigationItemController As ShowNavigationItemController - Public Sub New() - TargetWindowType = WindowType.Main - End Sub - Protected Overrides Sub OnActivated() - MyBase.OnActivated() - showNavigationItemController = Frame.GetController(Of ShowNavigationItemController)() - If showNavigationItemController IsNot Nothing Then - AddHandler showNavigationItemController.CustomShowNavigationItem, AddressOf ShowNavigationItemController_CustomShowNavigationItem - End If - End Sub - Protected Overrides Sub OnDeactivated() - If showNavigationItemController IsNot Nothing Then - RemoveHandler showNavigationItemController.CustomShowNavigationItem, AddressOf ShowNavigationItemController_CustomShowNavigationItem - End If - MyBase.OnDeactivated() - End Sub - Private Sub ShowNavigationItemController_CustomShowNavigationItem(ByVal sender As Object, ByVal e As CustomShowNavigationItemEventArgs) - Dim args = e.ActionArguments - Dim shortcut = TryCast(args.SelectedChoiceActionItem.Data, ViewShortcut) - If shortcut IsNot Nothing Then - Dim model = Application.FindModelView(shortcut.ViewId) - If TypeOf model Is IModelDetailView AndAlso String.IsNullOrEmpty(shortcut.ObjectKey) Then - Dim objectType = DirectCast(model, IModelDetailView).ModelClass.TypeInfo.Type - If GetType(ProductView).IsAssignableFrom(objectType) Then - Dim objectSpace = Application.CreateObjectSpace(objectType) - Dim obj = objectSpace.CreateObject(objectType) - objectSpace.RemoveFromModifiedObjects(obj) - Dim detailView = Application.CreateDetailView(objectSpace, shortcut.ViewId, True, obj) - detailView.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit - args.ShowViewParameters.CreatedView = detailView - args.ShowViewParameters.TargetWindow = TargetWindow.Current - e.Handled = True - End If - End If - End If - End Sub - End Class + + Public Class NonPersistentObjectActivatorController + Inherits WindowController + + Private showNavigationItemController As ShowNavigationItemController + + Public Sub New() + TargetWindowType = WindowType.Main + End Sub + + Protected Overrides Sub OnActivated() + MyBase.OnActivated() + showNavigationItemController = Frame.GetController(Of ShowNavigationItemController)() + If showNavigationItemController IsNot Nothing Then + AddHandler showNavigationItemController.CustomShowNavigationItem, AddressOf ShowNavigationItemController_CustomShowNavigationItem + End If + End Sub + + Protected Overrides Sub OnDeactivated() + If showNavigationItemController IsNot Nothing Then + RemoveHandler showNavigationItemController.CustomShowNavigationItem, AddressOf ShowNavigationItemController_CustomShowNavigationItem + End If + + MyBase.OnDeactivated() + End Sub + + Private Sub ShowNavigationItemController_CustomShowNavigationItem(ByVal sender As Object, ByVal e As CustomShowNavigationItemEventArgs) + Dim args = e.ActionArguments + Dim shortcut = TryCast(args.SelectedChoiceActionItem.Data, ViewShortcut) + If shortcut IsNot Nothing Then + Dim model = Application.FindModelView(shortcut.ViewId) + If TypeOf model Is IModelDetailView AndAlso String.IsNullOrEmpty(shortcut.ObjectKey) Then + Dim objectType = CType(model, IModelDetailView).ModelClass.TypeInfo.Type + If GetType(ProductView).IsAssignableFrom(objectType) Then + Dim objectSpace = Application.CreateObjectSpace(objectType) + Dim obj = objectSpace.CreateObject(objectType) + objectSpace.RemoveFromModifiedObjects(obj) + Dim detailView = Application.CreateDetailView(objectSpace, shortcut.ViewId, True, obj) + detailView.ViewEditMode = Editors.ViewEditMode.Edit + args.ShowViewParameters.CreatedView = detailView + args.ShowViewParameters.TargetWindow = TargetWindow.Current + e.Handled = True + End If + End If + End If + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/Controllers/ProductViewNestedCollectionController.vb b/VB/NonPersistentObjectsDemo.Module/Controllers/ProductViewNestedCollectionController.vb index a075f1f..316d568 100644 --- a/VB/NonPersistentObjectsDemo.Module/Controllers/ProductViewNestedCollectionController.vb +++ b/VB/NonPersistentObjectsDemo.Module/Controllers/ProductViewNestedCollectionController.vb @@ -1,26 +1,23 @@ -Imports System -Imports System.Collections.Generic -Imports System.Linq -Imports System.Text -Imports System.Threading.Tasks Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.SystemModule Imports NonPersistentObjectsDemo.Module.BusinessObjects Namespace NonPersistentObjectsDemo.Module.Controllers - Public Class ProductViewNestedCollectionController - Inherits ObjectViewController(Of ListView, Product) - Public Sub New() - TargetViewNesting = Nesting.Nested - End Sub - Protected Overrides Sub OnActivated() - MyBase.OnActivated() - Dim pcs = TryCast(View.CollectionSource, PropertyCollectionSource) - Dim linkUnlinkController = Frame.GetController(Of LinkUnlinkController)() - If linkUnlinkController IsNot Nothing Then - linkUnlinkController.Active("NotInProductView") = Not (pcs IsNot Nothing AndAlso (TypeOf pcs.MasterObject Is ProductView)) - End If - End Sub - End Class + Public Class ProductViewNestedCollectionController + Inherits ObjectViewController(Of ListView, Product) + + Public Sub New() + TargetViewNesting = Nesting.Nested + End Sub + + Protected Overrides Sub OnActivated() + MyBase.OnActivated() + Dim pcs = TryCast(View.CollectionSource, PropertyCollectionSource) + Dim linkUnlinkController = Frame.GetController(Of LinkUnlinkController)() + If linkUnlinkController IsNot Nothing Then + linkUnlinkController.Active("NotInProductView") = Not(pcs IsNot Nothing AndAlso (TypeOf pcs.MasterObject Is ProductView)) + End If + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/DatabaseUpdate/Updater.vb b/VB/NonPersistentObjectsDemo.Module/DatabaseUpdate/Updater.vb index 59d2c1a..ba439b5 100644 --- a/VB/NonPersistentObjectsDemo.Module/DatabaseUpdate/Updater.vb +++ b/VB/NonPersistentObjectsDemo.Module/DatabaseUpdate/Updater.vb @@ -1,86 +1,86 @@ -Imports System -Imports System.Linq +Imports System Imports DevExpress.ExpressApp Imports DevExpress.Data.Filtering Imports DevExpress.Persistent.Base Imports DevExpress.ExpressApp.Updating Imports DevExpress.ExpressApp.Security -Imports DevExpress.ExpressApp.SystemModule -Imports DevExpress.ExpressApp.Security.Strategy -Imports DevExpress.Xpo -Imports DevExpress.ExpressApp.Xpo Imports DevExpress.Persistent.BaseImpl Imports DevExpress.Persistent.BaseImpl.PermissionPolicy Imports NonPersistentObjectsDemo.Module.BusinessObjects Namespace NonPersistentObjectsDemo.Module.DatabaseUpdate - ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Updating.ModuleUpdater - Public Class Updater - Inherits ModuleUpdater - Public Sub New(ByVal objectSpace As IObjectSpace, ByVal currentDBVersion As Version) - MyBase.New(objectSpace, currentDBVersion) - End Sub - Public Overrides Sub UpdateDatabaseAfterUpdateSchema() - MyBase.UpdateDatabaseAfterUpdateSchema() - 'CreateSecurityObjects(); - Call (New DemoDataCreator(ObjectSpace)).CreateDemoObjects() - ObjectSpace.CommitChanges() - End Sub + ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Updating.ModuleUpdater + Public Class Updater + Inherits ModuleUpdater - #Region "Security" - Private Sub CreateSecurityObjects() - Dim sampleUser As PermissionPolicyUser = ObjectSpace.FindObject(Of PermissionPolicyUser)(New BinaryOperator("UserName", "User")) - If sampleUser Is Nothing Then - sampleUser = ObjectSpace.CreateObject(Of PermissionPolicyUser)() - sampleUser.UserName = "User" - sampleUser.SetPassword("") - End If - Dim defaultRole As PermissionPolicyRole = CreateDefaultRole() - sampleUser.Roles.Add(defaultRole) + Public Sub New(ByVal objectSpace As IObjectSpace, ByVal currentDBVersion As Version) + MyBase.New(objectSpace, currentDBVersion) + End Sub - Dim userAdmin As PermissionPolicyUser = ObjectSpace.FindObject(Of PermissionPolicyUser)(New BinaryOperator("UserName", "Admin")) - If userAdmin Is Nothing Then - userAdmin = ObjectSpace.CreateObject(Of PermissionPolicyUser)() - userAdmin.UserName = "Admin" - ' Set a password if the standard authentication type is used - userAdmin.SetPassword("") - End If - ' If a role with the Administrators name doesn't exist in the database, create this role - Dim adminRole As PermissionPolicyRole = ObjectSpace.FindObject(Of PermissionPolicyRole)(New BinaryOperator("Name", "Administrators")) - If adminRole Is Nothing Then - adminRole = ObjectSpace.CreateObject(Of PermissionPolicyRole)() - adminRole.Name = "Administrators" - End If - adminRole.IsAdministrative = True - userAdmin.Roles.Add(adminRole) - ObjectSpace.CommitChanges() 'This line persists created object(s). - End Sub - Private Function CreateDefaultRole() As PermissionPolicyRole - Dim defaultRole As PermissionPolicyRole = ObjectSpace.FindObject(Of PermissionPolicyRole)(New BinaryOperator("Name", "Default")) - If defaultRole Is Nothing Then - defaultRole = ObjectSpace.CreateObject(Of PermissionPolicyRole)() - defaultRole.Name = "Default" + Public Overrides Sub UpdateDatabaseAfterUpdateSchema() + MyBase.UpdateDatabaseAfterUpdateSchema() + 'CreateSecurityObjects(); + Call New DemoDataCreator(ObjectSpace).CreateDemoObjects() + ObjectSpace.CommitChanges() + End Sub - defaultRole.AddObjectPermission(Of PermissionPolicyUser)(SecurityOperations.Read, "[Oid] = CurrentUserId()", SecurityPermissionState.Allow) - defaultRole.AddNavigationPermission("Application/NavigationItems/Items/Default/Items/MyDetails", SecurityPermissionState.Allow) - defaultRole.AddMemberPermission(Of PermissionPolicyUser)(SecurityOperations.Write, "ChangePasswordOnFirstLogon", "[Oid] = CurrentUserId()", SecurityPermissionState.Allow) - defaultRole.AddMemberPermission(Of PermissionPolicyUser)(SecurityOperations.Write, "StoredPassword", "[Oid] = CurrentUserId()", SecurityPermissionState.Allow) - defaultRole.AddTypePermissionsRecursively(Of PermissionPolicyRole)(SecurityOperations.Read, SecurityPermissionState.Deny) - defaultRole.AddTypePermissionsRecursively(Of ModelDifference)(SecurityOperations.ReadWriteAccess, SecurityPermissionState.Allow) - defaultRole.AddTypePermissionsRecursively(Of ModelDifferenceAspect)(SecurityOperations.ReadWriteAccess, SecurityPermissionState.Allow) - defaultRole.AddTypePermissionsRecursively(Of ModelDifference)(SecurityOperations.Create, SecurityPermissionState.Allow) - defaultRole.AddTypePermissionsRecursively(Of ModelDifferenceAspect)(SecurityOperations.Create, SecurityPermissionState.Allow) - End If - Return defaultRole - End Function - #End Region +#Region "Security" + Private Sub CreateSecurityObjects() + Dim sampleUser As PermissionPolicyUser = ObjectSpace.FindObject(Of PermissionPolicyUser)(New BinaryOperator("UserName", "User")) + If sampleUser Is Nothing Then + sampleUser = ObjectSpace.CreateObject(Of PermissionPolicyUser)() + sampleUser.UserName = "User" + sampleUser.SetPassword("") + End If - Public Overrides Sub UpdateDatabaseBeforeUpdateSchema() - MyBase.UpdateDatabaseBeforeUpdateSchema() - 'if(CurrentDBVersion < new Version("1.1.0.0") && CurrentDBVersion > new Version("0.0.0.0")) { - ' RenameColumn("DomainObject1Table", "OldColumnName", "NewColumnName"); - '} - End Sub - End Class + Dim defaultRole As PermissionPolicyRole = CreateDefaultRole() + sampleUser.Roles.Add(defaultRole) + Dim userAdmin As PermissionPolicyUser = ObjectSpace.FindObject(Of PermissionPolicyUser)(New BinaryOperator("UserName", "Admin")) + If userAdmin Is Nothing Then + userAdmin = ObjectSpace.CreateObject(Of PermissionPolicyUser)() + userAdmin.UserName = "Admin" + ' Set a password if the standard authentication type is used + userAdmin.SetPassword("") + End If + + ' If a role with the Administrators name doesn't exist in the database, create this role + Dim adminRole As PermissionPolicyRole = ObjectSpace.FindObject(Of PermissionPolicyRole)(New BinaryOperator("Name", "Administrators")) + If adminRole Is Nothing Then + adminRole = ObjectSpace.CreateObject(Of PermissionPolicyRole)() + adminRole.Name = "Administrators" + End If + + adminRole.IsAdministrative = True + userAdmin.Roles.Add(adminRole) + ObjectSpace.CommitChanges() 'This line persists created object(s). + End Sub + + Private Function CreateDefaultRole() As PermissionPolicyRole + Dim defaultRole As PermissionPolicyRole = ObjectSpace.FindObject(Of PermissionPolicyRole)(New BinaryOperator("Name", "Default")) + If defaultRole Is Nothing Then + defaultRole = ObjectSpace.CreateObject(Of PermissionPolicyRole)() + defaultRole.Name = "Default" + defaultRole.AddObjectPermission(Of PermissionPolicyUser)(SecurityOperations.Read, "[Oid] = CurrentUserId()", SecurityPermissionState.Allow) + defaultRole.AddNavigationPermission("Application/NavigationItems/Items/Default/Items/MyDetails", SecurityPermissionState.Allow) + defaultRole.AddMemberPermission(Of PermissionPolicyUser)(SecurityOperations.Write, "ChangePasswordOnFirstLogon", "[Oid] = CurrentUserId()", SecurityPermissionState.Allow) + defaultRole.AddMemberPermission(Of PermissionPolicyUser)(SecurityOperations.Write, "StoredPassword", "[Oid] = CurrentUserId()", SecurityPermissionState.Allow) + defaultRole.AddTypePermissionsRecursively(Of PermissionPolicyRole)(SecurityOperations.Read, SecurityPermissionState.Deny) + defaultRole.AddTypePermissionsRecursively(Of ModelDifference)(SecurityOperations.ReadWriteAccess, SecurityPermissionState.Allow) + defaultRole.AddTypePermissionsRecursively(Of ModelDifferenceAspect)(SecurityOperations.ReadWriteAccess, SecurityPermissionState.Allow) + defaultRole.AddTypePermissionsRecursively(Of ModelDifference)(SecurityOperations.Create, SecurityPermissionState.Allow) + defaultRole.AddTypePermissionsRecursively(Of ModelDifferenceAspect)(SecurityOperations.Create, SecurityPermissionState.Allow) + End If + + Return defaultRole + End Function + +#End Region + Public Overrides Sub UpdateDatabaseBeforeUpdateSchema() + MyBase.UpdateDatabaseBeforeUpdateSchema() + 'if(CurrentDBVersion < new Version("1.1.0.0") && CurrentDBVersion > new Version("0.0.0.0")) { + ' RenameColumn("DomainObject1Table", "OldColumnName", "NewColumnName"); + '} + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/Module.Designer.vb b/VB/NonPersistentObjectsDemo.Module/Module.Designer.vb index ffe8605..85acad8 100644 --- a/VB/NonPersistentObjectsDemo.Module/Module.Designer.vb +++ b/VB/NonPersistentObjectsDemo.Module/Module.Designer.vb @@ -1,50 +1,51 @@ -Namespace NonPersistentObjectsDemo.Module - Partial Public Class NonPersistentObjectsDemoModule - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing +Namespace NonPersistentObjectsDemo.[Module] - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + Partial Class NonPersistentObjectsDemoModule - #Region "Component Designer generated code" + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - ' - ' NonPersistentObjectsDemoModule - ' - Me.AdditionalExportedTypes.Add(GetType(DevExpress.Persistent.BaseImpl.ModelDifference)) - Me.AdditionalExportedTypes.Add(GetType(DevExpress.Persistent.BaseImpl.ModelDifferenceAspect)) - Me.AdditionalExportedTypes.Add(GetType(DevExpress.Persistent.BaseImpl.BaseObject)) - 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.FileData)); - 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.FileAttachmentBase)); - 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.Event)); - 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.Resource)); - 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.HCategory)); - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.SystemModule.SystemModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.CloneObject.CloneObjectModule)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule)) - 'this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.ReportsModuleV2)); - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Scheduler.SchedulerModuleBase)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ScriptRecorder.ScriptRecorderModuleBase)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase)) - Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Validation.ValidationModule)) - End Sub + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() + End If - #End Region - End Class + MyBase.Dispose(disposing) + End Sub + +#Region "Component Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + ' + ' NonPersistentObjectsDemoModule + ' + Me.AdditionalExportedTypes.Add(GetType(DevExpress.Persistent.BaseImpl.ModelDifference)) + Me.AdditionalExportedTypes.Add(GetType(DevExpress.Persistent.BaseImpl.ModelDifferenceAspect)) + Me.AdditionalExportedTypes.Add(GetType(DevExpress.Persistent.BaseImpl.BaseObject)) + 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.FileData)); + 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.FileAttachmentBase)); + 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.Event)); + 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.Resource)); + 'this.AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.HCategory)); + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.SystemModule.SystemModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.CloneObject.CloneObjectModule)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule)) + 'this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.ReportsModuleV2)); + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Scheduler.SchedulerModuleBase)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.ScriptRecorder.ScriptRecorderModuleBase)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase)) + Me.RequiredModuleTypes.Add(GetType(DevExpress.ExpressApp.Validation.ValidationModule)) + End Sub +#End Region + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/Module.vb b/VB/NonPersistentObjectsDemo.Module/Module.vb index 365a924..bb93a0e 100644 --- a/VB/NonPersistentObjectsDemo.Module/Module.vb +++ b/VB/NonPersistentObjectsDemo.Module/Module.vb @@ -1,61 +1,59 @@ -Imports System -Imports System.Text +Imports System Imports System.Linq Imports DevExpress.ExpressApp Imports System.ComponentModel Imports DevExpress.ExpressApp.DC Imports System.Collections.Generic -Imports DevExpress.Persistent.Base Imports DevExpress.Persistent.BaseImpl -Imports DevExpress.Persistent.BaseImpl.PermissionPolicy -Imports DevExpress.ExpressApp.Model -Imports DevExpress.ExpressApp.Actions -Imports DevExpress.ExpressApp.Editors Imports DevExpress.ExpressApp.Updating -Imports DevExpress.ExpressApp.Model.Core -Imports DevExpress.ExpressApp.Model.DomainLogics -Imports DevExpress.ExpressApp.Model.NodeGenerators Imports DevExpress.ExpressApp.Xpo Imports NonPersistentObjectsDemo.Module.BusinessObjects Namespace NonPersistentObjectsDemo.Module - ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.ModuleBase. - Public NotInheritable Partial Class NonPersistentObjectsDemoModule - Inherits ModuleBase - - Public Sub New() - InitializeComponent() - BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction - End Sub - Public Overrides Function GetModuleUpdaters(ByVal objectSpace As IObjectSpace, ByVal versionFromDB As Version) As IEnumerable(Of ModuleUpdater) - Dim updater As ModuleUpdater = New DatabaseUpdate.Updater(objectSpace, versionFromDB) - Return New ModuleUpdater() { updater } - End Function - Public Overrides Sub Setup(ByVal application As XafApplication) - MyBase.Setup(application) - ' Manage various aspects of the application UI and behavior at the module level. - AddHandler application.SetupComplete, AddressOf Application_SetupComplete - End Sub - Private Sub Application_SetupComplete(ByVal sender As Object, ByVal e As EventArgs) - AddHandler Application.ObjectSpaceCreated, AddressOf Application_ObjectSpaceCreated - NonPersistentObjectSpace.UseKeyComparisonToDetermineIdentity = True - End Sub - Private Sub Application_ObjectSpaceCreated(ByVal sender As Object, ByVal e As ObjectSpaceCreatedEventArgs) - Dim npos = TryCast(e.ObjectSpace, NonPersistentObjectSpace) - If npos IsNot Nothing Then - If Not npos.AdditionalObjectSpaces.Any(Function(os) os.IsKnownType(GetType(BaseObject))) Then - Dim persistentObjectSpace As IObjectSpace = Application.CreateObjectSpace(GetType(BaseObject)) - npos.AdditionalObjectSpaces.Add(persistentObjectSpace) - End If - npos.AutoDisposeAdditionalObjectSpaces = True - npos.AutoRefreshAdditionalObjectSpaces = True - npos.AutoCommitAdditionalObjectSpaces = True - Dim tempVar As New ProductViewAdapter(npos) - End If - End Sub - Public Overrides Sub CustomizeTypesInfo(ByVal typesInfo As ITypesInfo) - MyBase.CustomizeTypesInfo(typesInfo) - CalculatedPersistentAliasHelper.CustomizeTypesInfo(typesInfo) - End Sub - End Class + + ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.ModuleBase. + Public NotInheritable Partial Class NonPersistentObjectsDemoModule + Inherits ModuleBase + + Public Sub New() + InitializeComponent() + BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction + End Sub + + Public Overrides Function GetModuleUpdaters(ByVal objectSpace As IObjectSpace, ByVal versionFromDB As Version) As IEnumerable(Of ModuleUpdater) + Dim updater As ModuleUpdater = New DatabaseUpdate.Updater(objectSpace, versionFromDB) + Return New ModuleUpdater() {updater} + End Function + + Public Overrides Sub Setup(ByVal application As XafApplication) + MyBase.Setup(application) + ' Manage various aspects of the application UI and behavior at the module level. + AddHandler application.SetupComplete, AddressOf Application_SetupComplete + End Sub + + Private Sub Application_SetupComplete(ByVal sender As Object, ByVal e As EventArgs) + AddHandler Application.ObjectSpaceCreated, AddressOf Application_ObjectSpaceCreated + NonPersistentObjectSpace.UseKeyComparisonToDetermineIdentity = True + End Sub + + Private Sub Application_ObjectSpaceCreated(ByVal sender As Object, ByVal e As ObjectSpaceCreatedEventArgs) + Dim npos = TryCast(e.ObjectSpace, NonPersistentObjectSpace) + If npos IsNot Nothing Then + If Not npos.AdditionalObjectSpaces.Any(Function(os) os.IsKnownType(GetType(BaseObject))) Then + Dim persistentObjectSpace As IObjectSpace = Application.CreateObjectSpace(GetType(BaseObject)) + npos.AdditionalObjectSpaces.Add(persistentObjectSpace) + End If + + npos.AutoDisposeAdditionalObjectSpaces = True + npos.AutoRefreshAdditionalObjectSpaces = True + npos.AutoCommitAdditionalObjectSpaces = True + Dim tmp_ProductViewAdapter = New ProductViewAdapter(npos) + End If + End Sub + + Public Overrides Sub CustomizeTypesInfo(ByVal typesInfo As ITypesInfo) + MyBase.CustomizeTypesInfo(typesInfo) + CalculatedPersistentAliasHelper.CustomizeTypesInfo(typesInfo) + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Module/NonPersistentObjectsDemo.Module.vbproj b/VB/NonPersistentObjectsDemo.Module/NonPersistentObjectsDemo.Module.vbproj index f033fa1..46684eb 100644 --- a/VB/NonPersistentObjectsDemo.Module/NonPersistentObjectsDemo.Module.vbproj +++ b/VB/NonPersistentObjectsDemo.Module/NonPersistentObjectsDemo.Module.vbproj @@ -1,62 +1,44 @@ - + + On Debug AnyCPU {57ACDBDB-006E-43D3-9308-97857F2FF75D} Library - + Properties + + NonPersistentObjectsDemo.Module v4.5.2 512 - On - Binary - Off - On true full false bin\Debug\ - true - true + DEBUG,TRACE prompt - true + 4 pdbonly true bin\Release\ - false - true + TRACE prompt - true + 4 true bin\EasyTest\ - true - true - EASYTEST=True + TRACE,DEBUG,EASYTEST full AnyCPU prompt - true - - - - - - - - - - - - False @@ -172,7 +154,7 @@ Module.vb - + @@ -193,11 +175,11 @@ - - + \ No newline at end of file diff --git a/VB/NonPersistentObjectsDemo.Module/Properties/AssemblyInfo.vb b/VB/NonPersistentObjectsDemo.Module/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..ca884b8 --- /dev/null +++ b/VB/NonPersistentObjectsDemo.Module/Properties/AssemblyInfo.vb @@ -0,0 +1,29 @@ +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + +' The following GUID is for the ID of the typelib if this project is exposed to COM + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' + + diff --git a/VB/NonPersistentObjectsDemo.Web/Default.aspx b/VB/NonPersistentObjectsDemo.Web/Default.aspx index 918be8f..c5ae3a4 100644 --- a/VB/NonPersistentObjectsDemo.Web/Default.aspx +++ b/VB/NonPersistentObjectsDemo.Web/Default.aspx @@ -1,5 +1,5 @@ -<%@ Page Language="C#" AutoEventWireup="true" Inherits="Default" EnableViewState="false" - ValidateRequest="false" CodeBehind="Default.aspx.cs" %> +<%@ Page Language="VB" AutoEventWireup="true" Inherits="Default" EnableViewState="false" + ValidateRequest="false" CodeBehind="Default.aspx.vb" %> <%@ Register Assembly="DevExpress.ExpressApp.Web.v20.1" Namespace="DevExpress.ExpressApp.Web.Templates" TagPrefix="cc3" %> <%@ Register Assembly="DevExpress.ExpressApp.Web.v20.1" @@ -16,4 +16,4 @@
- \ No newline at end of file + diff --git a/VB/NonPersistentObjectsDemo.Web/Default.aspx.designer.vb b/VB/NonPersistentObjectsDemo.Web/Default.aspx.designer.vb index 9a635ed..054dabb 100644 --- a/VB/NonPersistentObjectsDemo.Web/Default.aspx.designer.vb +++ b/VB/NonPersistentObjectsDemo.Web/Default.aspx.designer.vb @@ -1,4 +1,4 @@ -'------------------------------------------------------------------------------ +'------------------------------------------------------------------------------ ' ' This code was generated by a tool. ' @@ -6,35 +6,32 @@ ' the code is regenerated. ' '------------------------------------------------------------------------------ +Public Partial Class [Default] + ''' + ''' form2 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected form2 As Global.System.Web.UI.HtmlControls.HtmlForm + ''' + ''' ProgressControl control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ProgressControl As Global.DevExpress.ExpressApp.Web.Controls.ASPxProgressControl -Partial Public Class [Default] - - ''' - ''' form2 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected form2 As System.Web.UI.HtmlControls.HtmlForm - - ''' - ''' ProgressControl control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ProgressControl As Global.DevExpress.ExpressApp.Web.Controls.ASPxProgressControl - - ''' - ''' Content control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected Content As System.Web.UI.HtmlControls.HtmlGenericControl + ''' + ''' Content control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected Content As Global.System.Web.UI.HtmlControls.HtmlGenericControl End Class diff --git a/VB/NonPersistentObjectsDemo.Web/Default.aspx.vb b/VB/NonPersistentObjectsDemo.Web/Default.aspx.vb index 90b1180..f3a7282 100644 --- a/VB/NonPersistentObjectsDemo.Web/Default.aspx.vb +++ b/VB/NonPersistentObjectsDemo.Web/Default.aspx.vb @@ -1,20 +1,17 @@ -Imports System -Imports System.Collections.Generic Imports System.Web.UI Imports DevExpress.ExpressApp.Templates -Imports DevExpress.ExpressApp.Web Imports DevExpress.ExpressApp.Web.Templates -Imports DevExpress.ExpressApp.Web.Templates.ActionContainers -Partial Public Class [Default] - Inherits BaseXafPage +Public Partial Class [Default] + Inherits BaseXafPage - Protected Overrides Function CreateContextActionsMenu() As ContextActionsMenu - Return New ContextActionsMenu(Me, "Edit", "RecordEdit", "ObjectsCreation", "ListView", "Reports") - End Function - Public Overrides ReadOnly Property InnerContentPlaceHolder() As Control - Get - Return Content - End Get - End Property -End Class \ No newline at end of file + Protected Overrides Function CreateContextActionsMenu() As ContextActionsMenu + Return New ContextActionsMenu(Me, "Edit", "RecordEdit", "ObjectsCreation", "ListView", "Reports") + End Function + + Public Overrides ReadOnly Property InnerContentPlaceHolder As Control + Get + Return Content + End Get + End Property +End Class diff --git a/VB/NonPersistentObjectsDemo.Web/Error.aspx b/VB/NonPersistentObjectsDemo.Web/Error.aspx index 5cd4348..d945b38 100644 --- a/VB/NonPersistentObjectsDemo.Web/Error.aspx +++ b/VB/NonPersistentObjectsDemo.Web/Error.aspx @@ -1,5 +1,5 @@ -<%@ Page Language="c#" AutoEventWireup="false" Inherits="ErrorPage" EnableViewState="false" - ValidateRequest="false" CodeBehind="Error.aspx.cs" %> +<%@ Page Language="VB" AutoEventWireup="false" Inherits="ErrorPage" EnableViewState="false" + ValidateRequest="false" CodeBehind="Error.aspx.vb" %> diff --git a/VB/NonPersistentObjectsDemo.Web/Error.aspx.designer.vb b/VB/NonPersistentObjectsDemo.Web/Error.aspx.designer.vb index 4155220..fce67df 100644 --- a/VB/NonPersistentObjectsDemo.Web/Error.aspx.designer.vb +++ b/VB/NonPersistentObjectsDemo.Web/Error.aspx.designer.vb @@ -1,4 +1,4 @@ -'------------------------------------------------------------------------------ +'------------------------------------------------------------------------------ ' ' This code was generated by a tool. ' @@ -6,161 +6,158 @@ ' the code is regenerated. ' '------------------------------------------------------------------------------ - - - -Partial Public Class ErrorPage - - ''' - ''' Head1 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected Head1 As System.Web.UI.HtmlControls.HtmlHead - - ''' - ''' form1 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected form1 As System.Web.UI.HtmlControls.HtmlForm - - ''' - ''' ApplicationTitle control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ApplicationTitle As System.Web.UI.WebControls.Literal - - ''' - ''' InfoMessagesPanel control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected InfoMessagesPanel As System.Web.UI.WebControls.Literal - - ''' - ''' Table1 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected Table1 As System.Web.UI.WebControls.Table - - ''' - ''' TableRow2 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected TableRow2 As System.Web.UI.WebControls.TableRow - - ''' - ''' ViewSite control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ViewSite As System.Web.UI.WebControls.TableCell - - ''' - ''' ErrorTitleLiteral control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ErrorTitleLiteral As System.Web.UI.WebControls.Literal - - ''' - ''' ErrorPanel control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ErrorPanel As System.Web.UI.WebControls.Panel - - ''' - ''' ApologizeMessage control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ApologizeMessage As System.Web.UI.WebControls.PlaceHolder - - ''' - ''' HyperLink1 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected HyperLink1 As System.Web.UI.WebControls.HyperLink - - ''' - ''' NavigateToStart control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected NavigateToStart As System.Web.UI.WebControls.LinkButton - - ''' - ''' Details control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected Details As System.Web.UI.WebControls.Panel - - ''' - ''' DetailsText control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected DetailsText As System.Web.UI.WebControls.Literal - - ''' - ''' ReportForm control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ReportForm As System.Web.UI.WebControls.Panel - - ''' - ''' DescriptionTextBox control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected DescriptionTextBox As System.Web.UI.WebControls.TextBox - - ''' - ''' ReportButton control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ReportButton As System.Web.UI.WebControls.Button +Public Partial Class ErrorPage + + ''' + ''' Head1 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected Head1 As Global.System.Web.UI.HtmlControls.HtmlHead + + ''' + ''' form1 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected form1 As Global.System.Web.UI.HtmlControls.HtmlForm + + ''' + ''' ApplicationTitle control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ApplicationTitle As Global.System.Web.UI.WebControls.Literal + + ''' + ''' InfoMessagesPanel control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected InfoMessagesPanel As Global.System.Web.UI.WebControls.Literal + + ''' + ''' Table1 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected Table1 As Global.System.Web.UI.WebControls.Table + + ''' + ''' TableRow2 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected TableRow2 As Global.System.Web.UI.WebControls.TableRow + + ''' + ''' ViewSite control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ViewSite As Global.System.Web.UI.WebControls.TableCell + + ''' + ''' ErrorTitleLiteral control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ErrorTitleLiteral As Global.System.Web.UI.WebControls.Literal + + ''' + ''' ErrorPanel control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ErrorPanel As Global.System.Web.UI.WebControls.Panel + + ''' + ''' ApologizeMessage control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ApologizeMessage As Global.System.Web.UI.WebControls.PlaceHolder + + ''' + ''' HyperLink1 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected HyperLink1 As Global.System.Web.UI.WebControls.HyperLink + + ''' + ''' NavigateToStart control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected NavigateToStart As Global.System.Web.UI.WebControls.LinkButton + + ''' + ''' Details control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected Details As Global.System.Web.UI.WebControls.Panel + + ''' + ''' DetailsText control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected DetailsText As Global.System.Web.UI.WebControls.Literal + + ''' + ''' ReportForm control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ReportForm As Global.System.Web.UI.WebControls.Panel + + ''' + ''' DescriptionTextBox control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected DescriptionTextBox As Global.System.Web.UI.WebControls.TextBox + + ''' + ''' ReportButton control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ReportButton As Global.System.Web.UI.WebControls.Button End Class diff --git a/VB/NonPersistentObjectsDemo.Web/Error.aspx.vb b/VB/NonPersistentObjectsDemo.Web/Error.aspx.vb index 053a4bf..18b7556 100644 --- a/VB/NonPersistentObjectsDemo.Web/Error.aspx.vb +++ b/VB/NonPersistentObjectsDemo.Web/Error.aspx.vb @@ -1,77 +1,78 @@ -Imports System +Imports System Imports System.Web.UI Imports DevExpress.ExpressApp.Web Imports DevExpress.ExpressApp.Web.SystemModule Imports DevExpress.ExpressApp.Web.Templates Imports DevExpress.ExpressApp.Web.TestScripts -Partial Public Class ErrorPage - Inherits System.Web.UI.Page +Public Partial Class ErrorPage + Inherits Page - Protected Overrides Sub InitializeCulture() - If WebApplication.Instance IsNot Nothing Then - WebApplication.Instance.InitializeCulture() - End If - End Sub - Protected Overrides Sub OnPreInit(ByVal e As EventArgs) - MyBase.OnPreInit(e) - BaseXafPage.SetupCurrentTheme() - End Sub - Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load - If TestScriptsManager.EasyTestEnabled Then - Dim testScriptsManager As New TestScriptsManager(Page) - testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "FormCaption", TestControlType.Field, "FormCaption") - testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "DescriptionTextBox", TestControlType.Field, "Description") - testScriptsManager.RegisterControl(JSDefaultTestControl.ClassName, "ReportButton", TestControlType.Action, "Report") - testScriptsManager.AllControlRegistered() - ClientScript.RegisterStartupScript(Me.GetType(), "EasyTest", testScriptsManager.GetScript(), True) - End If - If WebApplication.Instance IsNot Nothing Then - ApplicationTitle.Text = WebApplication.Instance.Title - Else - ApplicationTitle.Text = "No application" - End If - Header.Title = "Application Error - " & ApplicationTitle.Text + Protected Overrides Sub InitializeCulture() + If WebApplication.Instance IsNot Nothing Then Call WebApplication.Instance.InitializeCulture() + End Sub - Dim errorInfo As ErrorInfo = ErrorHandling.GetApplicationError() - If errorInfo IsNot Nothing Then - If ErrorHandling.CanShowDetailedInformation Then - DetailsText.Text = errorInfo.GetTextualPresentation(True) - Else - Details.Visible = False - End If - ReportForm.Visible = ErrorHandling.CanSendAlertToAdmin - Else - ErrorPanel.Visible = False - End If - End Sub - #Region "Web Form Designer generated code" - Protected Overrides Sub OnInit(ByVal e As EventArgs) - InitializeComponent() - MyBase.OnInit(e) - End Sub + Protected Overrides Sub OnPreInit(ByVal e As EventArgs) + MyBase.OnPreInit(e) + Call BaseXafPage.SetupCurrentTheme() + End Sub - Private Sub InitializeComponent() -'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: -'ORIGINAL LINE: this.Load += new System.EventHandler(this.Page_Load); -'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: -'ORIGINAL LINE: this.PreRender += new EventHandler(ErrorPage_PreRender); - End Sub + Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) + If TestScriptsManager.EasyTestEnabled Then + Dim testScriptsManager As TestScriptsManager = New TestScriptsManager(Page) + testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "FormCaption", TestControlType.Field, "FormCaption") + testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "DescriptionTextBox", TestControlType.Field, "Description") + testScriptsManager.RegisterControl(JSDefaultTestControl.ClassName, "ReportButton", TestControlType.Action, "Report") + testScriptsManager.AllControlRegistered() + ClientScript.RegisterStartupScript([GetType](), "EasyTest", testScriptsManager.GetScript(), True) + End If - Private Sub ErrorPage_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreRender - RegisterThemeAssemblyController.RegisterThemeResources(DirectCast(sender, Page)) - End Sub + If WebApplication.Instance IsNot Nothing Then + ApplicationTitle.Text = WebApplication.Instance.Title + Else + ApplicationTitle.Text = "No application" + End If + Header.Title = "Application Error - " & ApplicationTitle.Text + Dim errorInfo As ErrorInfo = ErrorHandling.GetApplicationError() + If errorInfo IsNot Nothing Then + If ErrorHandling.CanShowDetailedInformation Then + DetailsText.Text = errorInfo.GetTextualPresentation(True) + Else + Details.Visible = False + End If - #End Region - Protected Sub ReportButton_Click(ByVal sender As Object, ByVal e As EventArgs) - Dim errorInfo As ErrorInfo = ErrorHandling.GetApplicationError() - If errorInfo IsNot Nothing Then - ErrorHandling.SendAlertToAdmin(errorInfo.Id, DescriptionTextBox.Text, errorInfo.Exception.Message) - ClientScript.RegisterStartupScript(Me.GetType(), "alert", "alert('Your report has been sent. Thank you.');", True) - End If - End Sub - Protected Sub NavigateToStart_Click(ByVal sender As Object, ByVal e As EventArgs) - WebApplication.Instance.LogOff() - End Sub + ReportForm.Visible = ErrorHandling.CanSendAlertToAdmin + Else + ErrorPanel.Visible = False + End If + End Sub + +#Region "Web Form Designer generated code" + Overrides Protected Sub OnInit(ByVal e As EventArgs) + InitializeComponent() + MyBase.OnInit(e) + End Sub + + Private Sub InitializeComponent() + AddHandler Load, New EventHandler(AddressOf Page_Load) + AddHandler PreRender, New EventHandler(AddressOf ErrorPage_PreRender) + End Sub + + Private Sub ErrorPage_PreRender(ByVal sender As Object, ByVal e As EventArgs) + Call RegisterThemeAssemblyController.RegisterThemeResources(CType(sender, Page)) + End Sub + +#End Region + Protected Sub ReportButton_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim errorInfo As ErrorInfo = ErrorHandling.GetApplicationError() + If errorInfo IsNot Nothing Then + ErrorHandling.SendAlertToAdmin(errorInfo.Id, DescriptionTextBox.Text, errorInfo.Exception.Message) + ClientScript.RegisterStartupScript([GetType](), "alert", "alert('Your report has been sent. Thank you.');", True) + End If + End Sub + + Protected Sub NavigateToStart_Click(ByVal sender As Object, ByVal e As EventArgs) + Call WebApplication.Instance.LogOff() + End Sub End Class diff --git a/VB/NonPersistentObjectsDemo.Web/Global.asax b/VB/NonPersistentObjectsDemo.Web/Global.asax index 129093f..05f11fd 100644 --- a/VB/NonPersistentObjectsDemo.Web/Global.asax +++ b/VB/NonPersistentObjectsDemo.Web/Global.asax @@ -1 +1 @@ -<%@ Application Language="C#" CodeBehind="Global.asax.cs" Inherits="NonPersistentObjectsDemo.Web.Global"%> +<%@ Application Language="VB" CodeBehind="Global.asax.vb" Inherits="NonPersistentObjectsDemo.Web.Global"%> diff --git a/VB/NonPersistentObjectsDemo.Web/Global.asax.vb b/VB/NonPersistentObjectsDemo.Web/Global.asax.vb index 68b4fae..05d1b86 100644 --- a/VB/NonPersistentObjectsDemo.Web/Global.asax.vb +++ b/VB/NonPersistentObjectsDemo.Web/Global.asax.vb @@ -1,77 +1,86 @@ -Imports System +Imports System Imports System.Configuration -Imports System.Web.Configuration Imports System.Web Imports System.Web.Routing - Imports DevExpress.ExpressApp Imports DevExpress.Persistent.Base -Imports DevExpress.Persistent.BaseImpl Imports DevExpress.ExpressApp.Security Imports DevExpress.ExpressApp.Web Imports DevExpress.Web Namespace NonPersistentObjectsDemo.Web - Public Class [Global] - Inherits System.Web.HttpApplication - Public Sub New() - InitializeComponent() - End Sub - Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) - RouteTable.Routes.RegisterXafRoutes() - DevExpress.ExpressApp.BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = True - AddHandler ASPxWebControl.CallbackError, AddressOf Application_Error -#If EASYTEST Then - DevExpress.ExpressApp.Web.TestScripts.TestScriptsManager.EasyTestEnabled = True + Public Class [Global] + Inherits HttpApplication + + Public Sub New() + InitializeComponent() + End Sub + + Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) + Call RouteTable.Routes.RegisterXafRoutes() + BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = True + AddHandler ASPxWebControl.CallbackError, New EventHandler(AddressOf Application_Error) +#If EASYTEST + DevExpress.ExpressApp.Web.TestScripts.TestScriptsManager.EasyTestEnabled = true; #End If - End Sub - Protected Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) - Tracing.Initialize() - WebApplication.SetInstance(Session, New NonPersistentObjectsDemoAspNetApplication()) - 'SecurityStrategy security = (SecurityStrategy)WebApplication.Instance.Security; - 'security.RegisterXPOAdapterProviders(); - DevExpress.ExpressApp.Web.Templates.DefaultVerticalTemplateContentNew.ClearSizeLimit() - WebApplication.Instance.SwitchToNewStyle() - If ConfigurationManager.ConnectionStrings("ConnectionString") IsNot Nothing Then - WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString - End If -#If EASYTEST Then - If ConfigurationManager.ConnectionStrings("EasyTestConnectionString") IsNot Nothing Then - WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings("EasyTestConnectionString").ConnectionString - End If + End Sub + + Protected Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) + Call Tracing.Initialize() + Call WebApplication.SetInstance(Session, New NonPersistentObjectsDemoAspNetApplication()) + 'SecurityStrategy security = (SecurityStrategy)WebApplication.Instance.Security; + 'security.RegisterXPOAdapterProviders(); + Templates.DefaultVerticalTemplateContentNew.ClearSizeLimit() + Call WebApplication.Instance.SwitchToNewStyle() + If ConfigurationManager.ConnectionStrings("ConnectionString") IsNot Nothing Then + WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString + End If + +#If EASYTEST + if(ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) { + WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString; + } #End If - WebApplication.Instance.ConnectionString = DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.ConnectionString -#If DEBUG Then - If System.Diagnostics.Debugger.IsAttached AndAlso WebApplication.Instance.CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema Then - WebApplication.Instance.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways - End If + WebApplication.Instance.ConnectionString = Xpo.InMemoryDataStoreProvider.ConnectionString +#If DEBUG + If System.Diagnostics.Debugger.IsAttached AndAlso WebApplication.Instance.CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema Then + WebApplication.Instance.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways + End If + #End If - WebApplication.Instance.Setup() - WebApplication.Instance.Start() - End Sub - Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) - End Sub - Protected Sub Application_EndRequest(ByVal sender As Object, ByVal e As EventArgs) - End Sub - Protected Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) - End Sub - Protected Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) - ErrorHandling.Instance.ProcessApplicationError() - End Sub - Protected Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) - WebApplication.LogOff(Session) - WebApplication.DisposeInstance(Session) - End Sub - Protected Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) - End Sub - #Region "Web Form Designer generated code" - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - End Sub - #End Region - End Class + Call WebApplication.Instance.Setup() + Call WebApplication.Instance.Start() + End Sub + + Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) + End Sub + + Protected Sub Application_EndRequest(ByVal sender As Object, ByVal e As EventArgs) + End Sub + + Protected Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) + End Sub + + Protected Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) + Call ErrorHandling.Instance.ProcessApplicationError() + End Sub + + Protected Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) + WebApplication.LogOff(Session) + WebApplication.DisposeInstance(Session) + End Sub + + Protected Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) + End Sub + +#Region "Web Form Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + End Sub +#End Region + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Web/Login.aspx b/VB/NonPersistentObjectsDemo.Web/Login.aspx index b610ff1..c6ec996 100644 --- a/VB/NonPersistentObjectsDemo.Web/Login.aspx +++ b/VB/NonPersistentObjectsDemo.Web/Login.aspx @@ -1,5 +1,5 @@ -<%@ Page Language="C#" AutoEventWireup="true" Inherits="LoginPage" EnableViewState="false" - ValidateRequest="false" CodeBehind="Login.aspx.cs" %> +<%@ Page Language="VB" AutoEventWireup="true" Inherits="LoginPage" EnableViewState="false" + ValidateRequest="false" CodeBehind="Login.aspx.vb" %> <%@ Register Assembly="DevExpress.ExpressApp.Web.v20.1" Namespace="DevExpress.ExpressApp.Web.Templates.ActionContainers" TagPrefix="cc2" %> <%@ Register Assembly="DevExpress.ExpressApp.Web.v20.1" diff --git a/VB/NonPersistentObjectsDemo.Web/Login.aspx.designer.vb b/VB/NonPersistentObjectsDemo.Web/Login.aspx.designer.vb index b729840..7d6d286 100644 --- a/VB/NonPersistentObjectsDemo.Web/Login.aspx.designer.vb +++ b/VB/NonPersistentObjectsDemo.Web/Login.aspx.designer.vb @@ -1,4 +1,4 @@ -'------------------------------------------------------------------------------ +'------------------------------------------------------------------------------ ' ' This code was generated by a tool. ' @@ -6,44 +6,41 @@ ' the code is regenerated. ' '------------------------------------------------------------------------------ +Public Partial Class LoginPage + ''' + ''' Head1 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected Head1 As Global.System.Web.UI.HtmlControls.HtmlHead + ''' + ''' form1 control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected form1 As Global.System.Web.UI.HtmlControls.HtmlForm -Partial Public Class LoginPage - - ''' - ''' Head1 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected Head1 As System.Web.UI.HtmlControls.HtmlHead - - ''' - ''' form1 control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected form1 As System.Web.UI.HtmlControls.HtmlForm - - ''' - ''' ProgressControl control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected ProgressControl As Global.DevExpress.ExpressApp.Web.Controls.ASPxProgressControl + ''' + ''' ProgressControl control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected ProgressControl As Global.DevExpress.ExpressApp.Web.Controls.ASPxProgressControl - ''' - ''' Content control. - ''' - ''' - ''' Auto-generated field. - ''' To modify move field declaration from designer file to code-behind file. - ''' - Protected Content As System.Web.UI.HtmlControls.HtmlGenericControl + ''' + ''' Content control. + ''' + ''' + ''' Auto-generated field. + ''' To modify move field declaration from designer file to code-behind file. + ''' + Protected Content As Global.System.Web.UI.HtmlControls.HtmlGenericControl End Class diff --git a/VB/NonPersistentObjectsDemo.Web/Login.aspx.vb b/VB/NonPersistentObjectsDemo.Web/Login.aspx.vb index 8edd0a0..a9330b0 100644 --- a/VB/NonPersistentObjectsDemo.Web/Login.aspx.vb +++ b/VB/NonPersistentObjectsDemo.Web/Login.aspx.vb @@ -1,14 +1,12 @@ -Imports System - -Imports DevExpress.ExpressApp.Web +Imports System Imports DevExpress.ExpressApp.Web.Templates -Partial Public Class LoginPage - Inherits BaseXafPage +Public Partial Class LoginPage + Inherits BaseXafPage - Public Overrides ReadOnly Property InnerContentPlaceHolder() As System.Web.UI.Control - Get - Return Content - End Get - End Property + Public Overrides ReadOnly Property InnerContentPlaceHolder As Web.UI.Control + Get + Return Content + End Get + End Property End Class diff --git a/VB/NonPersistentObjectsDemo.Web/NonPersistentObjectsDemo.Web.vbproj b/VB/NonPersistentObjectsDemo.Web/NonPersistentObjectsDemo.Web.vbproj index 23f8676..9c0857b 100644 --- a/VB/NonPersistentObjectsDemo.Web/NonPersistentObjectsDemo.Web.vbproj +++ b/VB/NonPersistentObjectsDemo.Web/NonPersistentObjectsDemo.Web.vbproj @@ -1,13 +1,16 @@ - + + On Debug AnyCPU {8C3026D1-113C-4B88-9F91-236753790C60} {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} Library - + Properties + + NonPersistentObjectsDemo.Web v4.5.2 512 @@ -18,213 +21,152 @@ false - On - Binary - Off - On true full false bin\ - true - true + DEBUG,TRACE prompt - true + 4 pdbonly true bin\ - false - true + TRACE prompt - true + 4 true bin\ - true - true - EASYTEST=True + TRACE,DEBUG,EASYTEST full AnyCPU prompt - true - - - - - - - - - - - - False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False - True False @@ -335,7 +277,7 @@ Login.aspx ASPXCodeBehind - + @@ -367,7 +309,7 @@ - - + \ No newline at end of file diff --git a/VB/NonPersistentObjectsDemo.Win/Program.vb b/VB/NonPersistentObjectsDemo.Win/Program.vb index 220c1e2..778f3d3 100644 --- a/VB/NonPersistentObjectsDemo.Win/Program.vb +++ b/VB/NonPersistentObjectsDemo.Win/Program.vb @@ -1,58 +1,60 @@ -Imports System +Imports System Imports System.Configuration Imports System.Windows.Forms - Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Security -Imports DevExpress.ExpressApp.Win Imports DevExpress.Persistent.Base -Imports DevExpress.Persistent.BaseImpl Imports DevExpress.XtraEditors Namespace NonPersistentObjectsDemo.Win - Friend Module Program - ''' - ''' The main entry point for the application. - ''' - - Sub Main() -#If EASYTEST Then - DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register() + + Friend Module Program + + ''' + ''' The main entry point for the application. + ''' + + Sub Main() +#If EASYTEST + DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register(); #End If - WindowsFormsSettings.LoadApplicationSettings() - Application.EnableVisualStyles() - Application.SetCompatibleTextRenderingDefault(False) - DevExpress.Utils.ToolTipController.DefaultController.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip - DevExpress.ExpressApp.BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = True - EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached - If Tracing.GetFileLocationFromSettings() = DevExpress.Persistent.Base.FileLocation.CurrentUserApplicationDataFolder Then - Tracing.LocalUserAppDataPath = Application.LocalUserAppDataPath - End If - Tracing.Initialize() - Dim winApplication As New NonPersistentObjectsDemoWindowsFormsApplication() - 'SecurityStrategy security = (SecurityStrategy)winApplication.Security; - 'security.RegisterXPOAdapterProviders(); - If ConfigurationManager.ConnectionStrings("ConnectionString") IsNot Nothing Then - winApplication.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString - End If -#If EASYTEST Then - If ConfigurationManager.ConnectionStrings("EasyTestConnectionString") IsNot Nothing Then - winApplication.ConnectionString = ConfigurationManager.ConnectionStrings("EasyTestConnectionString").ConnectionString - End If + Call WindowsFormsSettings.LoadApplicationSettings() + Call Application.EnableVisualStyles() + Application.SetCompatibleTextRenderingDefault(False) + DevExpress.Utils.ToolTipController.DefaultController.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip + BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = True + EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached + If Tracing.GetFileLocationFromSettings() = DevExpress.Persistent.Base.FileLocation.CurrentUserApplicationDataFolder Then + Tracing.LocalUserAppDataPath = Application.LocalUserAppDataPath + End If + + Call Tracing.Initialize() + Dim winApplication As NonPersistentObjectsDemoWindowsFormsApplication = New NonPersistentObjectsDemoWindowsFormsApplication() + 'SecurityStrategy security = (SecurityStrategy)winApplication.Security; + 'security.RegisterXPOAdapterProviders(); + If ConfigurationManager.ConnectionStrings("ConnectionString") IsNot Nothing Then + winApplication.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString + End If + +#If EASYTEST + if(ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) { + winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString; + } #End If - winApplication.ConnectionString = DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.ConnectionString -#If DEBUG Then - If System.Diagnostics.Debugger.IsAttached AndAlso winApplication.CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema Then - winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways - End If + winApplication.ConnectionString = Xpo.InMemoryDataStoreProvider.ConnectionString +#If DEBUG + If System.Diagnostics.Debugger.IsAttached AndAlso winApplication.CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema Then + winApplication.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways + End If + #End If - Try - winApplication.Setup() - winApplication.Start() - Catch e As Exception - winApplication.StopSplash() - winApplication.HandleException(e) - End Try - End Sub - End Module + Try + winApplication.Setup() + winApplication.Start() + Catch e As Exception + winApplication.StopSplash() + winApplication.HandleException(e) + End Try + End Sub + End Module End Namespace diff --git a/VB/NonPersistentObjectsDemo.Win/Properties/AssemblyInfo.vb b/VB/NonPersistentObjectsDemo.Win/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..2d5cd78 --- /dev/null +++ b/VB/NonPersistentObjectsDemo.Win/Properties/AssemblyInfo.vb @@ -0,0 +1,29 @@ +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + +' The following GUID is for the ID of the typelib if this project is exposed to COM + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' + + diff --git a/VB/NonPersistentObjectsDemo.Win/WinApplication.Designer.vb b/VB/NonPersistentObjectsDemo.Win/WinApplication.Designer.vb index 804fae0..d63c258 100644 --- a/VB/NonPersistentObjectsDemo.Win/WinApplication.Designer.vb +++ b/VB/NonPersistentObjectsDemo.Win/WinApplication.Designer.vb @@ -1,129 +1,146 @@ -Namespace NonPersistentObjectsDemo.Win - Partial Public Class NonPersistentObjectsDemoWindowsFormsApplication - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing - - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub - - #Region "Component Designer generated code" - - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule() - Me.module2 = New DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule() - Me.module3 = New NonPersistentObjectsDemo.Module.NonPersistentObjectsDemoModule() - Me.module4 = New NonPersistentObjectsDemo.Module.Win.NonPersistentObjectsDemoWindowsFormsModule() - Me.securityModule1 = New DevExpress.ExpressApp.Security.SecurityModule() - Me.securityStrategyComplex1 = New DevExpress.ExpressApp.Security.SecurityStrategyComplex() - Me.securityStrategyComplex1.SupportNavigationPermissionsForTypes = False - Me.objectsModule = New DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule() - Me.cloneObjectModule = New DevExpress.ExpressApp.CloneObject.CloneObjectModule() - Me.conditionalAppearanceModule = New DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule() - Me.fileAttachmentsWindowsFormsModule = New DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule() - Me.reportsModuleV2 = New DevExpress.ExpressApp.ReportsV2.ReportsModuleV2() - Me.reportsWindowsFormsModuleV2 = New DevExpress.ExpressApp.ReportsV2.Win.ReportsWindowsFormsModuleV2() - Me.schedulerModuleBase = New DevExpress.ExpressApp.Scheduler.SchedulerModuleBase() - Me.schedulerWindowsFormsModule = New DevExpress.ExpressApp.Scheduler.Win.SchedulerWindowsFormsModule() - Me.scriptRecorderModuleBase = New DevExpress.ExpressApp.ScriptRecorder.ScriptRecorderModuleBase() - Me.scriptRecorderWindowsFormsModule = New DevExpress.ExpressApp.ScriptRecorder.Win.ScriptRecorderWindowsFormsModule() - Me.treeListEditorsModuleBase = New DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase() - Me.treeListEditorsWindowsFormsModule = New DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditorsWindowsFormsModule() - Me.validationModule = New DevExpress.ExpressApp.Validation.ValidationModule() - Me.validationWindowsFormsModule = New DevExpress.ExpressApp.Validation.Win.ValidationWindowsFormsModule() - Me.authenticationStandard1 = New DevExpress.ExpressApp.Security.AuthenticationStandard() - DirectCast(Me, System.ComponentModel.ISupportInitialize).BeginInit() - ' - ' securityStrategyComplex1 - ' - Me.securityStrategyComplex1.Authentication = Me.authenticationStandard1 - Me.securityStrategyComplex1.RoleType = GetType(DevExpress.Persistent.BaseImpl.PermissionPolicy.PermissionPolicyRole) - Me.securityStrategyComplex1.UserType = GetType(DevExpress.Persistent.BaseImpl.PermissionPolicy.PermissionPolicyUser) - ' - ' securityModule1 - ' - Me.securityModule1.UserType = GetType(DevExpress.Persistent.BaseImpl.PermissionPolicy.PermissionPolicyUser) - ' - ' authenticationStandard1 - ' - Me.authenticationStandard1.LogonParametersType = GetType(DevExpress.ExpressApp.Security.AuthenticationStandardLogonParameters) - ' - ' reportsModuleV2 - ' - Me.reportsModuleV2.EnableInplaceReports = True - Me.reportsModuleV2.ReportDataType = GetType(DevExpress.Persistent.BaseImpl.ReportDataV2) - Me.reportsModuleV2.ShowAdditionalNavigation = False - Me.reportsModuleV2.ReportStoreMode = DevExpress.ExpressApp.ReportsV2.ReportStoreModes.XML - ' - ' NonPersistentObjectsDemoWindowsFormsApplication - ' - Me.ApplicationName = "NonPersistentObjectsDemo" - Me.CheckCompatibilityType = DevExpress.ExpressApp.CheckCompatibilityType.DatabaseSchema - Me.Modules.Add(Me.module1) - Me.Modules.Add(Me.module2) - Me.Modules.Add(Me.module3) - Me.Modules.Add(Me.module4) - Me.Modules.Add(Me.securityModule1) - 'this.Security = this.securityStrategyComplex1; - Me.Modules.Add(Me.objectsModule) - Me.Modules.Add(Me.cloneObjectModule) - Me.Modules.Add(Me.conditionalAppearanceModule) - Me.Modules.Add(Me.fileAttachmentsWindowsFormsModule) - 'this.Modules.Add(this.reportsModuleV2); - 'this.Modules.Add(this.reportsWindowsFormsModuleV2); - Me.Modules.Add(Me.schedulerModuleBase) - Me.Modules.Add(Me.schedulerWindowsFormsModule) - Me.Modules.Add(Me.scriptRecorderModuleBase) - Me.Modules.Add(Me.scriptRecorderWindowsFormsModule) - Me.Modules.Add(Me.treeListEditorsModuleBase) - Me.Modules.Add(Me.treeListEditorsWindowsFormsModule) - Me.Modules.Add(Me.validationModule) - Me.Modules.Add(Me.validationWindowsFormsModule) - Me.UseOldTemplates = False -'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: -'ORIGINAL LINE: this.DatabaseVersionMismatch += new System.EventHandler(this.NonPersistentObjectsDemoWindowsFormsApplication_DatabaseVersionMismatch); -'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause: -'ORIGINAL LINE: this.CustomizeLanguagesList += new System.EventHandler(this.NonPersistentObjectsDemoWindowsFormsApplication_CustomizeLanguagesList); - - DirectCast(Me, System.ComponentModel.ISupportInitialize).EndInit() - - End Sub - - #End Region - - Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule - Private module2 As DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule - Private module3 As NonPersistentObjectsDemo.Module.NonPersistentObjectsDemoModule - Private module4 As NonPersistentObjectsDemo.Module.Win.NonPersistentObjectsDemoWindowsFormsModule - Private securityModule1 As DevExpress.ExpressApp.Security.SecurityModule - Private securityStrategyComplex1 As DevExpress.ExpressApp.Security.SecurityStrategyComplex - Private authenticationStandard1 As DevExpress.ExpressApp.Security.AuthenticationStandard - Private objectsModule As DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule - Private cloneObjectModule As DevExpress.ExpressApp.CloneObject.CloneObjectModule - Private conditionalAppearanceModule As DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule - Private fileAttachmentsWindowsFormsModule As DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule - Private reportsModuleV2 As DevExpress.ExpressApp.ReportsV2.ReportsModuleV2 - Private reportsWindowsFormsModuleV2 As DevExpress.ExpressApp.ReportsV2.Win.ReportsWindowsFormsModuleV2 - Private schedulerModuleBase As DevExpress.ExpressApp.Scheduler.SchedulerModuleBase - Private schedulerWindowsFormsModule As DevExpress.ExpressApp.Scheduler.Win.SchedulerWindowsFormsModule - Private scriptRecorderModuleBase As DevExpress.ExpressApp.ScriptRecorder.ScriptRecorderModuleBase - Private scriptRecorderWindowsFormsModule As DevExpress.ExpressApp.ScriptRecorder.Win.ScriptRecorderWindowsFormsModule - Private treeListEditorsModuleBase As DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase - Private treeListEditorsWindowsFormsModule As DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditorsWindowsFormsModule - Private validationModule As DevExpress.ExpressApp.Validation.ValidationModule - Private validationWindowsFormsModule As DevExpress.ExpressApp.Validation.Win.ValidationWindowsFormsModule - End Class +Namespace NonPersistentObjectsDemo.Win + + Partial Class NonPersistentObjectsDemoWindowsFormsApplication + + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing + + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() + End If + + MyBase.Dispose(disposing) + End Sub + +#Region "Component Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule() + Me.module2 = New DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule() + Me.module3 = New NonPersistentObjectsDemo.[Module].NonPersistentObjectsDemoModule() + Me.module4 = New NonPersistentObjectsDemo.[Module].Win.NonPersistentObjectsDemoWindowsFormsModule() + Me.securityModule1 = New DevExpress.ExpressApp.Security.SecurityModule() + Me.securityStrategyComplex1 = New DevExpress.ExpressApp.Security.SecurityStrategyComplex() + Me.securityStrategyComplex1.SupportNavigationPermissionsForTypes = False + Me.objectsModule = New DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule() + Me.cloneObjectModule = New DevExpress.ExpressApp.CloneObject.CloneObjectModule() + Me.conditionalAppearanceModule = New DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule() + Me.fileAttachmentsWindowsFormsModule = New DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule() + Me.reportsModuleV2 = New DevExpress.ExpressApp.ReportsV2.ReportsModuleV2() + Me.reportsWindowsFormsModuleV2 = New DevExpress.ExpressApp.ReportsV2.Win.ReportsWindowsFormsModuleV2() + Me.schedulerModuleBase = New DevExpress.ExpressApp.Scheduler.SchedulerModuleBase() + Me.schedulerWindowsFormsModule = New DevExpress.ExpressApp.Scheduler.Win.SchedulerWindowsFormsModule() + Me.scriptRecorderModuleBase = New DevExpress.ExpressApp.ScriptRecorder.ScriptRecorderModuleBase() + Me.scriptRecorderWindowsFormsModule = New DevExpress.ExpressApp.ScriptRecorder.Win.ScriptRecorderWindowsFormsModule() + Me.treeListEditorsModuleBase = New DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase() + Me.treeListEditorsWindowsFormsModule = New DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditorsWindowsFormsModule() + Me.validationModule = New DevExpress.ExpressApp.Validation.ValidationModule() + Me.validationWindowsFormsModule = New DevExpress.ExpressApp.Validation.Win.ValidationWindowsFormsModule() + Me.authenticationStandard1 = New DevExpress.ExpressApp.Security.AuthenticationStandard() + CType((Me), System.ComponentModel.ISupportInitialize).BeginInit() + ' + ' securityStrategyComplex1 + ' + Me.securityStrategyComplex1.Authentication = Me.authenticationStandard1 + Me.securityStrategyComplex1.RoleType = GetType(DevExpress.Persistent.BaseImpl.PermissionPolicy.PermissionPolicyRole) + Me.securityStrategyComplex1.UserType = GetType(DevExpress.Persistent.BaseImpl.PermissionPolicy.PermissionPolicyUser) + ' + ' securityModule1 + ' + Me.securityModule1.UserType = GetType(DevExpress.Persistent.BaseImpl.PermissionPolicy.PermissionPolicyUser) + ' + ' authenticationStandard1 + ' + Me.authenticationStandard1.LogonParametersType = GetType(DevExpress.ExpressApp.Security.AuthenticationStandardLogonParameters) + ' + ' reportsModuleV2 + ' + Me.reportsModuleV2.EnableInplaceReports = True + Me.reportsModuleV2.ReportDataType = GetType(DevExpress.Persistent.BaseImpl.ReportDataV2) + Me.reportsModuleV2.ShowAdditionalNavigation = False + Me.reportsModuleV2.ReportStoreMode = DevExpress.ExpressApp.ReportsV2.ReportStoreModes.XML + ' + ' NonPersistentObjectsDemoWindowsFormsApplication + ' + Me.ApplicationName = "NonPersistentObjectsDemo" + Me.CheckCompatibilityType = DevExpress.ExpressApp.CheckCompatibilityType.DatabaseSchema + Me.Modules.Add(Me.module1) + Me.Modules.Add(Me.module2) + Me.Modules.Add(Me.module3) + Me.Modules.Add(Me.module4) + Me.Modules.Add(Me.securityModule1) + 'this.Security = this.securityStrategyComplex1; + Me.Modules.Add(Me.objectsModule) + Me.Modules.Add(Me.cloneObjectModule) + Me.Modules.Add(Me.conditionalAppearanceModule) + Me.Modules.Add(Me.fileAttachmentsWindowsFormsModule) + 'this.Modules.Add(this.reportsModuleV2); + 'this.Modules.Add(this.reportsWindowsFormsModuleV2); + Me.Modules.Add(Me.schedulerModuleBase) + Me.Modules.Add(Me.schedulerWindowsFormsModule) + Me.Modules.Add(Me.scriptRecorderModuleBase) + Me.Modules.Add(Me.scriptRecorderWindowsFormsModule) + Me.Modules.Add(Me.treeListEditorsModuleBase) + Me.Modules.Add(Me.treeListEditorsWindowsFormsModule) + Me.Modules.Add(Me.validationModule) + Me.Modules.Add(Me.validationWindowsFormsModule) + Me.UseOldTemplates = False + AddHandler Me.DatabaseVersionMismatch, New System.EventHandler(Of DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs)(AddressOf Me.NonPersistentObjectsDemoWindowsFormsApplication_DatabaseVersionMismatch) + AddHandler Me.CustomizeLanguagesList, New System.EventHandler(Of DevExpress.ExpressApp.CustomizeLanguagesListEventArgs)(AddressOf Me.NonPersistentObjectsDemoWindowsFormsApplication_CustomizeLanguagesList) + CType((Me), System.ComponentModel.ISupportInitialize).EndInit() + End Sub + +#End Region + Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule + + Private module2 As DevExpress.ExpressApp.Win.SystemModule.SystemWindowsFormsModule + + Private module3 As NonPersistentObjectsDemo.[Module].NonPersistentObjectsDemoModule + + Private module4 As NonPersistentObjectsDemo.[Module].Win.NonPersistentObjectsDemoWindowsFormsModule + + Private securityModule1 As DevExpress.ExpressApp.Security.SecurityModule + + Private securityStrategyComplex1 As DevExpress.ExpressApp.Security.SecurityStrategyComplex + + Private authenticationStandard1 As DevExpress.ExpressApp.Security.AuthenticationStandard + + Private objectsModule As DevExpress.ExpressApp.Objects.BusinessClassLibraryCustomizationModule + + Private cloneObjectModule As DevExpress.ExpressApp.CloneObject.CloneObjectModule + + Private conditionalAppearanceModule As DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule + + Private fileAttachmentsWindowsFormsModule As DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule + + Private reportsModuleV2 As DevExpress.ExpressApp.ReportsV2.ReportsModuleV2 + + Private reportsWindowsFormsModuleV2 As DevExpress.ExpressApp.ReportsV2.Win.ReportsWindowsFormsModuleV2 + + Private schedulerModuleBase As DevExpress.ExpressApp.Scheduler.SchedulerModuleBase + + Private schedulerWindowsFormsModule As DevExpress.ExpressApp.Scheduler.Win.SchedulerWindowsFormsModule + + Private scriptRecorderModuleBase As DevExpress.ExpressApp.ScriptRecorder.ScriptRecorderModuleBase + + Private scriptRecorderWindowsFormsModule As DevExpress.ExpressApp.ScriptRecorder.Win.ScriptRecorderWindowsFormsModule + + Private treeListEditorsModuleBase As DevExpress.ExpressApp.TreeListEditors.TreeListEditorsModuleBase + + Private treeListEditorsWindowsFormsModule As DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditorsWindowsFormsModule + + Private validationModule As DevExpress.ExpressApp.Validation.ValidationModule + + Private validationWindowsFormsModule As DevExpress.ExpressApp.Validation.Win.ValidationWindowsFormsModule + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Win/WinApplication.vb b/VB/NonPersistentObjectsDemo.Win/WinApplication.vb index 5e54d22..592080d 100644 --- a/VB/NonPersistentObjectsDemo.Win/WinApplication.vb +++ b/VB/NonPersistentObjectsDemo.Win/WinApplication.vb @@ -1,65 +1,68 @@ -Imports System +Imports System Imports System.ComponentModel Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Win -Imports System.Collections.Generic -Imports DevExpress.ExpressApp.Updating Imports DevExpress.ExpressApp.Win.Utils Imports DevExpress.ExpressApp.Xpo Imports DevExpress.ExpressApp.Security -Imports DevExpress.ExpressApp.Security.ClientServer Namespace NonPersistentObjectsDemo.Win - ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Win.WinApplication._members - Partial Public Class NonPersistentObjectsDemoWindowsFormsApplication - Inherits WinApplication - #Region "Default XAF configuration options (https:" 'www.devexpress.com/kb=T501418) - Shared Sub New() - DevExpress.Persistent.Base.PasswordCryptographer.EnableRfc2898 = True - DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = False - DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True - End Sub - Private Sub InitializeDefaults() - LinkNewObjectToParentImmediately = False - OptimizedControllersCreation = True - UseLightStyle = True - SplashScreen = New DXSplashScreen(GetType(XafSplashScreen), New DefaultOverlayFormOptions()) - ExecuteStartupLogicBeforeClosingLogonWindow = True - End Sub - #End Region - Public Sub New() - InitializeComponent() - InitializeDefaults() - End Sub - Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs) - 'args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); - args.ObjectSpaceProviders.Add(New XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False)) - args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing)) - End Sub - Private Sub NonPersistentObjectsDemoWindowsFormsApplication_CustomizeLanguagesList(ByVal sender As Object, ByVal e As CustomizeLanguagesListEventArgs) Handles Me.CustomizeLanguagesList - Dim userLanguageName As String = System.Threading.Thread.CurrentThread.CurrentUICulture.Name - If userLanguageName <> "en-US" AndAlso e.Languages.IndexOf(userLanguageName) = -1 Then - e.Languages.Add(userLanguageName) - End If - End Sub - Private Sub NonPersistentObjectsDemoWindowsFormsApplication_DatabaseVersionMismatch(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs) Handles Me.DatabaseVersionMismatch -#If EASYTEST Then - e.Updater.Update() - e.Handled = True + ' For more typical usage scenarios, be sure to check out https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Win.WinApplication._members + Public Partial Class NonPersistentObjectsDemoWindowsFormsApplication + Inherits WinApplication + +#Region "Default XAF configuration options (https://www.devexpress.com/kb=T501418)" + Shared Sub New() + DevExpress.Persistent.Base.PasswordCryptographer.EnableRfc2898 = True + DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = False + Utils.ImageLoader.Instance.UseSvgImages = True + End Sub + + Private Sub InitializeDefaults() + LinkNewObjectToParentImmediately = False + OptimizedControllersCreation = True + UseLightStyle = True + SplashScreen = New DXSplashScreen(GetType(XafSplashScreen), New DefaultOverlayFormOptions()) + ExecuteStartupLogicBeforeClosingLogonWindow = True + End Sub + +#End Region + Public Sub New() + InitializeComponent() + InitializeDefaults() + End Sub + + Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs) + 'args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); + args.ObjectSpaceProviders.Add(New XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False)) + args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing)) + End Sub + + Private Sub NonPersistentObjectsDemoWindowsFormsApplication_CustomizeLanguagesList(ByVal sender As Object, ByVal e As CustomizeLanguagesListEventArgs) + Dim userLanguageName As String = Threading.Thread.CurrentThread.CurrentUICulture.Name + If Not Equals(userLanguageName, "en-US") AndAlso e.Languages.IndexOf(userLanguageName) = -1 Then + e.Languages.Add(userLanguageName) + End If + End Sub + + Private Sub NonPersistentObjectsDemoWindowsFormsApplication_DatabaseVersionMismatch(ByVal sender As Object, ByVal e As DatabaseVersionMismatchEventArgs) +#If EASYTEST + e.Updater.Update(); + e.Handled = true; #Else - If System.Diagnostics.Debugger.IsAttached Then - e.Updater.Update() - e.Handled = True - Else - Dim message As String = "The application cannot connect to the specified database, " & "because the database doesn't exist, its version is older " & "than that of the application or its schema does not match " & "the ORM data model structure. To avoid this error, use one " & "of the solutions from the https://www.devexpress.com/kb=T367835 KB Article." + If System.Diagnostics.Debugger.IsAttached Then + e.Updater.Update() + e.Handled = True + Else + Dim message As String = "The application cannot connect to the specified database, " & "because the database doesn't exist, its version is older " & "than that of the application or its schema does not match " & "the ORM data model structure. To avoid this error, use one " & "of the solutions from the https://www.devexpress.com/kb=T367835 KB Article." + If e.CompatibilityError IsNot Nothing AndAlso e.CompatibilityError.Exception IsNot Nothing Then + message += Microsoft.VisualBasic.Constants.vbCrLf & Microsoft.VisualBasic.Constants.vbCrLf & "Inner exception: " & e.CompatibilityError.Exception.Message + End If - If e.CompatibilityError IsNot Nothing AndAlso e.CompatibilityError.Exception IsNot Nothing Then - message &= vbCrLf & vbCrLf & "Inner exception: " & e.CompatibilityError.Exception.Message - End If - Throw New InvalidOperationException(message) - End If + Throw New InvalidOperationException(message) + End If #End If - End Sub - End Class + End Sub + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.Designer.vb b/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.Designer.vb index a1ded36..32308e4 100644 --- a/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.Designer.vb +++ b/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.Designer.vb @@ -1,177 +1,184 @@ -Namespace NonPersistentObjectsDemo.Win - Partial Public Class XafSplashScreen - ''' - ''' Required designer variable. - ''' - Private components As System.ComponentModel.IContainer = Nothing +Namespace NonPersistentObjectsDemo.Win - ''' - ''' Clean up any resources being used. - ''' - ''' true if managed resources should be disposed; otherwise, false. - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso (components IsNot Nothing) Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + Partial Class XafSplashScreen - #Region "Windows Form Designer generated code" + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing - ''' - ''' Required method for Designer support - do not modify - ''' the contents of this method with the code editor. - ''' - Private Sub InitializeComponent() - Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(XafSplashScreen)) - Me.progressBarControl = New DevExpress.XtraEditors.MarqueeProgressBarControl() - Me.labelCopyright = New DevExpress.XtraEditors.LabelControl() - Me.labelStatus = New DevExpress.XtraEditors.LabelControl() - Me.peImage = New DevExpress.XtraEditors.PictureEdit() - Me.peLogo = New DevExpress.XtraEditors.PictureEdit() - Me.pcApplicationName = New DevExpress.XtraEditors.PanelControl() - Me.labelSubtitle = New DevExpress.XtraEditors.LabelControl() - Me.labelApplicationName = New DevExpress.XtraEditors.LabelControl() - CType(Me.progressBarControl.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.peImage.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.peLogo.Properties, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.pcApplicationName, System.ComponentModel.ISupportInitialize).BeginInit() - Me.pcApplicationName.SuspendLayout() - Me.SuspendLayout() - ' - ' progressBarControl - ' - Me.progressBarControl.EditValue = 0 - Me.progressBarControl.Location = New System.Drawing.Point(74, 271) - Me.progressBarControl.Name = "progressBarControl" - Me.progressBarControl.Properties.Appearance.BorderColor = System.Drawing.Color.FromArgb((CInt((CByte(195)))), (CInt((CByte(194)))), (CInt((CByte(194))))) - Me.progressBarControl.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple - Me.progressBarControl.Properties.EndColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(114)))), (CInt((CByte(0))))) - Me.progressBarControl.Properties.LookAndFeel.SkinName = "Visual Studio 2013 Blue" - Me.progressBarControl.Properties.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.UltraFlat - Me.progressBarControl.Properties.LookAndFeel.UseDefaultLookAndFeel = False - Me.progressBarControl.Properties.ProgressViewStyle = DevExpress.XtraEditors.Controls.ProgressViewStyle.Solid - Me.progressBarControl.Properties.StartColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(144)))), (CInt((CByte(0))))) - Me.progressBarControl.Size = New System.Drawing.Size(350, 16) - Me.progressBarControl.TabIndex = 5 - ' - ' labelCopyright - ' - Me.labelCopyright.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder - Me.labelCopyright.Location = New System.Drawing.Point(24, 324) - Me.labelCopyright.Name = "labelCopyright" - Me.labelCopyright.Size = New System.Drawing.Size(47, 13) - Me.labelCopyright.TabIndex = 6 - Me.labelCopyright.Text = "Copyright" - ' - ' labelStatus - ' - Me.labelStatus.Location = New System.Drawing.Point(75, 253) - Me.labelStatus.Name = "labelStatus" - Me.labelStatus.Size = New System.Drawing.Size(50, 13) - Me.labelStatus.TabIndex = 7 - Me.labelStatus.Text = "Starting..." - ' - ' peImage - ' - Me.peImage.EditValue = (CObj(resources.GetObject("peImage.EditValue"))) - Me.peImage.Location = New System.Drawing.Point(12, 12) - Me.peImage.Name = "peImage" - Me.peImage.Properties.AllowFocused = False - Me.peImage.Properties.Appearance.BackColor = System.Drawing.Color.Transparent - Me.peImage.Properties.Appearance.Options.UseBackColor = True - Me.peImage.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder - Me.peImage.Properties.ShowMenu = False - Me.peImage.Size = New System.Drawing.Size(426, 180) - Me.peImage.TabIndex = 9 - Me.peImage.Visible = False - ' - ' peLogo - ' - Me.peLogo.EditValue = (CObj(resources.GetObject("peLogo.EditValue"))) - Me.peLogo.Location = New System.Drawing.Point(400, 328) - Me.peLogo.Name = "peLogo" - Me.peLogo.Properties.AllowFocused = False - Me.peLogo.Properties.Appearance.BackColor = System.Drawing.Color.Transparent - Me.peLogo.Properties.Appearance.Options.UseBackColor = True - Me.peLogo.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder - Me.peLogo.Properties.ShowMenu = False - Me.peLogo.Size = New System.Drawing.Size(70, 20) - Me.peLogo.TabIndex = 8 - ' - ' pcApplicationName - ' - Me.pcApplicationName.Appearance.BackColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(114)))), (CInt((CByte(0))))) - Me.pcApplicationName.Appearance.Options.UseBackColor = True - Me.pcApplicationName.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder - Me.pcApplicationName.Controls.Add(Me.labelSubtitle) - Me.pcApplicationName.Controls.Add(Me.labelApplicationName) - Me.pcApplicationName.Dock = System.Windows.Forms.DockStyle.Top - Me.pcApplicationName.Location = New System.Drawing.Point(1, 1) - Me.pcApplicationName.LookAndFeel.UseDefaultLookAndFeel = False - Me.pcApplicationName.Name = "pcApplicationName" - Me.pcApplicationName.Size = New System.Drawing.Size(494, 220) - Me.pcApplicationName.TabIndex = 10 - ' - ' labelSubtitle - ' - Me.labelSubtitle.Appearance.Font = New System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte(0))) - Me.labelSubtitle.Appearance.ForeColor = System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(216)))), (CInt((CByte(188))))) - Me.labelSubtitle.Appearance.Options.UseFont = True - Me.labelSubtitle.Appearance.Options.UseForeColor = True - Me.labelSubtitle.Location = New System.Drawing.Point(222, 131) - Me.labelSubtitle.Name = "labelSubtitle" - Me.labelSubtitle.Size = New System.Drawing.Size(64, 25) - Me.labelSubtitle.TabIndex = 1 - Me.labelSubtitle.Text = "Subtitle" - ' - ' labelApplicationName - ' - Me.labelApplicationName.Appearance.Font = New System.Drawing.Font("Segoe UI", 26.25F) - Me.labelApplicationName.Appearance.ForeColor = System.Drawing.SystemColors.Window - Me.labelApplicationName.Appearance.Options.UseFont = True - Me.labelApplicationName.Appearance.Options.UseForeColor = True - Me.labelApplicationName.Location = New System.Drawing.Point(123, 84) - Me.labelApplicationName.Name = "labelApplicationName" - Me.labelApplicationName.Size = New System.Drawing.Size(278, 47) - Me.labelApplicationName.TabIndex = 0 - Me.labelApplicationName.Text = "Application Name" - ' - ' XafSplashScreen - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.BackColor = System.Drawing.Color.White - Me.ClientSize = New System.Drawing.Size(496, 370) - Me.Controls.Add(Me.pcApplicationName) - Me.Controls.Add(Me.peImage) - Me.Controls.Add(Me.peLogo) - Me.Controls.Add(Me.labelStatus) - Me.Controls.Add(Me.labelCopyright) - Me.Controls.Add(Me.progressBarControl) - Me.Name = "XafSplashScreen" - Me.Padding = New System.Windows.Forms.Padding(1) - Me.Text = "Form1" - CType(Me.progressBarControl.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.peImage.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.peLogo.Properties, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.pcApplicationName, System.ComponentModel.ISupportInitialize).EndInit() - Me.pcApplicationName.ResumeLayout(False) - Me.pcApplicationName.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() + End If - End Sub + MyBase.Dispose(disposing) + End Sub - #End Region +#Region "Windows Form Designer generated code" + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(NonPersistentObjectsDemo.Win.XafSplashScreen)) + Me.progressBarControl = New DevExpress.XtraEditors.MarqueeProgressBarControl() + Me.labelCopyright = New DevExpress.XtraEditors.LabelControl() + Me.labelStatus = New DevExpress.XtraEditors.LabelControl() + Me.peImage = New DevExpress.XtraEditors.PictureEdit() + Me.peLogo = New DevExpress.XtraEditors.PictureEdit() + Me.pcApplicationName = New DevExpress.XtraEditors.PanelControl() + Me.labelSubtitle = New DevExpress.XtraEditors.LabelControl() + Me.labelApplicationName = New DevExpress.XtraEditors.LabelControl() + CType((Me.progressBarControl.Properties), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.peImage.Properties), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.peLogo.Properties), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.pcApplicationName), System.ComponentModel.ISupportInitialize).BeginInit() + Me.pcApplicationName.SuspendLayout() + Me.SuspendLayout() + ' + ' progressBarControl + ' + Me.progressBarControl.EditValue = 0 + Me.progressBarControl.Location = New System.Drawing.Point(74, 271) + Me.progressBarControl.Name = "progressBarControl" + Me.progressBarControl.Properties.Appearance.BorderColor = System.Drawing.Color.FromArgb((CInt(((CByte((195)))))), (CInt(((CByte((194)))))), (CInt(((CByte((194))))))) + Me.progressBarControl.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple + Me.progressBarControl.Properties.EndColor = System.Drawing.Color.FromArgb((CInt(((CByte((255)))))), (CInt(((CByte((114)))))), (CInt(((CByte((0))))))) + Me.progressBarControl.Properties.LookAndFeel.SkinName = "Visual Studio 2013 Blue" + Me.progressBarControl.Properties.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.UltraFlat + Me.progressBarControl.Properties.LookAndFeel.UseDefaultLookAndFeel = False + Me.progressBarControl.Properties.ProgressViewStyle = DevExpress.XtraEditors.Controls.ProgressViewStyle.Solid + Me.progressBarControl.Properties.StartColor = System.Drawing.Color.FromArgb((CInt(((CByte((255)))))), (CInt(((CByte((144)))))), (CInt(((CByte((0))))))) + Me.progressBarControl.Size = New System.Drawing.Size(350, 16) + Me.progressBarControl.TabIndex = 5 + ' + ' labelCopyright + ' + Me.labelCopyright.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder + Me.labelCopyright.Location = New System.Drawing.Point(24, 324) + Me.labelCopyright.Name = "labelCopyright" + Me.labelCopyright.Size = New System.Drawing.Size(47, 13) + Me.labelCopyright.TabIndex = 6 + Me.labelCopyright.Text = "Copyright" + ' + ' labelStatus + ' + Me.labelStatus.Location = New System.Drawing.Point(75, 253) + Me.labelStatus.Name = "labelStatus" + Me.labelStatus.Size = New System.Drawing.Size(50, 13) + Me.labelStatus.TabIndex = 7 + Me.labelStatus.Text = "Starting..." + ' + ' peImage + ' + Me.peImage.EditValue =(CObj((resources.GetObject("peImage.EditValue")))) + Me.peImage.Location = New System.Drawing.Point(12, 12) + Me.peImage.Name = "peImage" + Me.peImage.Properties.AllowFocused = False + Me.peImage.Properties.Appearance.BackColor = System.Drawing.Color.Transparent + Me.peImage.Properties.Appearance.Options.UseBackColor = True + Me.peImage.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder + Me.peImage.Properties.ShowMenu = False + Me.peImage.Size = New System.Drawing.Size(426, 180) + Me.peImage.TabIndex = 9 + Me.peImage.Visible = False + ' + ' peLogo + ' + Me.peLogo.EditValue =(CObj((resources.GetObject("peLogo.EditValue")))) + Me.peLogo.Location = New System.Drawing.Point(400, 328) + Me.peLogo.Name = "peLogo" + Me.peLogo.Properties.AllowFocused = False + Me.peLogo.Properties.Appearance.BackColor = System.Drawing.Color.Transparent + Me.peLogo.Properties.Appearance.Options.UseBackColor = True + Me.peLogo.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder + Me.peLogo.Properties.ShowMenu = False + Me.peLogo.Size = New System.Drawing.Size(70, 20) + Me.peLogo.TabIndex = 8 + ' + ' pcApplicationName + ' + Me.pcApplicationName.Appearance.BackColor = System.Drawing.Color.FromArgb((CInt(((CByte((255)))))), (CInt(((CByte((114)))))), (CInt(((CByte((0))))))) + Me.pcApplicationName.Appearance.Options.UseBackColor = True + Me.pcApplicationName.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder + Me.pcApplicationName.Controls.Add(Me.labelSubtitle) + Me.pcApplicationName.Controls.Add(Me.labelApplicationName) + Me.pcApplicationName.Dock = System.Windows.Forms.DockStyle.Top + Me.pcApplicationName.Location = New System.Drawing.Point(1, 1) + Me.pcApplicationName.LookAndFeel.UseDefaultLookAndFeel = False + Me.pcApplicationName.Name = "pcApplicationName" + Me.pcApplicationName.Size = New System.Drawing.Size(494, 220) + Me.pcApplicationName.TabIndex = 10 + ' + ' labelSubtitle + ' + Me.labelSubtitle.Appearance.Font = New System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte((0)))) + Me.labelSubtitle.Appearance.ForeColor = System.Drawing.Color.FromArgb((CInt(((CByte((255)))))), (CInt(((CByte((216)))))), (CInt(((CByte((188))))))) + Me.labelSubtitle.Appearance.Options.UseFont = True + Me.labelSubtitle.Appearance.Options.UseForeColor = True + Me.labelSubtitle.Location = New System.Drawing.Point(222, 131) + Me.labelSubtitle.Name = "labelSubtitle" + Me.labelSubtitle.Size = New System.Drawing.Size(64, 25) + Me.labelSubtitle.TabIndex = 1 + Me.labelSubtitle.Text = "Subtitle" + ' + ' labelApplicationName + ' + Me.labelApplicationName.Appearance.Font = New System.Drawing.Font("Segoe UI", 26.25F) + Me.labelApplicationName.Appearance.ForeColor = System.Drawing.SystemColors.Window + Me.labelApplicationName.Appearance.Options.UseFont = True + Me.labelApplicationName.Appearance.Options.UseForeColor = True + Me.labelApplicationName.Location = New System.Drawing.Point(123, 84) + Me.labelApplicationName.Name = "labelApplicationName" + Me.labelApplicationName.Size = New System.Drawing.Size(278, 47) + Me.labelApplicationName.TabIndex = 0 + Me.labelApplicationName.Text = "Application Name" + ' + ' XafSplashScreen + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.White + Me.ClientSize = New System.Drawing.Size(496, 370) + Me.Controls.Add(Me.pcApplicationName) + Me.Controls.Add(Me.peImage) + Me.Controls.Add(Me.peLogo) + Me.Controls.Add(Me.labelStatus) + Me.Controls.Add(Me.labelCopyright) + Me.Controls.Add(Me.progressBarControl) + Me.Name = "XafSplashScreen" + Me.Padding = New System.Windows.Forms.Padding(1) + Me.Text = "Form1" + CType((Me.progressBarControl.Properties), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.peImage.Properties), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.peLogo.Properties), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.pcApplicationName), System.ComponentModel.ISupportInitialize).EndInit() + Me.pcApplicationName.ResumeLayout(False) + Me.pcApplicationName.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + End Sub - Private progressBarControl As DevExpress.XtraEditors.MarqueeProgressBarControl - Private labelCopyright As DevExpress.XtraEditors.LabelControl - Private labelStatus As DevExpress.XtraEditors.LabelControl - Private peLogo As DevExpress.XtraEditors.PictureEdit - Private peImage As DevExpress.XtraEditors.PictureEdit - Private pcApplicationName As DevExpress.XtraEditors.PanelControl - Private labelSubtitle As DevExpress.XtraEditors.LabelControl - Private labelApplicationName As DevExpress.XtraEditors.LabelControl - End Class +#End Region + Private progressBarControl As DevExpress.XtraEditors.MarqueeProgressBarControl + + Private labelCopyright As DevExpress.XtraEditors.LabelControl + + Private labelStatus As DevExpress.XtraEditors.LabelControl + + Private peLogo As DevExpress.XtraEditors.PictureEdit + + Private peImage As DevExpress.XtraEditors.PictureEdit + + Private pcApplicationName As DevExpress.XtraEditors.PanelControl + + Private labelSubtitle As DevExpress.XtraEditors.LabelControl + + Private labelApplicationName As DevExpress.XtraEditors.LabelControl + End Class End Namespace diff --git a/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.vb b/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.vb index 9938ca4..f1704be 100644 --- a/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.vb +++ b/VB/NonPersistentObjectsDemo.Win/XafSplashScreen.vb @@ -1,4 +1,4 @@ -Imports System +Imports System Imports System.Drawing Imports System.IO Imports System.Reflection @@ -9,48 +9,50 @@ Imports DevExpress.Utils.Svg Imports DevExpress.XtraSplashScreen Namespace NonPersistentObjectsDemo.Win - Partial Public Class XafSplashScreen - Inherits SplashScreen - Private Sub LoadBlankLogo() - Dim assembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly() - Dim blankLogoResourceName As String = assembly.GetName().Name & ".Images.Logo.svg" - Dim svgStream As Stream = assembly.GetManifestResourceStream(blankLogoResourceName) - If svgStream IsNot Nothing Then - svgStream.Position = 0 - peLogo.SvgImage = SvgImage.FromStream(svgStream) - End If - End Sub - Protected Overrides Sub DrawContent(ByVal graphicsCache As GraphicsCache, ByVal skin As Skin) - Dim bounds As Rectangle = ClientRectangle - bounds.Width -= 1 - bounds.Height -= 1 - graphicsCache.Graphics.DrawRectangle(graphicsCache.GetPen(Color.FromArgb(255, 87, 87, 87), 1), bounds) - End Sub - Protected Sub UpdateLabelsPosition() - labelApplicationName.CalcBestSize() - Dim newLeft As Integer = (Width - labelApplicationName.Width) \ 2 - labelApplicationName.Location = New Point(newLeft, labelApplicationName.Top) - labelSubtitle.CalcBestSize() - newLeft = (Width - labelSubtitle.Width) \ 2 - labelSubtitle.Location = New Point(newLeft, labelSubtitle.Top) - End Sub - Public Sub New() - InitializeComponent() - LoadBlankLogo() - Me.labelCopyright.Text = "Copyright © " & DateTime.Now.Year.ToString() & " Company Name" & Environment.NewLine & "All rights reserved." - UpdateLabelsPosition() - End Sub + Public Partial Class XafSplashScreen + Inherits SplashScreen - #Region "Overrides" + Private Sub LoadBlankLogo() + Dim assembly As Assembly = Assembly.GetExecutingAssembly() + Dim blankLogoResourceName As String = assembly.GetName().Name & ".Images.Logo.svg" + Dim svgStream As Stream = assembly.GetManifestResourceStream(blankLogoResourceName) + If svgStream IsNot Nothing Then + svgStream.Position = 0 + peLogo.SvgImage = SvgImage.FromStream(svgStream) + End If + End Sub - Public Overrides Sub ProcessCommand(ByVal cmd As System.Enum, ByVal arg As Object) - MyBase.ProcessCommand(cmd, arg) - If CType(cmd, UpdateSplashCommand) = UpdateSplashCommand.Description Then - labelStatus.Text = DirectCast(arg, String) - End If - End Sub + Protected Overrides Sub DrawContent(ByVal graphicsCache As GraphicsCache, ByVal skin As Skin) + Dim bounds As Rectangle = ClientRectangle + bounds.Width -= 1 + bounds.Height -= 1 + graphicsCache.Graphics.DrawRectangle(graphicsCache.GetPen(Color.FromArgb(255, 87, 87, 87), 1), bounds) + End Sub - #End Region - End Class + Protected Sub UpdateLabelsPosition() + labelApplicationName.CalcBestSize() + Dim newLeft As Integer =(Width - labelApplicationName.Width) \ 2 + labelApplicationName.Location = New Point(newLeft, labelApplicationName.Top) + labelSubtitle.CalcBestSize() + newLeft =(Width - labelSubtitle.Width) \ 2 + labelSubtitle.Location = New Point(newLeft, labelSubtitle.Top) + End Sub + + Public Sub New() + InitializeComponent() + LoadBlankLogo() + labelCopyright.Text = "Copyright © " & Date.Now.Year.ToString() & " Company Name" & Environment.NewLine & "All rights reserved." + UpdateLabelsPosition() + End Sub + +#Region "Overrides" + Public Overrides Sub ProcessCommand(ByVal cmd As [Enum], ByVal arg As Object) + MyBase.ProcessCommand(cmd, arg) + If CType(cmd, UpdateSplashCommand) = UpdateSplashCommand.Description Then + labelStatus.Text = CStr(arg) + End If + End Sub +#End Region + End Class End Namespace diff --git a/VB/NonPersistentObjectsEditLinkedPersistentObjectsDemo.sln b/VB/NonPersistentObjectsEditLinkedPersistentObjectsDemo.sln index 6dac80e..bae80b2 100644 --- a/VB/NonPersistentObjectsEditLinkedPersistentObjectsDemo.sln +++ b/VB/NonPersistentObjectsEditLinkedPersistentObjectsDemo.sln @@ -1,4 +1,5 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.28307.1000 MinimumVisualStudioVersion = 10.0.40219.1