diff --git a/Readme.md b/Readme.md index c4081db..a33b521 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,4 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128633613/18.1.3%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E4107) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) diff --git a/VB/XtraSchedulerEFTest.sln b/VB/XtraSchedulerEFTest.sln index 497ad0f..08cc2c8 100644 --- a/VB/XtraSchedulerEFTest.sln +++ b/VB/XtraSchedulerEFTest.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 +Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "XtraSchedulerEFTest", "XtraSchedulerEFTest\XtraSchedulerEFTest.vbproj", "{774DF92E-B1E1-4F83-A55D-61ECC674F2D6}" EndProject diff --git a/VB/XtraSchedulerEFTest/EFAppointment.vb b/VB/XtraSchedulerEFTest/EFAppointment.vb index 85d84d0..199bd46 100644 --- a/VB/XtraSchedulerEFTest/EFAppointment.vb +++ b/VB/XtraSchedulerEFTest/EFAppointment.vb @@ -1,28 +1,40 @@ -Imports System Imports System.ComponentModel.DataAnnotations Imports System.ComponentModel.DataAnnotations.Schema - Namespace XtraSchedulerEFTest - #Region "#efappointment" + +'#Region "#efappointment" Friend Class EFAppointment - _ - Public Property UniqueID() As Integer - _ - Public Property Type() As Integer - _ - Public Property StartDate() As Date - _ - Public Property EndDate() As Date - Public Property AllDay() As Boolean - Public Property Subject() As String - Public Property Location() As String - Public Property Description() As String - Public Property Status() As Integer - Public Property Label() As Integer - Public Property ResourceIDs() As String - Public Property ReminderInfo() As String - Public Property RecurrenceInfo() As String + + + Public Property UniqueID As Integer + + + Public Property Type As Integer + + + Public Property StartDate As Date + + + Public Property EndDate As Date + + Public Property AllDay As Boolean + + Public Property Subject As String + + Public Property Location As String + + Public Property Description As String + + Public Property Status As Integer + + Public Property Label As Integer + + Public Property ResourceIDs As String + + Public Property ReminderInfo As String + + Public Property RecurrenceInfo As String End Class - #End Region ' #efappointment +'#End Region ' #efappointment End Namespace diff --git a/VB/XtraSchedulerEFTest/EFResource.vb b/VB/XtraSchedulerEFTest/EFResource.vb index 85e4265..9951119 100644 --- a/VB/XtraSchedulerEFTest/EFResource.vb +++ b/VB/XtraSchedulerEFTest/EFResource.vb @@ -1,49 +1,63 @@ -Imports System +Imports System Imports System.ComponentModel.DataAnnotations Imports System.Drawing Namespace XtraSchedulerEFTest - #Region "#efresource" + +'#Region "#efresource" Friend Class EFResource - _ - Public Property UniqueID() As Integer - Public Property ResourceID() As Integer - Public Property ResourceName() As String - Public Property Image() As Byte() - Public Property Color() As Integer + + + Public Property UniqueID As Integer + + Public Property ResourceID As Integer + + Public Property ResourceName As String + + Public Property Image As Byte() + + Public Property Color As Integer Get Return ColorEx.ToArgb() End Get + Set(ByVal value As Integer) ColorEx = New MyColor(value) End Set End Property - Public Property ColorEx() As MyColor + Public Property ColorEx As MyColor End Class Friend Class MyColor - Public Property A() As Byte - Public Property R() As Byte - Public Property G() As Byte - Public Property B() As Byte + + Public Property A As Byte + + Public Property R As Byte + + Public Property G As Byte + + Public Property B As Byte Public Sub New() End Sub + Public Sub New(ByVal a As Byte, ByVal r As Byte, ByVal g As Byte, ByVal b As Byte) Me.A = a Me.R = r Me.G = g Me.B = b End Sub + Public Sub New(ByVal color As Color) A = color.A R = color.R G = color.G B = color.B End Sub + Public Sub New(ByVal argb As Integer) - Dim bytes() As Byte = BitConverter.GetBytes(argb) + Dim bytes As Byte() = BitConverter.GetBytes(argb) A = bytes(0) R = bytes(1) G = bytes(2) @@ -53,15 +67,15 @@ Namespace XtraSchedulerEFTest Public Function ToColor() As Color Return Color.FromArgb(A, R, G, B) End Function + Public Shared Function FromColor(ByVal color As Color) As MyColor Return New MyColor(color.A, color.R, color.G, color.B) End Function + Public Function ToArgb() As Integer - Dim bytes() As Byte = { A, R, G, B } + Dim bytes As Byte() = New Byte() {A, R, G, B} Return BitConverter.ToInt32(bytes, 0) End Function - End Class -#End Region ' #efresource - +'#End Region ' #efresource End Namespace diff --git a/VB/XtraSchedulerEFTest/Form1.Designer.vb b/VB/XtraSchedulerEFTest/Form1.Designer.vb index f1ea2b1..77d5aa2 100644 --- a/VB/XtraSchedulerEFTest/Form1.Designer.vb +++ b/VB/XtraSchedulerEFTest/Form1.Designer.vb @@ -1,5 +1,7 @@ -Namespace XtraSchedulerEFTest - Partial Public Class Form1 +Namespace XtraSchedulerEFTest + + Partial Class Form1 + ''' ''' Required designer variable. ''' @@ -10,33 +12,33 @@ ''' ''' 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() + If disposing AndAlso (Me.components IsNot Nothing) Then + Me.components.Dispose() End If + MyBase.Dispose(disposing) End Sub - #Region "Windows Form Designer generated code" - +'#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() Me.components = New System.ComponentModel.Container() - Dim timeRuler1 As New DevExpress.XtraScheduler.TimeRuler() - Dim timeRuler2 As New DevExpress.XtraScheduler.TimeRuler() + Dim timeRuler1 As DevExpress.XtraScheduler.TimeRuler = New DevExpress.XtraScheduler.TimeRuler() + Dim timeRuler2 As DevExpress.XtraScheduler.TimeRuler = New DevExpress.XtraScheduler.TimeRuler() Me.schedulerControl1 = New DevExpress.XtraScheduler.SchedulerControl() Me.schedulerStorage1 = New DevExpress.XtraScheduler.SchedulerDataStorage(Me.components) Me.eFAppointmentBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.eFResourceBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.panelControl1 = New DevExpress.XtraEditors.PanelControl() Me.btnCreateAppointment = New DevExpress.XtraEditors.SimpleButton() - CType(Me.schedulerControl1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.schedulerStorage1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.eFAppointmentBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.eFResourceBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.panelControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.schedulerControl1), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.schedulerStorage1), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.eFAppointmentBindingSource), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.eFResourceBindingSource), System.ComponentModel.ISupportInitialize).BeginInit() + CType((Me.panelControl1), System.ComponentModel.ISupportInitialize).BeginInit() Me.panelControl1.SuspendLayout() Me.SuspendLayout() ' @@ -46,7 +48,7 @@ Me.schedulerControl1.Location = New System.Drawing.Point(0, 44) Me.schedulerControl1.Name = "schedulerControl1" Me.schedulerControl1.Size = New System.Drawing.Size(776, 466) - Me.schedulerControl1.Start = New Date(1753, 1, 1, 0, 0, 0, 0) + Me.schedulerControl1.Start = New System.DateTime(1753, 1, 1, 0, 0, 0, 0) Me.schedulerControl1.DataStorage = Me.schedulerStorage1 Me.schedulerControl1.TabIndex = 0 Me.schedulerControl1.Text = "schedulerControl1" @@ -59,7 +61,7 @@ Me.schedulerStorage1.Appointments.Mappings.AllDay = "AllDay" Me.schedulerStorage1.Appointments.Mappings.AppointmentId = "UniqueID" Me.schedulerStorage1.Appointments.Mappings.Description = "Description" - Me.schedulerStorage1.Appointments.Mappings.End = "EndDate" + Me.schedulerStorage1.Appointments.Mappings.[End] = "EndDate" Me.schedulerStorage1.Appointments.Mappings.Label = "Label" Me.schedulerStorage1.Appointments.Mappings.Location = "Location" Me.schedulerStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo" @@ -100,6 +102,7 @@ Me.btnCreateAppointment.Size = New System.Drawing.Size(116, 23) Me.btnCreateAppointment.TabIndex = 0 Me.btnCreateAppointment.Text = "Create Appointment" + AddHandler Me.btnCreateAppointment.Click, New System.EventHandler(AddressOf Me.btnCreateAppointment_Click) ' ' Form1 ' @@ -110,24 +113,27 @@ Me.Controls.Add(Me.panelControl1) Me.Name = "Form1" Me.Text = "Form1" - CType(Me.schedulerControl1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.schedulerStorage1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.eFAppointmentBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.eFResourceBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.panelControl1, System.ComponentModel.ISupportInitialize).EndInit() + AddHandler Me.Load, New System.EventHandler(AddressOf Me.Form1_Load) + CType((Me.schedulerControl1), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.schedulerStorage1), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.eFAppointmentBindingSource), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.eFResourceBindingSource), System.ComponentModel.ISupportInitialize).EndInit() + CType((Me.panelControl1), System.ComponentModel.ISupportInitialize).EndInit() Me.panelControl1.ResumeLayout(False) Me.ResumeLayout(False) - End Sub - #End Region - +'#End Region Private schedulerControl1 As DevExpress.XtraScheduler.SchedulerControl + Private schedulerStorage1 As DevExpress.XtraScheduler.SchedulerDataStorage + Private panelControl1 As DevExpress.XtraEditors.PanelControl - Private WithEvents btnCreateAppointment As DevExpress.XtraEditors.SimpleButton + + Private btnCreateAppointment As DevExpress.XtraEditors.SimpleButton + Private eFAppointmentBindingSource As System.Windows.Forms.BindingSource + Private eFResourceBindingSource As System.Windows.Forms.BindingSource End Class End Namespace - diff --git a/VB/XtraSchedulerEFTest/Form1.vb b/VB/XtraSchedulerEFTest/Form1.vb index b62a526..d985682 100644 --- a/VB/XtraSchedulerEFTest/Form1.vb +++ b/VB/XtraSchedulerEFTest/Form1.vb @@ -1,69 +1,64 @@ -Imports System +Imports System Imports System.Data.Entity Imports System.Windows.Forms Imports DevExpress.XtraScheduler Namespace XtraSchedulerEFTest - Partial Public Class Form1 + + Public Partial Class Form1 Inherits Form Private context As SchedulerContext + Public Sub New() InitializeComponent() - schedulerStorage1.Appointments.ResourceSharing = True - schedulerControl1.Storage.Resources.ColorSaving = ColorSavingType.ArgbColor - -' #Region "#appmappings" - Me.schedulerStorage1.Appointments.Mappings.AllDay = "AllDay" - Me.schedulerStorage1.Appointments.Mappings.AppointmentId = "UniqueID" - Me.schedulerStorage1.Appointments.Mappings.Description = "Description" - Me.schedulerStorage1.Appointments.Mappings.End = "EndDate" - Me.schedulerStorage1.Appointments.Mappings.Label = "Label" - Me.schedulerStorage1.Appointments.Mappings.Location = "Location" - Me.schedulerStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo" - Me.schedulerStorage1.Appointments.Mappings.ReminderInfo = "ReminderInfo" - Me.schedulerStorage1.Appointments.Mappings.ResourceId = "ResourceIDs" - Me.schedulerStorage1.Appointments.Mappings.Start = "StartDate" - Me.schedulerStorage1.Appointments.Mappings.Status = "Status" - Me.schedulerStorage1.Appointments.Mappings.Subject = "Subject" - Me.schedulerStorage1.Appointments.Mappings.Type = "Type" -' #End Region ' #appmappings -' #Region "#resmappings" - Me.schedulerStorage1.Resources.Mappings.Caption = "ResourceName" - Me.schedulerStorage1.Resources.Mappings.Color = "Color" - Me.schedulerStorage1.Resources.Mappings.Id = "ResourceID" - Me.schedulerStorage1.Resources.Mappings.Image = "Image" -' #End Region ' #resmappings - - AddHandler schedulerControl1.Storage.AppointmentsChanged, AddressOf Storage_AppointmentsModified - AddHandler schedulerControl1.Storage.AppointmentsInserted, AddressOf Storage_AppointmentsModified - AddHandler schedulerControl1.Storage.AppointmentsDeleted, AddressOf Storage_AppointmentsModified - + schedulerControl1.DataStorage.Resources.ColorSaving = ColorSavingType.ArgbColor +'#Region "#appmappings" + schedulerStorage1.Appointments.Mappings.AllDay = "AllDay" + schedulerStorage1.Appointments.Mappings.AppointmentId = "UniqueID" + schedulerStorage1.Appointments.Mappings.Description = "Description" + schedulerStorage1.Appointments.Mappings.End = "EndDate" + schedulerStorage1.Appointments.Mappings.Label = "Label" + schedulerStorage1.Appointments.Mappings.Location = "Location" + schedulerStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo" + schedulerStorage1.Appointments.Mappings.ReminderInfo = "ReminderInfo" + schedulerStorage1.Appointments.Mappings.ResourceId = "ResourceIDs" + schedulerStorage1.Appointments.Mappings.Start = "StartDate" + schedulerStorage1.Appointments.Mappings.Status = "Status" + schedulerStorage1.Appointments.Mappings.Subject = "Subject" + schedulerStorage1.Appointments.Mappings.Type = "Type" +'#End Region ' #appmappings +'#Region "#resmappings" + schedulerStorage1.Resources.Mappings.Caption = "ResourceName" + schedulerStorage1.Resources.Mappings.Color = "Color" + schedulerStorage1.Resources.Mappings.Id = "ResourceID" + schedulerStorage1.Resources.Mappings.Image = "Image" +'#End Region ' #resmappings + AddHandler schedulerControl1.DataStorage.AppointmentsChanged, AddressOf Storage_AppointmentsModified + AddHandler schedulerControl1.DataStorage.AppointmentsInserted, AddressOf Storage_AppointmentsModified + AddHandler schedulerControl1.DataStorage.AppointmentsDeleted, AddressOf Storage_AppointmentsModified schedulerControl1.GroupType = SchedulerGroupType.Resource schedulerControl1.Start = Date.Now.Date End Sub - Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load -' #Region "#datainit" - Database.SetInitializer(New SchedulerContextSeedInilializer()) + Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) +'#Region "#datainit" + Call Database.SetInitializer(New SchedulerContextSeedInilializer()) context = New SchedulerContext() - context.Database.Initialize(False) context.EFAppointments.Load() context.EFResources.Load() - - eFAppointmentBindingSource.DataSource = context.EFAppointments.Local.ToBindingList() - eFResourceBindingSource.DataSource = context.EFResources.Local.ToBindingList() - ' #End Region ' #datainit - + eFAppointmentBindingSource.DataSource = context.EFAppointments.Local.ToBindingList(Of EFAppointment)() + eFResourceBindingSource.DataSource = context.EFResources.Local.ToBindingList(Of EFResource)() +'#End Region ' #datainit End Sub - Private Sub Storage_AppointmentsModified(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.PersistentObjectsEventArgs) + Private Sub Storage_AppointmentsModified(ByVal sender As Object, ByVal e As PersistentObjectsEventArgs) context.SaveChanges() End Sub - Private Sub btnCreateAppointment_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCreateAppointment.Click + Private Sub btnCreateAppointment_Click(ByVal sender As Object, ByVal e As EventArgs) Dim apt As Appointment = schedulerStorage1.CreateAppointment(AppointmentType.Normal) apt.Start = Date.Now apt.End = Date.Now.AddHours(4) @@ -71,11 +66,5 @@ Namespace XtraSchedulerEFTest apt.LabelKey = 5 schedulerStorage1.Appointments.Add(apt) End Sub - - - - - - End Class End Namespace diff --git a/VB/XtraSchedulerEFTest/Program.vb b/VB/XtraSchedulerEFTest/Program.vb index d99aa94..25c280f 100644 --- a/VB/XtraSchedulerEFTest/Program.vb +++ b/VB/XtraSchedulerEFTest/Program.vb @@ -1,22 +1,18 @@ -Imports System -Imports System.Collections.Generic -Imports System.Linq +Imports System Imports System.Windows.Forms Namespace XtraSchedulerEFTest - Friend NotInheritable Class Program - Private Sub New() - End Sub + Friend Module Program ''' ''' The main entry point for the application. ''' - _ - Shared Sub Main() - Application.EnableVisualStyles() + + Sub Main() + Call Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(False) - Application.Run(New Form1()) + Call Application.Run(New Form1()) End Sub - End Class + End Module End Namespace diff --git a/VB/XtraSchedulerEFTest/Properties/AssemblyInfo.vb b/VB/XtraSchedulerEFTest/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..89af522 --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/AssemblyInfo.vb @@ -0,0 +1,32 @@ +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 +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' [assembly: AssemblyVersion("1.0.*")] + + diff --git a/VB/XtraSchedulerEFTest/Properties/DataSources/EFAppointment.datasource b/VB/XtraSchedulerEFTest/Properties/DataSources/EFAppointment.datasource new file mode 100644 index 0000000..5e78dd8 --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/DataSources/EFAppointment.datasource @@ -0,0 +1,10 @@ + + + + XtraSchedulerEFTest.EFAppointment, XtraSchedulerEFTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/VB/XtraSchedulerEFTest/Properties/DataSources/EFResource.datasource b/VB/XtraSchedulerEFTest/Properties/DataSources/EFResource.datasource new file mode 100644 index 0000000..293acca --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/DataSources/EFResource.datasource @@ -0,0 +1,10 @@ + + + + XtraSchedulerEFTest.EFResource, XtraSchedulerEFTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/VB/XtraSchedulerEFTest/Properties/Resources.Designer.vb b/VB/XtraSchedulerEFTest/Properties/Resources.Designer.vb new file mode 100644 index 0000000..6fda040 --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/Resources.Designer.vb @@ -0,0 +1,64 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.18449 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ +Imports System + +Namespace XtraSchedulerEFTest.Properties + + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + ' This class was auto-generated by the StronglyTypedResourceBuilder + ' class via a tool like ResGen or Visual Studio. + ' To add or remove a member, edit your .ResX file then rerun ResGen + ' with the /str option, or rebuild your VS project. + + + + Friend Class Resources + + Private Shared resourceMan As Global.System.Resources.ResourceManager + + Private Shared resourceCulture As Global.System.Globalization.CultureInfo + + + Friend Sub New() + End Sub + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + + Friend Shared ReadOnly Property ResourceManager As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(XtraSchedulerEFTest.Properties.Resources.resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Resources", GetType(XtraSchedulerEFTest.Properties.Resources).Assembly) + XtraSchedulerEFTest.Properties.Resources.resourceMan = temp + End If + + Return XtraSchedulerEFTest.Properties.Resources.resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + + Friend Shared Property Culture As Global.System.Globalization.CultureInfo + Get + Return XtraSchedulerEFTest.Properties.Resources.resourceCulture + End Get + + Set(ByVal value As Global.System.Globalization.CultureInfo) + XtraSchedulerEFTest.Properties.Resources.resourceCulture = value + End Set + End Property + End Class +End Namespace diff --git a/VB/XtraSchedulerEFTest/Properties/Resources.resx b/VB/XtraSchedulerEFTest/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VB/XtraSchedulerEFTest/Properties/Settings.Designer.vb b/VB/XtraSchedulerEFTest/Properties/Settings.Designer.vb new file mode 100644 index 0000000..e2478be --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/Settings.Designer.vb @@ -0,0 +1,35 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.18449 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ +Namespace XtraSchedulerEFTest.Properties + + + + Friend NotInheritable Partial Class Settings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As XtraSchedulerEFTest.Properties.Settings = CType((Global.System.Configuration.ApplicationSettingsBase.Synchronized(New XtraSchedulerEFTest.Properties.Settings())), XtraSchedulerEFTest.Properties.Settings) + + Public Shared ReadOnly Property [Default] As Settings + Get + Return XtraSchedulerEFTest.Properties.Settings.defaultInstance + End Get + End Property + + + + + + Public ReadOnly Property testConnectionString As String + Get + Return(CStr((Me("testConnectionString")))) + End Get + End Property + End Class +End Namespace diff --git a/VB/XtraSchedulerEFTest/Properties/Settings.settings b/VB/XtraSchedulerEFTest/Properties/Settings.settings new file mode 100644 index 0000000..b157d3f --- /dev/null +++ b/VB/XtraSchedulerEFTest/Properties/Settings.settings @@ -0,0 +1,14 @@ + + + + + + <?xml version="1.0" encoding="utf-16"?> +<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConnectionString>Data Source=|DataDirectory|\test.sdf</ConnectionString> + <ProviderName>Microsoft.SqlServerCe.Client.3.5</ProviderName> +</SerializableConnectionString> + Data Source=|DataDirectory|\test.sdf + + + \ No newline at end of file diff --git a/VB/XtraSchedulerEFTest/SchedulerContext.vb b/VB/XtraSchedulerEFTest/SchedulerContext.vb index 42f56c3..3936527 100644 --- a/VB/XtraSchedulerEFTest/SchedulerContext.vb +++ b/VB/XtraSchedulerEFTest/SchedulerContext.vb @@ -1,33 +1,32 @@ -Imports System.Data.Entity +Imports System.Data.Entity Namespace XtraSchedulerEFTest - #Region "#schedulercontext" + +'#Region "#schedulercontext" Friend Class SchedulerContext Inherits DbContext - Public Property EFAppointments() As DbSet(Of EFAppointment) - Public Property EFResources() As DbSet(Of EFResource) + Public Property EFAppointments As DbSet(Of EFAppointment) + + Public Property EFResources As DbSet(Of EFResource) End Class - #End Region ' #schedulercontext +'#End Region ' #schedulercontext Friend Class SchedulerContextSeedInilializer Inherits DropCreateDatabaseIfModelChanges(Of SchedulerContext) Protected Overrides Sub Seed(ByVal context As SchedulerContext) - Dim res1 As New EFResource() + Dim res1 As EFResource = New EFResource() res1.ResourceID = 1 res1.ResourceName = "Resource1" context.EFResources.Add(res1) res1.Color = System.Drawing.Color.DarkOrange.ToArgb() - - Dim res2 As New EFResource() + Dim res2 As EFResource = New EFResource() res2.ResourceID = 2 res2.ResourceName = "Resource2" res2.Color = System.Drawing.Color.SteelBlue.ToArgb() context.EFResources.Add(res2) - context.SaveChanges() End Sub - End Class End Namespace diff --git a/VB/XtraSchedulerEFTest/XtraSchedulerEFTest.vbproj b/VB/XtraSchedulerEFTest/XtraSchedulerEFTest.vbproj index dd2b1b8..a74b6f5 100644 --- a/VB/XtraSchedulerEFTest/XtraSchedulerEFTest.vbproj +++ b/VB/XtraSchedulerEFTest/XtraSchedulerEFTest.vbproj @@ -1,12 +1,14 @@ - + + On Debug x86 8.0.30703 2.0 {774DF92E-B1E1-4F83-A55D-61ECC674F2D6} WinExe + Properties XtraSchedulerEFTest @@ -29,10 +31,6 @@ false false true - On - Binary - Off - On x86 @@ -40,34 +38,22 @@ full false bin\Debug\ - true - true + DEBUG,TRACE prompt + 4 false - true + false x86 pdbonly true bin\Release\ - false - true + TRACE prompt + 4 false - - - - - - - - - - - - False @@ -112,10 +98,11 @@ False - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + False + ..\packages\EntityFramework.6.1.1\lib\net40\EntityFramework.dll - - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + ..\packages\EntityFramework.6.1.1\lib\net40\EntityFramework.SqlServer.dll @@ -141,18 +128,18 @@ Form1.vb - + Form1.vb - - VbMyResourcesResXFileCodeGenerator + + ResXFileCodeGenerator Resources.Designer.vb - My.Resources Designer + XtraSchedulerEFTest.Properties - + True Resources.resx True @@ -161,13 +148,13 @@ Designer - - - + + + SettingsSingleFileGenerator Settings.Designer.vb - + True Settings.settings True @@ -205,11 +192,11 @@ - - + \ No newline at end of file diff --git a/VB/XtraSchedulerEFTest/app.config b/VB/XtraSchedulerEFTest/app.config index 3d89bc1..9c24951 100644 --- a/VB/XtraSchedulerEFTest/app.config +++ b/VB/XtraSchedulerEFTest/app.config @@ -1,17 +1,17 @@ - + -
- - +
+ + - + - + - + diff --git a/VB/XtraSchedulerEFTest/packages.config b/VB/XtraSchedulerEFTest/packages.config index 1554c45..f2b40db 100644 --- a/VB/XtraSchedulerEFTest/packages.config +++ b/VB/XtraSchedulerEFTest/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file