├── .gitattributes
├── .gitignore
├── README.md
├── sample_5_6.sln
└── sample_5_6
├── CustomerList.Designer.cs
├── CustomerList.cs
├── CustomerList.resx
├── Dashboard.Designer.cs
├── Dashboard.cs
├── Dashboard.resx
├── DashboardControls
├── EventsCurrentYear.Designer.cs
├── EventsCurrentYear.cs
├── EventsCurrentYear.resx
├── Placeholder.cs
├── Placeholder.designer.cs
├── Placeholder.resx
├── RoomBookingsCurrentYear.Designer.cs
├── RoomBookingsCurrentYear.cs
├── RoomBookingsCurrentYear.resx
├── VenueDetails.Designer.cs
├── VenueDetails.cs
├── VenueDetails.resx
├── Venues.Designer.cs
├── Venues.cs
└── Venues.resx
├── EventView.Designer.cs
├── EventView.cs
├── EventView.resx
├── MainForm.Designer.cs
├── MainForm.cs
├── MainForm.resx
├── PivotOverview.Designer.cs
├── PivotOverview.cs
├── PivotOverview.resx
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.resx
├── Settings.Designer.cs
├── Settings.settings
└── licenses.licx
├── Resources
├── customers.svg
├── dashboard.svg
├── discardchanges.svg
├── event.svg
├── pivotoverview.svg
├── printexport.svg
├── report.svg
├── roombooking-alt.svg
├── savechanges.svg
└── venue.svg
├── RoomBookingView.Designer.cs
├── RoomBookingView.cs
├── RoomBookingView.resx
├── TransactionalChangeHandler.cs
├── app.config
├── packages.config
└── sample_5_6.csproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | final
--------------------------------------------------------------------------------
/sample_5_6.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30204.135
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sample_5_6", "sample_5_6\sample_5_6.csproj", "{61C6F160-D3CA-4AB4-B909-756299BDDF82}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {61C6F160-D3CA-4AB4-B909-756299BDDF82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {61C6F160-D3CA-4AB4-B909-756299BDDF82}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {61C6F160-D3CA-4AB4-B909-756299BDDF82}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {61C6F160-D3CA-4AB4-B909-756299BDDF82}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {ADB2F347-6184-412C-AEE3-81925B98E6CB}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/sample_5_6/CustomerList.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6 {
2 | partial class CustomerList {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.components = new System.ComponentModel.Container();
27 | this.customerCollection = new DevExpress.Xpo.XPCollection(this.components);
28 | this.unitOfWork = new DevExpress.Xpo.UnitOfWork(this.components);
29 | this.saveChangesItem = new DevExpress.XtraBars.BarButtonItem();
30 | this.discardChangesItem = new DevExpress.XtraBars.BarButtonItem();
31 | this.printExportItem = new DevExpress.XtraBars.BarButtonItem();
32 | this.ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl();
33 | this.ribbonPageCategory1 = new DevExpress.XtraBars.Ribbon.RibbonPageCategory();
34 | this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
35 | this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
36 | this.ribbonPageGroup2 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
37 | ((System.ComponentModel.ISupportInitialize)(this.customerCollection)).BeginInit();
38 | ((System.ComponentModel.ISupportInitialize)(this.unitOfWork)).BeginInit();
39 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).BeginInit();
40 | this.SuspendLayout();
41 | //
42 | // customerCollection
43 | //
44 | this.customerCollection.ObjectType = typeof(EventsDB.Customer);
45 | this.customerCollection.Session = this.unitOfWork;
46 | //
47 | // saveChangesItem
48 | //
49 | this.saveChangesItem.Caption = "Save Changes";
50 | this.saveChangesItem.Id = 1;
51 | this.saveChangesItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.savechanges;
52 | this.saveChangesItem.Name = "saveChangesItem";
53 | //
54 | // discardChangesItem
55 | //
56 | this.discardChangesItem.Caption = "Discard Changes";
57 | this.discardChangesItem.Id = 2;
58 | this.discardChangesItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.discardchanges;
59 | this.discardChangesItem.Name = "discardChangesItem";
60 | //
61 | // printExportItem
62 | //
63 | this.printExportItem.Caption = "Print && Export";
64 | this.printExportItem.Id = 3;
65 | this.printExportItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.printexport;
66 | this.printExportItem.Name = "printExportItem";
67 | //
68 | // ribbonControl1
69 | //
70 | this.ribbonControl1.ExpandCollapseItem.Id = 0;
71 | this.ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
72 | this.ribbonControl1.ExpandCollapseItem,
73 | this.ribbonControl1.SearchEditItem,
74 | this.saveChangesItem,
75 | this.discardChangesItem,
76 | this.printExportItem});
77 | this.ribbonControl1.Location = new System.Drawing.Point(0, 0);
78 | this.ribbonControl1.MaxItemId = 1;
79 | this.ribbonControl1.Name = "ribbonControl1";
80 | this.ribbonControl1.PageCategories.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageCategory[] {
81 | this.ribbonPageCategory1});
82 | this.ribbonControl1.Size = new System.Drawing.Size(569, 150);
83 | //
84 | // ribbonPageCategory1
85 | //
86 | this.ribbonPageCategory1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
87 | this.ribbonPageCategory1.Appearance.Options.UseBackColor = true;
88 | this.ribbonPageCategory1.Name = "ribbonPageCategory1";
89 | this.ribbonPageCategory1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
90 | this.ribbonPage1});
91 | this.ribbonPageCategory1.Text = "Customers";
92 | //
93 | // ribbonPage1
94 | //
95 | this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
96 | this.ribbonPageGroup1,
97 | this.ribbonPageGroup2});
98 | this.ribbonPage1.Name = "ribbonPage1";
99 | this.ribbonPage1.Text = "Data Operations";
100 | //
101 | // ribbonPageGroup1
102 | //
103 | this.ribbonPageGroup1.ItemLinks.Add(this.saveChangesItem);
104 | this.ribbonPageGroup1.ItemLinks.Add(this.discardChangesItem);
105 | this.ribbonPageGroup1.Name = "ribbonPageGroup1";
106 | this.ribbonPageGroup1.Text = "Persistence";
107 | //
108 | // ribbonPageGroup2
109 | //
110 | this.ribbonPageGroup2.ItemLinks.Add(this.printExportItem);
111 | this.ribbonPageGroup2.Name = "ribbonPageGroup2";
112 | this.ribbonPageGroup2.Text = "Tools";
113 | //
114 | // CustomerList
115 | //
116 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
117 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
118 | this.Controls.Add(this.ribbonControl1);
119 | this.Name = "CustomerList";
120 | this.Size = new System.Drawing.Size(569, 338);
121 | this.Load += new System.EventHandler(this.CustomerList_Load);
122 | ((System.ComponentModel.ISupportInitialize)(this.customerCollection)).EndInit();
123 | ((System.ComponentModel.ISupportInitialize)(this.unitOfWork)).EndInit();
124 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).EndInit();
125 | this.ResumeLayout(false);
126 | this.PerformLayout();
127 |
128 | }
129 |
130 | #endregion
131 | private DevExpress.Xpo.UnitOfWork unitOfWork;
132 | private DevExpress.Xpo.XPCollection customerCollection;
133 | private DevExpress.XtraBars.BarButtonItem saveChangesItem;
134 | private DevExpress.XtraBars.BarButtonItem discardChangesItem;
135 | private DevExpress.XtraBars.BarButtonItem printExportItem;
136 | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1;
137 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1;
138 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1;
139 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup2;
140 | private DevExpress.XtraBars.Ribbon.RibbonPageCategory ribbonPageCategory1;
141 | }
142 | }
--------------------------------------------------------------------------------
/sample_5_6/CustomerList.cs:
--------------------------------------------------------------------------------
1 | using EventsDB;
2 | using DevExpress.XtraEditors;
3 | using DevExpress.XtraBars.Docking2010;
4 |
5 | namespace sample_5_6 {
6 | public partial class CustomerList : XtraUserControl {
7 | public CustomerList() {
8 | InitializeComponent();
9 | }
10 |
11 | private void CustomerList_Load(object sender, System.EventArgs e) {
12 | TransactionalChangeHandler.Hookup(
13 | DocumentManager.FromControl(ParentForm).View, unitOfWork, saveChangesItem,
14 | discardChangesItem, customerCollection);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sample_5_6/CustomerList.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 242, 17
122 |
123 |
124 | 134, 17
125 |
126 |
--------------------------------------------------------------------------------
/sample_5_6/Dashboard.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6 {
2 | partial class Dashboard {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.components = new System.ComponentModel.Container();
27 | DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer widgetDockingContainer1 = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer();
28 | DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer widgetDockingContainer2 = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer();
29 | DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer widgetDockingContainer3 = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer();
30 | DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer widgetDockingContainer4 = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer();
31 | DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer widgetDockingContainer5 = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer();
32 | DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer widgetDockingContainer6 = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetDockingContainer();
33 | this.eventsCurrentYearDocument = new DevExpress.XtraBars.Docking2010.Views.Widget.Document(this.components);
34 | this.roomBookingsCurrentYearDocument = new DevExpress.XtraBars.Docking2010.Views.Widget.Document(this.components);
35 | this.venuesDocument = new DevExpress.XtraBars.Docking2010.Views.Widget.Document(this.components);
36 | this.venueDetailsDocument = new DevExpress.XtraBars.Docking2010.Views.Widget.Document(this.components);
37 | this.roomBookingCollection = new DevExpress.Xpo.XPCollection(this.components);
38 | this.session = new DevExpress.Xpo.Session(this.components);
39 | this.eventCollection = new DevExpress.Xpo.XPCollection(this.components);
40 | this.singleVenueChartLink = new DevExpress.XtraPrinting.PrintableComponentLink(this.components);
41 | this.printExportItem = new DevExpress.XtraBars.BarButtonItem();
42 | this.ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl();
43 | this.ribbonPageCategory1 = new DevExpress.XtraBars.Ribbon.RibbonPageCategory();
44 | this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
45 | this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
46 | this.documentManager1 = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
47 | this.widgetView = new DevExpress.XtraBars.Docking2010.Views.Widget.WidgetView(this.components);
48 | ((System.ComponentModel.ISupportInitialize)(this.eventsCurrentYearDocument)).BeginInit();
49 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingsCurrentYearDocument)).BeginInit();
50 | ((System.ComponentModel.ISupportInitialize)(this.venuesDocument)).BeginInit();
51 | ((System.ComponentModel.ISupportInitialize)(this.venueDetailsDocument)).BeginInit();
52 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingCollection)).BeginInit();
53 | ((System.ComponentModel.ISupportInitialize)(this.session)).BeginInit();
54 | ((System.ComponentModel.ISupportInitialize)(this.eventCollection)).BeginInit();
55 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).BeginInit();
56 | ((System.ComponentModel.ISupportInitialize)(this.documentManager1)).BeginInit();
57 | ((System.ComponentModel.ISupportInitialize)(this.widgetView)).BeginInit();
58 | this.SuspendLayout();
59 | //
60 | // eventsCurrentYearDocument
61 | //
62 | this.eventsCurrentYearDocument.Caption = "Events / Current Year";
63 | this.eventsCurrentYearDocument.ControlName = "EventsCurrentYear";
64 | //
65 | // roomBookingsCurrentYearDocument
66 | //
67 | this.roomBookingsCurrentYearDocument.Caption = "Room Bookings / Current Year";
68 | this.roomBookingsCurrentYearDocument.ColumnIndex = 1;
69 | this.roomBookingsCurrentYearDocument.ControlName = "RoomBookingsCurrentYear";
70 | //
71 | // venuesDocument
72 | //
73 | this.venuesDocument.Caption = "Venues";
74 | this.venuesDocument.ControlName = "Venues";
75 | this.venuesDocument.RowIndex = 1;
76 | //
77 | // venueDetailsDocument
78 | //
79 | this.venueDetailsDocument.Caption = "Venue Details";
80 | this.venueDetailsDocument.ColumnIndex = 1;
81 | this.venueDetailsDocument.ControlName = "VenueDetails";
82 | this.venueDetailsDocument.RowIndex = 1;
83 | //
84 | // roomBookingCollection
85 | //
86 | this.roomBookingCollection.ObjectType = typeof(EventsDB.RoomBooking);
87 | this.roomBookingCollection.Session = this.session;
88 | //
89 | // eventCollection
90 | //
91 | this.eventCollection.ObjectType = typeof(EventsDB.Event);
92 | this.eventCollection.Session = this.session;
93 | //
94 | // singleVenueChartLink
95 | //
96 | this.singleVenueChartLink.PaperKind = System.Drawing.Printing.PaperKind.A4;
97 | //
98 | // printExportItem
99 | //
100 | this.printExportItem.Caption = "Print && Export";
101 | this.printExportItem.Id = 0;
102 | this.printExportItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.printexport;
103 | this.printExportItem.Name = "printExportItem";
104 | //
105 | // ribbonControl1
106 | //
107 | this.ribbonControl1.ExpandCollapseItem.Id = 0;
108 | this.ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
109 | this.ribbonControl1.ExpandCollapseItem,
110 | this.ribbonControl1.SearchEditItem,
111 | this.printExportItem});
112 | this.ribbonControl1.Location = new System.Drawing.Point(0, 0);
113 | this.ribbonControl1.MaxItemId = 1;
114 | this.ribbonControl1.Name = "ribbonControl1";
115 | this.ribbonControl1.PageCategories.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageCategory[] {
116 | this.ribbonPageCategory1});
117 | this.ribbonControl1.Size = new System.Drawing.Size(931, 150);
118 | //
119 | // ribbonPageCategory1
120 | //
121 | this.ribbonPageCategory1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
122 | this.ribbonPageCategory1.Appearance.Options.UseBackColor = true;
123 | this.ribbonPageCategory1.Name = "ribbonPageCategory1";
124 | this.ribbonPageCategory1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
125 | this.ribbonPage1});
126 | this.ribbonPageCategory1.Text = "Dashboard";
127 | //
128 | // ribbonPage1
129 | //
130 | this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
131 | this.ribbonPageGroup1});
132 | this.ribbonPage1.Name = "ribbonPage1";
133 | this.ribbonPage1.Text = "Data Operations";
134 | //
135 | // ribbonPageGroup1
136 | //
137 | this.ribbonPageGroup1.ItemLinks.Add(this.printExportItem);
138 | this.ribbonPageGroup1.Name = "ribbonPageGroup1";
139 | this.ribbonPageGroup1.Text = "Tools";
140 | //
141 | // documentManager1
142 | //
143 | this.documentManager1.ContainerControl = this;
144 | this.documentManager1.MenuManager = this.ribbonControl1;
145 | this.documentManager1.View = this.widgetView;
146 | this.documentManager1.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {
147 | this.widgetView});
148 | //
149 | // widgetView
150 | //
151 | this.widgetView.Documents.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseDocument[] {
152 | this.eventsCurrentYearDocument,
153 | this.roomBookingsCurrentYearDocument,
154 | this.venuesDocument,
155 | this.venueDetailsDocument});
156 | this.widgetView.FreeLayoutProperties.FreeLayoutItems.AddRange(new DevExpress.XtraBars.Docking2010.Views.Widget.Document[] {
157 | this.eventsCurrentYearDocument,
158 | this.roomBookingsCurrentYearDocument,
159 | this.venuesDocument,
160 | this.venueDetailsDocument});
161 | this.widgetView.LayoutMode = DevExpress.XtraBars.Docking2010.Views.Widget.LayoutMode.FreeLayout;
162 | widgetDockingContainer2.Element = this.eventsCurrentYearDocument;
163 | widgetDockingContainer3.Element = this.roomBookingsCurrentYearDocument;
164 | widgetDockingContainer1.Nodes.AddRange(new DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer[] {
165 | widgetDockingContainer2,
166 | widgetDockingContainer3});
167 | widgetDockingContainer5.Element = this.venuesDocument;
168 | widgetDockingContainer6.Element = this.venueDetailsDocument;
169 | widgetDockingContainer4.Nodes.AddRange(new DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer[] {
170 | widgetDockingContainer5,
171 | widgetDockingContainer6});
172 | this.widgetView.RootContainer.Nodes.AddRange(new DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer[] {
173 | widgetDockingContainer1,
174 | widgetDockingContainer4});
175 | this.widgetView.RootContainer.Orientation = System.Windows.Forms.Orientation.Vertical;
176 | this.widgetView.QueryControl += new DevExpress.XtraBars.Docking2010.Views.QueryControlEventHandler(this.widgetView_QueryControl);
177 | //
178 | // Dashboard
179 | //
180 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
181 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
182 | this.Controls.Add(this.ribbonControl1);
183 | this.Name = "Dashboard";
184 | this.Size = new System.Drawing.Size(931, 686);
185 | ((System.ComponentModel.ISupportInitialize)(this.eventsCurrentYearDocument)).EndInit();
186 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingsCurrentYearDocument)).EndInit();
187 | ((System.ComponentModel.ISupportInitialize)(this.venuesDocument)).EndInit();
188 | ((System.ComponentModel.ISupportInitialize)(this.venueDetailsDocument)).EndInit();
189 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingCollection)).EndInit();
190 | ((System.ComponentModel.ISupportInitialize)(this.session)).EndInit();
191 | ((System.ComponentModel.ISupportInitialize)(this.eventCollection)).EndInit();
192 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).EndInit();
193 | ((System.ComponentModel.ISupportInitialize)(this.documentManager1)).EndInit();
194 | ((System.ComponentModel.ISupportInitialize)(this.widgetView)).EndInit();
195 | this.ResumeLayout(false);
196 | this.PerformLayout();
197 |
198 | }
199 |
200 | #endregion
201 | private DevExpress.Xpo.Session session;
202 | private DevExpress.Xpo.XPCollection eventCollection;
203 | private DevExpress.Xpo.XPCollection roomBookingCollection;
204 | private DevExpress.XtraPrinting.PrintableComponentLink singleVenueChartLink;
205 | private DevExpress.XtraBars.BarButtonItem printExportItem;
206 | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1;
207 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1;
208 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1;
209 | private DevExpress.XtraBars.Ribbon.RibbonPageCategory ribbonPageCategory1;
210 | private DevExpress.XtraBars.Docking2010.DocumentManager documentManager1;
211 | private DevExpress.XtraBars.Docking2010.Views.Widget.WidgetView widgetView;
212 | private DevExpress.XtraBars.Docking2010.Views.Widget.Document eventsCurrentYearDocument;
213 | private DevExpress.XtraBars.Docking2010.Views.Widget.Document roomBookingsCurrentYearDocument;
214 | private DevExpress.XtraBars.Docking2010.Views.Widget.Document venuesDocument;
215 | private DevExpress.XtraBars.Docking2010.Views.Widget.Document venueDetailsDocument;
216 | }
217 | }
--------------------------------------------------------------------------------
/sample_5_6/Dashboard.cs:
--------------------------------------------------------------------------------
1 | using DevExpress.XtraEditors;
2 | using sample_5_6.DashboardControls;
3 | using System.Windows.Forms;
4 |
5 | namespace sample_5_6 {
6 | public partial class Dashboard : XtraUserControl {
7 | public Dashboard() {
8 | InitializeComponent();
9 | }
10 |
11 | private void widgetView_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e) {
12 | e.Control = e.Document.ControlName switch
13 | {
14 | "EventsCurrentYear" => new EventsCurrentYear(),
15 | "RoomBookingsCurrentYear" => new RoomBookingsCurrentYear(),
16 | "VenueDetails" => new VenueDetails(),
17 | "Venues" => new Venues(),
18 | _ => new Control()
19 | };
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample_5_6/Dashboard.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 470, 17
122 |
123 |
124 | 251, 17
125 |
126 |
127 | 338, 17
128 |
129 |
130 | 650, 17
131 |
132 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/EventsCurrentYear.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6.DashboardControls {
2 | partial class EventsCurrentYear {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Component Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange1 = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
27 | DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange2 = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
28 | DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange3 = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
29 | this.gaugeControl1 = new DevExpress.XtraGauges.Win.GaugeControl();
30 | this.eventsCurrentYearGauge = new DevExpress.XtraGauges.Win.Gauges.Circular.CircularGauge();
31 | this.arcScaleComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent();
32 | this.arcScaleBackgroundLayerComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent();
33 | this.arcScaleNeedleComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent();
34 | ((System.ComponentModel.ISupportInitialize)(this.eventsCurrentYearGauge)).BeginInit();
35 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponent1)).BeginInit();
36 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleBackgroundLayerComponent1)).BeginInit();
37 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleNeedleComponent1)).BeginInit();
38 | this.SuspendLayout();
39 | //
40 | // gaugeControl1
41 | //
42 | this.gaugeControl1.Dock = System.Windows.Forms.DockStyle.Fill;
43 | this.gaugeControl1.Gauges.AddRange(new DevExpress.XtraGauges.Base.IGauge[] {
44 | this.eventsCurrentYearGauge});
45 | this.gaugeControl1.Location = new System.Drawing.Point(0, 0);
46 | this.gaugeControl1.Name = "gaugeControl1";
47 | this.gaugeControl1.Size = new System.Drawing.Size(470, 291);
48 | this.gaugeControl1.TabIndex = 0;
49 | //
50 | // eventsCurrentYearGauge
51 | //
52 | this.eventsCurrentYearGauge.BackgroundLayers.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent[] {
53 | this.arcScaleBackgroundLayerComponent1});
54 | this.eventsCurrentYearGauge.Bounds = new System.Drawing.Rectangle(6, 6, 458, 279);
55 | this.eventsCurrentYearGauge.Name = "eventsCurrentYearGauge";
56 | this.eventsCurrentYearGauge.Needles.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent[] {
57 | this.arcScaleNeedleComponent1});
58 | this.eventsCurrentYearGauge.Scales.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent[] {
59 | this.arcScaleComponent1});
60 | //
61 | // arcScaleComponent1
62 | //
63 | this.arcScaleComponent1.AppearanceMajorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
64 | this.arcScaleComponent1.AppearanceMajorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
65 | this.arcScaleComponent1.AppearanceMinorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
66 | this.arcScaleComponent1.AppearanceMinorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
67 | this.arcScaleComponent1.AppearanceScale.Brush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#058897");
68 | this.arcScaleComponent1.AppearanceScale.Width = 3F;
69 | this.arcScaleComponent1.AppearanceTickmarkText.Font = new System.Drawing.Font("Tahoma", 9.75F);
70 | this.arcScaleComponent1.AppearanceTickmarkText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#00E1F3");
71 | this.arcScaleComponent1.AutoRescaling = true;
72 | this.arcScaleComponent1.Center = new DevExpress.XtraGauges.Core.Base.PointF2D(125F, 165F);
73 | this.arcScaleComponent1.EndAngle = 0F;
74 | this.arcScaleComponent1.MajorTickCount = 6;
75 | this.arcScaleComponent1.MajorTickmark.FormatString = "{0:F0}";
76 | this.arcScaleComponent1.MajorTickmark.ShapeOffset = -11F;
77 | this.arcScaleComponent1.MajorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style17_1;
78 | this.arcScaleComponent1.MajorTickmark.TextOffset = -22F;
79 | this.arcScaleComponent1.MajorTickmark.TextOrientation = DevExpress.XtraGauges.Core.Model.LabelOrientation.LeftToRight;
80 | this.arcScaleComponent1.MaxValue = 20F;
81 | this.arcScaleComponent1.MinorTickCount = 4;
82 | this.arcScaleComponent1.MinorTickmark.ShapeOffset = -7F;
83 | this.arcScaleComponent1.MinorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style17_2;
84 | this.arcScaleComponent1.Name = "scale1";
85 | this.arcScaleComponent1.RadiusX = 95F;
86 | this.arcScaleComponent1.RadiusY = 85F;
87 | arcScaleRange1.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#09AC86");
88 | arcScaleRange1.EndPercent = 0.6F;
89 | arcScaleRange1.EndValue = 33F;
90 | arcScaleRange1.Name = "Range0";
91 | arcScaleRange1.ShapeOffset = 0F;
92 | arcScaleRange1.StartPercent = 0F;
93 | arcScaleRange2.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#CAB46E");
94 | arcScaleRange2.EndPercent = 0.9F;
95 | arcScaleRange2.EndValue = 66F;
96 | arcScaleRange2.Name = "Range1";
97 | arcScaleRange2.ShapeOffset = 0F;
98 | arcScaleRange2.StartPercent = 0.6F;
99 | arcScaleRange2.StartValue = 33F;
100 | arcScaleRange3.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#C16268");
101 | arcScaleRange3.EndPercent = 1F;
102 | arcScaleRange3.EndValue = 100F;
103 | arcScaleRange3.Name = "Range2";
104 | arcScaleRange3.ShapeOffset = 0F;
105 | arcScaleRange3.StartPercent = 0.9F;
106 | arcScaleRange3.StartValue = 66F;
107 | this.arcScaleComponent1.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] {
108 | arcScaleRange1,
109 | arcScaleRange2,
110 | arcScaleRange3});
111 | this.arcScaleComponent1.RescalingBestValues = true;
112 | this.arcScaleComponent1.RescalingThresholdMax = 0.3F;
113 | this.arcScaleComponent1.StartAngle = -180F;
114 | this.arcScaleComponent1.Value = 10F;
115 | //
116 | // arcScaleBackgroundLayerComponent1
117 | //
118 | this.arcScaleBackgroundLayerComponent1.ArcScale = this.arcScaleComponent1;
119 | this.arcScaleBackgroundLayerComponent1.Name = "bg";
120 | this.arcScaleBackgroundLayerComponent1.ScaleCenterPos = new DevExpress.XtraGauges.Core.Base.PointF2D(0.5F, 0.68F);
121 | this.arcScaleBackgroundLayerComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.BackgroundLayerShapeType.CircularHalf_Style17;
122 | this.arcScaleBackgroundLayerComponent1.Size = new System.Drawing.SizeF(250F, 179F);
123 | this.arcScaleBackgroundLayerComponent1.ZOrder = 1000;
124 | //
125 | // arcScaleNeedleComponent1
126 | //
127 | this.arcScaleNeedleComponent1.ArcScale = this.arcScaleComponent1;
128 | this.arcScaleNeedleComponent1.EndOffset = 4F;
129 | this.arcScaleNeedleComponent1.Name = "needle";
130 | this.arcScaleNeedleComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.NeedleShapeType.CircularFull_Style17;
131 | this.arcScaleNeedleComponent1.StartOffset = -27F;
132 | this.arcScaleNeedleComponent1.ZOrder = -50;
133 | //
134 | // EventsCurrentYear
135 | //
136 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
137 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138 | this.Controls.Add(this.gaugeControl1);
139 | this.Name = "EventsCurrentYear";
140 | this.Size = new System.Drawing.Size(470, 291);
141 | ((System.ComponentModel.ISupportInitialize)(this.eventsCurrentYearGauge)).EndInit();
142 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponent1)).EndInit();
143 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleBackgroundLayerComponent1)).EndInit();
144 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleNeedleComponent1)).EndInit();
145 | this.ResumeLayout(false);
146 |
147 | }
148 |
149 | #endregion
150 |
151 | private DevExpress.XtraGauges.Win.GaugeControl gaugeControl1;
152 | private DevExpress.XtraGauges.Win.Gauges.Circular.CircularGauge eventsCurrentYearGauge;
153 | private DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent arcScaleBackgroundLayerComponent1;
154 | private DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent1;
155 | private DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent arcScaleNeedleComponent1;
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/EventsCurrentYear.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Text;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using DevExpress.XtraEditors;
11 |
12 | namespace sample_5_6.DashboardControls {
13 | public partial class EventsCurrentYear : DevExpress.XtraEditors.XtraUserControl {
14 | public EventsCurrentYear() {
15 | InitializeComponent();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/EventsCurrentYear.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/Placeholder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Text;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using DevExpress.XtraEditors;
11 |
12 | namespace sample_5_6.DashboardControls {
13 | public partial class Placeholder : DevExpress.XtraEditors.XtraUserControl {
14 | public Placeholder() {
15 | InitializeComponent();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/Placeholder.designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6.DashboardControls {
2 | partial class Placeholder {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Component Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
27 | this.SuspendLayout();
28 | //
29 | // labelControl1
30 | //
31 | this.labelControl1.Appearance.BackColor = System.Drawing.Color.Ivory;
32 | this.labelControl1.Appearance.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold);
33 | this.labelControl1.Appearance.Options.UseBackColor = true;
34 | this.labelControl1.Appearance.Options.UseFont = true;
35 | this.labelControl1.Appearance.Options.UseTextOptions = true;
36 | this.labelControl1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
37 | this.labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
38 | this.labelControl1.Dock = System.Windows.Forms.DockStyle.Fill;
39 | this.labelControl1.Location = new System.Drawing.Point(0, 0);
40 | this.labelControl1.Name = "labelControl1";
41 | this.labelControl1.Size = new System.Drawing.Size(580, 280);
42 | this.labelControl1.TabIndex = 0;
43 | this.labelControl1.Text = "UI Placeholder";
44 | //
45 | // Placeholder
46 | //
47 | this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 23F);
48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
49 | this.Controls.Add(this.labelControl1);
50 | this.Name = "Placeholder";
51 | this.Size = new System.Drawing.Size(580, 280);
52 | this.ResumeLayout(false);
53 |
54 | }
55 |
56 | #endregion
57 |
58 | private DevExpress.XtraEditors.LabelControl labelControl1;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/Placeholder.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/RoomBookingsCurrentYear.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6.DashboardControls {
2 | partial class RoomBookingsCurrentYear {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Component Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange1 = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
27 | DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange2 = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
28 | DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange3 = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
29 | this.gaugeControl1 = new DevExpress.XtraGauges.Win.GaugeControl();
30 | this.roomBookingsCurrentYearGauge = new DevExpress.XtraGauges.Win.Gauges.Circular.CircularGauge();
31 | this.arcScaleComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent();
32 | this.arcScaleBackgroundLayerComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent();
33 | this.arcScaleNeedleComponent1 = new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent();
34 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingsCurrentYearGauge)).BeginInit();
35 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponent1)).BeginInit();
36 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleBackgroundLayerComponent1)).BeginInit();
37 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleNeedleComponent1)).BeginInit();
38 | this.SuspendLayout();
39 | //
40 | // gaugeControl1
41 | //
42 | this.gaugeControl1.Dock = System.Windows.Forms.DockStyle.Fill;
43 | this.gaugeControl1.Gauges.AddRange(new DevExpress.XtraGauges.Base.IGauge[] {
44 | this.roomBookingsCurrentYearGauge});
45 | this.gaugeControl1.Location = new System.Drawing.Point(0, 0);
46 | this.gaugeControl1.Name = "gaugeControl1";
47 | this.gaugeControl1.Size = new System.Drawing.Size(466, 290);
48 | this.gaugeControl1.TabIndex = 0;
49 | //
50 | // roomBookingsCurrentYearGauge
51 | //
52 | this.roomBookingsCurrentYearGauge.BackgroundLayers.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent[] {
53 | this.arcScaleBackgroundLayerComponent1});
54 | this.roomBookingsCurrentYearGauge.Bounds = new System.Drawing.Rectangle(6, 6, 454, 278);
55 | this.roomBookingsCurrentYearGauge.Name = "roomBookingsCurrentYearGauge";
56 | this.roomBookingsCurrentYearGauge.Needles.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent[] {
57 | this.arcScaleNeedleComponent1});
58 | this.roomBookingsCurrentYearGauge.Scales.AddRange(new DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent[] {
59 | this.arcScaleComponent1});
60 | //
61 | // arcScaleComponent1
62 | //
63 | this.arcScaleComponent1.AppearanceMajorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
64 | this.arcScaleComponent1.AppearanceMajorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
65 | this.arcScaleComponent1.AppearanceMinorTickmark.BorderBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
66 | this.arcScaleComponent1.AppearanceMinorTickmark.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
67 | this.arcScaleComponent1.AppearanceScale.Brush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#058897");
68 | this.arcScaleComponent1.AppearanceScale.Width = 3F;
69 | this.arcScaleComponent1.AppearanceTickmarkText.Font = new System.Drawing.Font("Tahoma", 9.75F);
70 | this.arcScaleComponent1.AppearanceTickmarkText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#00E1F3");
71 | this.arcScaleComponent1.AutoRescaling = true;
72 | this.arcScaleComponent1.Center = new DevExpress.XtraGauges.Core.Base.PointF2D(125F, 165F);
73 | this.arcScaleComponent1.EndAngle = 0F;
74 | this.arcScaleComponent1.MajorTickCount = 6;
75 | this.arcScaleComponent1.MajorTickmark.FormatString = "{0:F0}";
76 | this.arcScaleComponent1.MajorTickmark.ShapeOffset = -11F;
77 | this.arcScaleComponent1.MajorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style17_1;
78 | this.arcScaleComponent1.MajorTickmark.TextOffset = -22F;
79 | this.arcScaleComponent1.MajorTickmark.TextOrientation = DevExpress.XtraGauges.Core.Model.LabelOrientation.LeftToRight;
80 | this.arcScaleComponent1.MaxValue = 20F;
81 | this.arcScaleComponent1.MinorTickCount = 4;
82 | this.arcScaleComponent1.MinorTickmark.ShapeOffset = -7F;
83 | this.arcScaleComponent1.MinorTickmark.ShapeType = DevExpress.XtraGauges.Core.Model.TickmarkShapeType.Circular_Style17_2;
84 | this.arcScaleComponent1.Name = "scale1";
85 | this.arcScaleComponent1.RadiusX = 95F;
86 | this.arcScaleComponent1.RadiusY = 85F;
87 | arcScaleRange1.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#09AC86");
88 | arcScaleRange1.EndPercent = 0.6F;
89 | arcScaleRange1.EndValue = 33F;
90 | arcScaleRange1.Name = "Range0";
91 | arcScaleRange1.ShapeOffset = 0F;
92 | arcScaleRange1.StartPercent = 0F;
93 | arcScaleRange2.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#CAB46E");
94 | arcScaleRange2.EndPercent = 0.9F;
95 | arcScaleRange2.EndValue = 66F;
96 | arcScaleRange2.Name = "Range1";
97 | arcScaleRange2.ShapeOffset = 0F;
98 | arcScaleRange2.StartPercent = 0.6F;
99 | arcScaleRange2.StartValue = 33F;
100 | arcScaleRange3.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#C16268");
101 | arcScaleRange3.EndPercent = 1F;
102 | arcScaleRange3.EndValue = 100F;
103 | arcScaleRange3.Name = "Range2";
104 | arcScaleRange3.ShapeOffset = 0F;
105 | arcScaleRange3.StartPercent = 0.9F;
106 | arcScaleRange3.StartValue = 66F;
107 | this.arcScaleComponent1.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] {
108 | arcScaleRange1,
109 | arcScaleRange2,
110 | arcScaleRange3});
111 | this.arcScaleComponent1.RescalingBestValues = true;
112 | this.arcScaleComponent1.RescalingThresholdMax = 0.3F;
113 | this.arcScaleComponent1.StartAngle = -180F;
114 | this.arcScaleComponent1.Value = 10F;
115 | //
116 | // arcScaleBackgroundLayerComponent1
117 | //
118 | this.arcScaleBackgroundLayerComponent1.ArcScale = this.arcScaleComponent1;
119 | this.arcScaleBackgroundLayerComponent1.Name = "bg";
120 | this.arcScaleBackgroundLayerComponent1.ScaleCenterPos = new DevExpress.XtraGauges.Core.Base.PointF2D(0.5F, 0.68F);
121 | this.arcScaleBackgroundLayerComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.BackgroundLayerShapeType.CircularHalf_Style17;
122 | this.arcScaleBackgroundLayerComponent1.Size = new System.Drawing.SizeF(250F, 179F);
123 | this.arcScaleBackgroundLayerComponent1.ZOrder = 1000;
124 | //
125 | // arcScaleNeedleComponent1
126 | //
127 | this.arcScaleNeedleComponent1.ArcScale = this.arcScaleComponent1;
128 | this.arcScaleNeedleComponent1.EndOffset = 4F;
129 | this.arcScaleNeedleComponent1.Name = "needle";
130 | this.arcScaleNeedleComponent1.ShapeType = DevExpress.XtraGauges.Core.Model.NeedleShapeType.CircularFull_Style17;
131 | this.arcScaleNeedleComponent1.StartOffset = -27F;
132 | this.arcScaleNeedleComponent1.ZOrder = -50;
133 | //
134 | // RoomBookingsCurrentYear
135 | //
136 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
137 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138 | this.Controls.Add(this.gaugeControl1);
139 | this.Name = "RoomBookingsCurrentYear";
140 | this.Size = new System.Drawing.Size(466, 290);
141 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingsCurrentYearGauge)).EndInit();
142 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleComponent1)).EndInit();
143 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleBackgroundLayerComponent1)).EndInit();
144 | ((System.ComponentModel.ISupportInitialize)(this.arcScaleNeedleComponent1)).EndInit();
145 | this.ResumeLayout(false);
146 |
147 | }
148 |
149 | #endregion
150 |
151 | private DevExpress.XtraGauges.Win.GaugeControl gaugeControl1;
152 | private DevExpress.XtraGauges.Win.Gauges.Circular.CircularGauge roomBookingsCurrentYearGauge;
153 | private DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleBackgroundLayerComponent arcScaleBackgroundLayerComponent1;
154 | private DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent1;
155 | private DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleNeedleComponent arcScaleNeedleComponent1;
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/RoomBookingsCurrentYear.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Text;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using DevExpress.XtraEditors;
11 |
12 | namespace sample_5_6.DashboardControls {
13 | public partial class RoomBookingsCurrentYear : DevExpress.XtraEditors.XtraUserControl {
14 | public RoomBookingsCurrentYear() {
15 | InitializeComponent();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/RoomBookingsCurrentYear.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/VenueDetails.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6.DashboardControls {
2 | partial class VenueDetails {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Component Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.placeholder1 = new sample_5_6.DashboardControls.Placeholder();
27 | this.SuspendLayout();
28 | //
29 | // placeholder1
30 | //
31 | this.placeholder1.Dock = System.Windows.Forms.DockStyle.Fill;
32 | this.placeholder1.Location = new System.Drawing.Point(0, 0);
33 | this.placeholder1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
34 | this.placeholder1.Name = "placeholder1";
35 | this.placeholder1.Size = new System.Drawing.Size(150, 150);
36 | this.placeholder1.TabIndex = 0;
37 | //
38 | // VenueDetails
39 | //
40 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
41 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
42 | this.Controls.Add(this.placeholder1);
43 | this.Name = "VenueDetails";
44 | this.ResumeLayout(false);
45 |
46 | }
47 |
48 | #endregion
49 |
50 | private Placeholder placeholder1;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/VenueDetails.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Text;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using DevExpress.XtraEditors;
11 |
12 | namespace sample_5_6.DashboardControls {
13 | public partial class VenueDetails : DevExpress.XtraEditors.XtraUserControl {
14 | public VenueDetails() {
15 | InitializeComponent();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/VenueDetails.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/Venues.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6.DashboardControls {
2 | partial class Venues {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Component Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.placeholder1 = new sample_5_6.DashboardControls.Placeholder();
27 | this.SuspendLayout();
28 | //
29 | // placeholder1
30 | //
31 | this.placeholder1.Dock = System.Windows.Forms.DockStyle.Fill;
32 | this.placeholder1.Location = new System.Drawing.Point(0, 0);
33 | this.placeholder1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
34 | this.placeholder1.Name = "placeholder1";
35 | this.placeholder1.Size = new System.Drawing.Size(150, 150);
36 | this.placeholder1.TabIndex = 0;
37 | //
38 | // Venues
39 | //
40 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
41 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
42 | this.Controls.Add(this.placeholder1);
43 | this.Name = "Venues";
44 | this.ResumeLayout(false);
45 |
46 | }
47 |
48 | #endregion
49 |
50 | private Placeholder placeholder1;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/Venues.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Text;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using DevExpress.XtraEditors;
11 |
12 | namespace sample_5_6.DashboardControls {
13 | public partial class Venues : DevExpress.XtraEditors.XtraUserControl {
14 | public Venues() {
15 | InitializeComponent();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/sample_5_6/DashboardControls/Venues.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/sample_5_6/EventView.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6 {
2 | partial class EventView {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.components = new System.ComponentModel.Container();
27 | this.commitChangesItem = new DevExpress.XtraBars.BarButtonItem();
28 | this.discardChangesItem = new DevExpress.XtraBars.BarButtonItem();
29 | this.printExportItem = new DevExpress.XtraBars.BarButtonItem();
30 | this.schedulerStorage = new DevExpress.XtraScheduler.SchedulerStorage(this.components);
31 | this.dayScrollerPanel = new DevExpress.XtraEditors.PanelControl();
32 | this.dayScrollbar = new DevExpress.XtraEditors.HScrollBar();
33 | this.eventCollection = new DevExpress.Xpo.XPCollection(this.components);
34 | this.unitOfWork = new DevExpress.Xpo.UnitOfWork(this.components);
35 | this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
36 | this.customerCollection = new DevExpress.Xpo.XPCollection(this.components);
37 | this.venueCollection = new DevExpress.Xpo.XPCollection(this.components);
38 | this.ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl();
39 | this.ribbonPageCategory1 = new DevExpress.XtraBars.Ribbon.RibbonPageCategory();
40 | this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
41 | this.ribbonPageGroup2 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
42 | this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
43 | ((System.ComponentModel.ISupportInitialize)(this.schedulerStorage)).BeginInit();
44 | ((System.ComponentModel.ISupportInitialize)(this.dayScrollerPanel)).BeginInit();
45 | this.dayScrollerPanel.SuspendLayout();
46 | ((System.ComponentModel.ISupportInitialize)(this.eventCollection)).BeginInit();
47 | ((System.ComponentModel.ISupportInitialize)(this.unitOfWork)).BeginInit();
48 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
49 | this.splitContainerControl1.SuspendLayout();
50 | ((System.ComponentModel.ISupportInitialize)(this.customerCollection)).BeginInit();
51 | ((System.ComponentModel.ISupportInitialize)(this.venueCollection)).BeginInit();
52 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).BeginInit();
53 | this.SuspendLayout();
54 | //
55 | // commitChangesItem
56 | //
57 | this.commitChangesItem.Caption = "Save Changes";
58 | this.commitChangesItem.Id = 0;
59 | this.commitChangesItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.savechanges;
60 | this.commitChangesItem.Name = "commitChangesItem";
61 | //
62 | // discardChangesItem
63 | //
64 | this.discardChangesItem.Caption = "Discard Changes";
65 | this.discardChangesItem.Id = 1;
66 | this.discardChangesItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.discardchanges;
67 | this.discardChangesItem.Name = "discardChangesItem";
68 | //
69 | // printExportItem
70 | //
71 | this.printExportItem.Caption = "Print && Export";
72 | this.printExportItem.Id = 2;
73 | this.printExportItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.printexport;
74 | this.printExportItem.Name = "printExportItem";
75 | //
76 | // schedulerStorage
77 | //
78 | this.schedulerStorage.Appointments.CustomFieldMappings.Add(new DevExpress.XtraScheduler.AppointmentCustomFieldMapping("CustomCapacity", "Capacity", DevExpress.XtraScheduler.FieldValueType.Integer));
79 | this.schedulerStorage.Appointments.CustomFieldMappings.Add(new DevExpress.XtraScheduler.AppointmentCustomFieldMapping("CustomRoomSetup", "RoomSetup"));
80 | this.schedulerStorage.Appointments.Mappings.End = "EndTime";
81 | this.schedulerStorage.Appointments.Mappings.Start = "StartTime";
82 | this.schedulerStorage.Appointments.Mappings.Subject = "Name";
83 | this.schedulerStorage.EnableReminders = false;
84 | //
85 | // dayScrollerPanel
86 | //
87 | this.dayScrollerPanel.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
88 | this.dayScrollerPanel.Controls.Add(this.dayScrollbar);
89 | this.dayScrollerPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
90 | this.dayScrollerPanel.Location = new System.Drawing.Point(0, 51);
91 | this.dayScrollerPanel.Margin = new System.Windows.Forms.Padding(0);
92 | this.dayScrollerPanel.Name = "dayScrollerPanel";
93 | this.dayScrollerPanel.Padding = new System.Windows.Forms.Padding(0, 0, 19, 0);
94 | this.dayScrollerPanel.Size = new System.Drawing.Size(581, 16);
95 | this.dayScrollerPanel.TabIndex = 2;
96 | //
97 | // dayScrollbar
98 | //
99 | this.dayScrollbar.Dock = System.Windows.Forms.DockStyle.Fill;
100 | this.dayScrollbar.LargeChange = 1;
101 | this.dayScrollbar.Location = new System.Drawing.Point(0, 0);
102 | this.dayScrollbar.Margin = new System.Windows.Forms.Padding(0);
103 | this.dayScrollbar.Maximum = 10;
104 | this.dayScrollbar.Name = "dayScrollbar";
105 | this.dayScrollbar.Size = new System.Drawing.Size(562, 16);
106 | this.dayScrollbar.TabIndex = 1;
107 | //
108 | // eventCollection
109 | //
110 | this.eventCollection.ObjectType = typeof(EventsDB.Event);
111 | this.eventCollection.Session = this.unitOfWork;
112 | //
113 | // splitContainerControl1
114 | //
115 | this.splitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill;
116 | this.splitContainerControl1.Horizontal = false;
117 | this.splitContainerControl1.Location = new System.Drawing.Point(0, 150);
118 | this.splitContainerControl1.Name = "splitContainerControl1";
119 | this.splitContainerControl1.Panel1.Text = "Panel1";
120 | this.splitContainerControl1.Panel2.Controls.Add(this.dayScrollerPanel);
121 | this.splitContainerControl1.Panel2.Text = "Panel2";
122 | this.splitContainerControl1.Size = new System.Drawing.Size(581, 200);
123 | this.splitContainerControl1.SplitterPosition = 123;
124 | this.splitContainerControl1.TabIndex = 4;
125 | this.splitContainerControl1.Text = "splitContainerControl1";
126 | //
127 | // customerCollection
128 | //
129 | this.customerCollection.ObjectType = typeof(EventsDB.Customer);
130 | this.customerCollection.Session = this.unitOfWork;
131 | //
132 | // venueCollection
133 | //
134 | this.venueCollection.ObjectType = typeof(EventsDB.Venue);
135 | this.venueCollection.Session = this.unitOfWork;
136 | //
137 | // ribbonControl1
138 | //
139 | this.ribbonControl1.ExpandCollapseItem.Id = 0;
140 | this.ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
141 | this.ribbonControl1.ExpandCollapseItem,
142 | this.ribbonControl1.SearchEditItem,
143 | this.commitChangesItem,
144 | this.discardChangesItem,
145 | this.printExportItem});
146 | this.ribbonControl1.Location = new System.Drawing.Point(0, 0);
147 | this.ribbonControl1.MaxItemId = 1;
148 | this.ribbonControl1.Name = "ribbonControl1";
149 | this.ribbonControl1.PageCategories.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageCategory[] {
150 | this.ribbonPageCategory1});
151 | this.ribbonControl1.Size = new System.Drawing.Size(581, 150);
152 | //
153 | // ribbonPageCategory1
154 | //
155 | this.ribbonPageCategory1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
156 | this.ribbonPageCategory1.Appearance.Options.UseBackColor = true;
157 | this.ribbonPageCategory1.Name = "ribbonPageCategory1";
158 | this.ribbonPageCategory1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
159 | this.ribbonPage1});
160 | this.ribbonPageCategory1.Text = "Events";
161 | //
162 | // ribbonPage1
163 | //
164 | this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
165 | this.ribbonPageGroup2,
166 | this.ribbonPageGroup1});
167 | this.ribbonPage1.Name = "ribbonPage1";
168 | this.ribbonPage1.Text = "Data Operations";
169 | //
170 | // ribbonPageGroup2
171 | //
172 | this.ribbonPageGroup2.ItemLinks.Add(this.commitChangesItem);
173 | this.ribbonPageGroup2.ItemLinks.Add(this.discardChangesItem);
174 | this.ribbonPageGroup2.Name = "ribbonPageGroup2";
175 | this.ribbonPageGroup2.Text = "Persistence";
176 | //
177 | // ribbonPageGroup1
178 | //
179 | this.ribbonPageGroup1.ItemLinks.Add(this.printExportItem, true);
180 | this.ribbonPageGroup1.Name = "ribbonPageGroup1";
181 | this.ribbonPageGroup1.Text = "Tools";
182 | //
183 | // EventsView
184 | //
185 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
186 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
187 | this.Controls.Add(this.splitContainerControl1);
188 | this.Controls.Add(this.ribbonControl1);
189 | this.Name = "EventsView";
190 | this.Size = new System.Drawing.Size(581, 350);
191 | this.Load += new System.EventHandler(this.EventView_Load);
192 | ((System.ComponentModel.ISupportInitialize)(this.schedulerStorage)).EndInit();
193 | ((System.ComponentModel.ISupportInitialize)(this.dayScrollerPanel)).EndInit();
194 | this.dayScrollerPanel.ResumeLayout(false);
195 | ((System.ComponentModel.ISupportInitialize)(this.eventCollection)).EndInit();
196 | ((System.ComponentModel.ISupportInitialize)(this.unitOfWork)).EndInit();
197 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
198 | this.splitContainerControl1.ResumeLayout(false);
199 | ((System.ComponentModel.ISupportInitialize)(this.customerCollection)).EndInit();
200 | ((System.ComponentModel.ISupportInitialize)(this.venueCollection)).EndInit();
201 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).EndInit();
202 | this.ResumeLayout(false);
203 | this.PerformLayout();
204 |
205 | }
206 |
207 | #endregion
208 |
209 | private DevExpress.XtraScheduler.SchedulerStorage schedulerStorage;
210 | private DevExpress.Xpo.XPCollection eventCollection;
211 | private DevExpress.Xpo.UnitOfWork unitOfWork;
212 | private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
213 | private DevExpress.Xpo.XPCollection customerCollection;
214 | private DevExpress.Xpo.XPCollection venueCollection;
215 | private DevExpress.XtraBars.BarButtonItem commitChangesItem;
216 | private DevExpress.XtraBars.BarButtonItem discardChangesItem;
217 | private DevExpress.XtraEditors.HScrollBar dayScrollbar;
218 | private DevExpress.XtraEditors.PanelControl dayScrollerPanel;
219 | private DevExpress.XtraBars.BarButtonItem printExportItem;
220 | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1;
221 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1;
222 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1;
223 | private DevExpress.XtraBars.Ribbon.RibbonPageCategory ribbonPageCategory1;
224 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup2;
225 | }
226 | }
--------------------------------------------------------------------------------
/sample_5_6/EventView.cs:
--------------------------------------------------------------------------------
1 | using DevExpress.XtraEditors;
2 | using EventsDB;
3 | using DevExpress.XtraBars.Docking2010;
4 |
5 | namespace sample_5_6 {
6 | public partial class EventView : XtraUserControl {
7 | public EventView() {
8 | InitializeComponent();
9 | }
10 |
11 | private void EventView_Load(object sender, System.EventArgs e) {
12 | TransactionalChangeHandler.Hookup(
13 | DocumentManager.FromControl(ParentForm).View, unitOfWork, commitChangesItem,
14 | discardChangesItem, eventCollection);
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/sample_5_6/EventView.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 271, 17
125 |
126 |
127 | 401, 16
128 |
129 |
130 | 509, 16
131 |
132 |
133 | 659, 16
134 |
135 |
--------------------------------------------------------------------------------
/sample_5_6/MainForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6 {
2 | partial class MainForm {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.components = new System.ComponentModel.Container();
27 | this.ribbon = new DevExpress.XtraBars.Ribbon.RibbonControl();
28 | this.backstageViewControl1 = new DevExpress.XtraBars.Ribbon.BackstageViewControl();
29 | this.exitItem = new DevExpress.XtraBars.Ribbon.BackstageViewButtonItem();
30 | this.dashboardItem = new DevExpress.XtraBars.BarButtonItem();
31 | this.customersItem = new DevExpress.XtraBars.BarButtonItem();
32 | this.eventsItem = new DevExpress.XtraBars.BarButtonItem();
33 | this.roomBookingsItem = new DevExpress.XtraBars.BarButtonItem();
34 | this.pivotOverviewItem = new DevExpress.XtraBars.BarButtonItem();
35 | this.roomBookingReportItem = new DevExpress.XtraBars.BarButtonItem();
36 | this.barStaticItem1 = new DevExpress.XtraBars.BarStaticItem();
37 | this.skinRibbonGalleryBarItem1 = new DevExpress.XtraBars.SkinRibbonGalleryBarItem();
38 | this.skinPaletteRibbonGalleryBarItem1 = new DevExpress.XtraBars.SkinPaletteRibbonGalleryBarItem();
39 | this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
40 | this.ribbonPageGroup3 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
41 | this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
42 | this.ribbonPageGroup2 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
43 | this.ribbonPage2 = new DevExpress.XtraBars.Ribbon.RibbonPage();
44 | this.ribbonPageGroup4 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
45 | this.ribbonStatusBar1 = new DevExpress.XtraBars.Ribbon.RibbonStatusBar();
46 | this.documentManager1 = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
47 | this.tabbedView = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(this.components);
48 | ((System.ComponentModel.ISupportInitialize)(this.ribbon)).BeginInit();
49 | ((System.ComponentModel.ISupportInitialize)(this.backstageViewControl1)).BeginInit();
50 | ((System.ComponentModel.ISupportInitialize)(this.documentManager1)).BeginInit();
51 | ((System.ComponentModel.ISupportInitialize)(this.tabbedView)).BeginInit();
52 | this.SuspendLayout();
53 | //
54 | // ribbon
55 | //
56 | this.ribbon.ApplicationButtonDropDownControl = this.backstageViewControl1;
57 | this.ribbon.ExpandCollapseItem.Id = 0;
58 | this.ribbon.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
59 | this.ribbon.ExpandCollapseItem,
60 | this.ribbon.SearchEditItem,
61 | this.dashboardItem,
62 | this.customersItem,
63 | this.eventsItem,
64 | this.roomBookingsItem,
65 | this.pivotOverviewItem,
66 | this.roomBookingReportItem,
67 | this.barStaticItem1,
68 | this.skinRibbonGalleryBarItem1,
69 | this.skinPaletteRibbonGalleryBarItem1});
70 | this.ribbon.Location = new System.Drawing.Point(0, 0);
71 | this.ribbon.MaxItemId = 11;
72 | this.ribbon.MdiMergeStyle = DevExpress.XtraBars.Ribbon.RibbonMdiMergeStyle.Always;
73 | this.ribbon.Name = "ribbon";
74 | this.ribbon.OptionsPageCategories.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageCategoryAlignment.Right;
75 | this.ribbon.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
76 | this.ribbonPage1,
77 | this.ribbonPage2});
78 | this.ribbon.Size = new System.Drawing.Size(934, 158);
79 | this.ribbon.StatusBar = this.ribbonStatusBar1;
80 | this.ribbon.Merge += new DevExpress.XtraBars.Ribbon.RibbonMergeEventHandler(this.ribbon_Merge);
81 | //
82 | // backstageViewControl1
83 | //
84 | this.backstageViewControl1.Items.Add(this.exitItem);
85 | this.backstageViewControl1.Location = new System.Drawing.Point(346, 238);
86 | this.backstageViewControl1.Name = "backstageViewControl1";
87 | this.backstageViewControl1.OwnerControl = this.ribbon;
88 | this.backstageViewControl1.Size = new System.Drawing.Size(480, 150);
89 | this.backstageViewControl1.TabIndex = 10;
90 | this.backstageViewControl1.VisibleInDesignTime = true;
91 | //
92 | // exitItem
93 | //
94 | this.exitItem.Caption = "Exit";
95 | this.exitItem.Name = "exitItem";
96 | this.exitItem.ItemClick += new DevExpress.XtraBars.Ribbon.BackstageViewItemEventHandler(this.exitItem_ItemClick);
97 | //
98 | // dashboardItem
99 | //
100 | this.dashboardItem.Caption = "Dashboard";
101 | this.dashboardItem.Id = 1;
102 | this.dashboardItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.dashboard;
103 | this.dashboardItem.Name = "dashboardItem";
104 | //
105 | // customersItem
106 | //
107 | this.customersItem.Caption = "Customers";
108 | this.customersItem.Id = 2;
109 | this.customersItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.customers;
110 | this.customersItem.Name = "customersItem";
111 | //
112 | // eventsItem
113 | //
114 | this.eventsItem.Caption = "Events";
115 | this.eventsItem.Id = 4;
116 | this.eventsItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources._event;
117 | this.eventsItem.Name = "eventsItem";
118 | //
119 | // roomBookingsItem
120 | //
121 | this.roomBookingsItem.Caption = "Room Bookings";
122 | this.roomBookingsItem.Id = 5;
123 | this.roomBookingsItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.roombooking_alt;
124 | this.roomBookingsItem.Name = "roomBookingsItem";
125 | //
126 | // pivotOverviewItem
127 | //
128 | this.pivotOverviewItem.Caption = "Pivot Overview";
129 | this.pivotOverviewItem.Id = 6;
130 | this.pivotOverviewItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.pivotoverview;
131 | this.pivotOverviewItem.Name = "pivotOverviewItem";
132 | //
133 | // roomBookingReportItem
134 | //
135 | this.roomBookingReportItem.Caption = "Room Booking Report";
136 | this.roomBookingReportItem.Id = 7;
137 | this.roomBookingReportItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.report;
138 | this.roomBookingReportItem.Name = "roomBookingReportItem";
139 | //
140 | // barStaticItem1
141 | //
142 | this.barStaticItem1.Caption = "Ready";
143 | this.barStaticItem1.Id = 8;
144 | this.barStaticItem1.Name = "barStaticItem1";
145 | //
146 | // skinRibbonGalleryBarItem1
147 | //
148 | this.skinRibbonGalleryBarItem1.Caption = "skinRibbonGalleryBarItem1";
149 | this.skinRibbonGalleryBarItem1.Id = 9;
150 | this.skinRibbonGalleryBarItem1.Name = "skinRibbonGalleryBarItem1";
151 | //
152 | // skinPaletteRibbonGalleryBarItem1
153 | //
154 | this.skinPaletteRibbonGalleryBarItem1.Caption = "skinPaletteRibbonGalleryBarItem1";
155 | this.skinPaletteRibbonGalleryBarItem1.Id = 10;
156 | this.skinPaletteRibbonGalleryBarItem1.Name = "skinPaletteRibbonGalleryBarItem1";
157 | //
158 | // ribbonPage1
159 | //
160 | this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
161 | this.ribbonPageGroup3,
162 | this.ribbonPageGroup1,
163 | this.ribbonPageGroup2});
164 | this.ribbonPage1.Name = "ribbonPage1";
165 | this.ribbonPage1.Text = "Navigation";
166 | //
167 | // ribbonPageGroup3
168 | //
169 | this.ribbonPageGroup3.ItemLinks.Add(this.dashboardItem);
170 | this.ribbonPageGroup3.Name = "ribbonPageGroup3";
171 | this.ribbonPageGroup3.Text = "Global";
172 | //
173 | // ribbonPageGroup1
174 | //
175 | this.ribbonPageGroup1.ItemLinks.Add(this.customersItem);
176 | this.ribbonPageGroup1.ItemLinks.Add(this.eventsItem);
177 | this.ribbonPageGroup1.ItemLinks.Add(this.roomBookingsItem);
178 | this.ribbonPageGroup1.Name = "ribbonPageGroup1";
179 | this.ribbonPageGroup1.Text = "Data";
180 | //
181 | // ribbonPageGroup2
182 | //
183 | this.ribbonPageGroup2.ItemLinks.Add(this.pivotOverviewItem);
184 | this.ribbonPageGroup2.ItemLinks.Add(this.roomBookingReportItem);
185 | this.ribbonPageGroup2.Name = "ribbonPageGroup2";
186 | this.ribbonPageGroup2.Text = "Data Analysis";
187 | //
188 | // ribbonPage2
189 | //
190 | this.ribbonPage2.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
191 | this.ribbonPageGroup4});
192 | this.ribbonPage2.Name = "ribbonPage2";
193 | this.ribbonPage2.Text = "Style";
194 | //
195 | // ribbonPageGroup4
196 | //
197 | this.ribbonPageGroup4.ItemLinks.Add(this.skinRibbonGalleryBarItem1);
198 | this.ribbonPageGroup4.ItemLinks.Add(this.skinPaletteRibbonGalleryBarItem1);
199 | this.ribbonPageGroup4.Name = "ribbonPageGroup4";
200 | this.ribbonPageGroup4.Text = "Skins";
201 | //
202 | // ribbonStatusBar1
203 | //
204 | this.ribbonStatusBar1.ItemLinks.Add(this.barStaticItem1);
205 | this.ribbonStatusBar1.Location = new System.Drawing.Point(0, 657);
206 | this.ribbonStatusBar1.Name = "ribbonStatusBar1";
207 | this.ribbonStatusBar1.Ribbon = this.ribbon;
208 | this.ribbonStatusBar1.Size = new System.Drawing.Size(934, 24);
209 | //
210 | // documentManager1
211 | //
212 | this.documentManager1.MdiParent = this;
213 | this.documentManager1.MenuManager = this.ribbon;
214 | this.documentManager1.RibbonAndBarsMergeStyle = DevExpress.XtraBars.Docking2010.Views.RibbonAndBarsMergeStyle.Always;
215 | this.documentManager1.View = this.tabbedView;
216 | this.documentManager1.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {
217 | this.tabbedView});
218 | //
219 | // tabbedView
220 | //
221 | this.tabbedView.QueryControl += new DevExpress.XtraBars.Docking2010.Views.QueryControlEventHandler(this.tabbedView_QueryControl);
222 | //
223 | // MainForm
224 | //
225 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
226 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
227 | this.ClientSize = new System.Drawing.Size(934, 681);
228 | this.Controls.Add(this.ribbonStatusBar1);
229 | this.Controls.Add(this.backstageViewControl1);
230 | this.Controls.Add(this.ribbon);
231 | this.IsMdiContainer = true;
232 | this.Name = "MainForm";
233 | this.Ribbon = this.ribbon;
234 | this.StatusBar = this.ribbonStatusBar1;
235 | this.Text = "Event Management";
236 | this.Load += new System.EventHandler(this.MainForm_Load);
237 | ((System.ComponentModel.ISupportInitialize)(this.ribbon)).EndInit();
238 | ((System.ComponentModel.ISupportInitialize)(this.backstageViewControl1)).EndInit();
239 | ((System.ComponentModel.ISupportInitialize)(this.documentManager1)).EndInit();
240 | ((System.ComponentModel.ISupportInitialize)(this.tabbedView)).EndInit();
241 | this.ResumeLayout(false);
242 | this.PerformLayout();
243 |
244 | }
245 |
246 | #endregion
247 | private DevExpress.XtraBars.Ribbon.RibbonControl ribbon;
248 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1;
249 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1;
250 | private DevExpress.XtraBars.Ribbon.RibbonStatusBar ribbonStatusBar1;
251 | private DevExpress.XtraBars.Ribbon.BackstageViewControl backstageViewControl1;
252 | private DevExpress.XtraBars.Ribbon.BackstageViewButtonItem exitItem;
253 | private DevExpress.XtraBars.BarButtonItem dashboardItem;
254 | private DevExpress.XtraBars.BarButtonItem customersItem;
255 | private DevExpress.XtraBars.BarButtonItem eventsItem;
256 | private DevExpress.XtraBars.BarButtonItem roomBookingsItem;
257 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup3;
258 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup2;
259 | private DevExpress.XtraBars.BarButtonItem pivotOverviewItem;
260 | private DevExpress.XtraBars.BarButtonItem roomBookingReportItem;
261 | private DevExpress.XtraBars.BarStaticItem barStaticItem1;
262 | private DevExpress.XtraBars.Docking2010.DocumentManager documentManager1;
263 | private DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView tabbedView;
264 | private DevExpress.XtraBars.SkinRibbonGalleryBarItem skinRibbonGalleryBarItem1;
265 | private DevExpress.XtraBars.SkinPaletteRibbonGalleryBarItem skinPaletteRibbonGalleryBarItem1;
266 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage2;
267 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup4;
268 | }
269 | }
270 |
271 |
--------------------------------------------------------------------------------
/sample_5_6/MainForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using DevExpress.XtraBars;
10 | using DevExpress.XtraBars.Docking2010.Views;
11 |
12 | namespace sample_5_6 {
13 | public partial class MainForm : DevExpress.XtraBars.Ribbon.RibbonForm {
14 | public MainForm() {
15 | InitializeComponent();
16 | }
17 |
18 | private void MainForm_Load(object sender, EventArgs e) {
19 | var buttonViews = new Dictionary {
20 | { dashboardItem, ShowOrActivate("Dashboard") },
21 | { customersItem, ShowOrActivate("Customers") },
22 | { eventsItem, ShowOrActivate("Events") },
23 | { roomBookingsItem, ShowOrActivate("Room Bookings") },
24 | { pivotOverviewItem, ShowOrActivate("Pivot Overview") }
25 | };
26 |
27 | foreach (var barItem in buttonViews.Keys) {
28 | barItem.ItemClick += (s, ev) => {
29 | buttonViews[barItem]();
30 | };
31 | }
32 | }
33 |
34 | delegate BaseDocument ShowOrActivateDelegate(Action initDocument = null);
35 |
36 | ShowOrActivateDelegate ShowOrActivate(string caption) =>
37 | (Action initDocument) => {
38 | var controlName = typeof(T).Name;
39 | var doc = tabbedView.Documents.FirstOrDefault(d => d.ControlName == controlName && d.Caption == caption);
40 | if (doc == null) {
41 | doc = tabbedView.AddDocument(caption, controlName);
42 | initDocument?.Invoke(doc);
43 | }
44 | if (doc != null)
45 | tabbedView.Controller.Activate(doc);
46 | return doc;
47 | };
48 |
49 | private void tabbedView_QueryControl(object sender, QueryControlEventArgs e) {
50 | e.Control = e.Document.ControlName switch
51 | {
52 | "Dashboard" => new Dashboard(),
53 | "CustomerList" => new CustomerList(),
54 | "EventView" => new EventView(),
55 | "RoomBookingView" => new RoomBookingView(),
56 | "PivotOverview" => new PivotOverview(),
57 | _ => new Control()
58 | };
59 | }
60 |
61 | private void exitItem_ItemClick(object sender, DevExpress.XtraBars.Ribbon.BackstageViewItemEventArgs e) {
62 | Close();
63 | }
64 |
65 | private void ribbon_Merge(object sender, DevExpress.XtraBars.Ribbon.RibbonMergeEventArgs e) {
66 | if (e.MergeOwner.MergedCategories.Count > 0) {
67 | var page = e.MergeOwner.MergedCategories[0].Pages[0];
68 | if (page != null)
69 | ribbon.SelectedPage = page;
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/sample_5_6/MainForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 71
125 |
126 |
--------------------------------------------------------------------------------
/sample_5_6/PivotOverview.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6 {
2 | partial class PivotOverview {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.components = new System.ComponentModel.Container();
27 | this.roomBookingCollection = new DevExpress.Xpo.XPCollection(this.components);
28 | this.session = new DevExpress.Xpo.Session(this.components);
29 | this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
30 | this.printExportItem = new DevExpress.XtraBars.BarButtonItem();
31 | this.ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl();
32 | this.ribbonPageCategory1 = new DevExpress.XtraBars.Ribbon.RibbonPageCategory();
33 | this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
34 | this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
35 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingCollection)).BeginInit();
36 | ((System.ComponentModel.ISupportInitialize)(this.session)).BeginInit();
37 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
38 | this.splitContainerControl1.SuspendLayout();
39 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).BeginInit();
40 | this.SuspendLayout();
41 | //
42 | // roomBookingCollection
43 | //
44 | this.roomBookingCollection.ObjectType = typeof(EventsDB.RoomBooking);
45 | this.roomBookingCollection.Session = this.session;
46 | //
47 | // splitContainerControl1
48 | //
49 | this.splitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill;
50 | this.splitContainerControl1.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2;
51 | this.splitContainerControl1.Horizontal = false;
52 | this.splitContainerControl1.Location = new System.Drawing.Point(0, 150);
53 | this.splitContainerControl1.Name = "splitContainerControl1";
54 | this.splitContainerControl1.Panel1.Text = "Panel1";
55 | this.splitContainerControl1.Panel2.Text = "Panel2";
56 | this.splitContainerControl1.Size = new System.Drawing.Size(701, 237);
57 | this.splitContainerControl1.SplitterPosition = 156;
58 | this.splitContainerControl1.TabIndex = 1;
59 | this.splitContainerControl1.Text = "splitContainerControl1";
60 | //
61 | // printExportItem
62 | //
63 | this.printExportItem.Caption = "Print && Export";
64 | this.printExportItem.Id = 0;
65 | this.printExportItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.printexport;
66 | this.printExportItem.Name = "printExportItem";
67 | //
68 | // ribbonControl1
69 | //
70 | this.ribbonControl1.ExpandCollapseItem.Id = 0;
71 | this.ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
72 | this.ribbonControl1.ExpandCollapseItem,
73 | this.printExportItem,
74 | this.ribbonControl1.SearchEditItem});
75 | this.ribbonControl1.Location = new System.Drawing.Point(0, 0);
76 | this.ribbonControl1.MaxItemId = 1;
77 | this.ribbonControl1.Name = "ribbonControl1";
78 | this.ribbonControl1.PageCategories.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageCategory[] {
79 | this.ribbonPageCategory1});
80 | this.ribbonControl1.Size = new System.Drawing.Size(701, 150);
81 | //
82 | // ribbonPageCategory1
83 | //
84 | this.ribbonPageCategory1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
85 | this.ribbonPageCategory1.Appearance.Options.UseBackColor = true;
86 | this.ribbonPageCategory1.Name = "ribbonPageCategory1";
87 | this.ribbonPageCategory1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
88 | this.ribbonPage1});
89 | this.ribbonPageCategory1.Text = "Pivot Overview";
90 | //
91 | // ribbonPage1
92 | //
93 | this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
94 | this.ribbonPageGroup1});
95 | this.ribbonPage1.Name = "ribbonPage1";
96 | this.ribbonPage1.Text = "Data Operations";
97 | //
98 | // ribbonPageGroup1
99 | //
100 | this.ribbonPageGroup1.ItemLinks.Add(this.printExportItem);
101 | this.ribbonPageGroup1.Name = "ribbonPageGroup1";
102 | this.ribbonPageGroup1.Text = "Tools";
103 | //
104 | // PivotOverview
105 | //
106 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
107 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
108 | this.Controls.Add(this.splitContainerControl1);
109 | this.Controls.Add(this.ribbonControl1);
110 | this.Name = "PivotOverview";
111 | this.Size = new System.Drawing.Size(701, 387);
112 | ((System.ComponentModel.ISupportInitialize)(this.roomBookingCollection)).EndInit();
113 | ((System.ComponentModel.ISupportInitialize)(this.session)).EndInit();
114 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
115 | this.splitContainerControl1.ResumeLayout(false);
116 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).EndInit();
117 | this.ResumeLayout(false);
118 | this.PerformLayout();
119 |
120 | }
121 |
122 | #endregion
123 | private DevExpress.Xpo.Session session;
124 | private DevExpress.Xpo.XPCollection roomBookingCollection;
125 | private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
126 | private DevExpress.XtraBars.BarButtonItem printExportItem;
127 | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1;
128 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1;
129 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1;
130 | private DevExpress.XtraBars.Ribbon.RibbonPageCategory ribbonPageCategory1;
131 | }
132 | }
--------------------------------------------------------------------------------
/sample_5_6/PivotOverview.cs:
--------------------------------------------------------------------------------
1 | using DevExpress.XtraEditors;
2 |
3 | namespace sample_5_6 {
4 | public partial class PivotOverview : XtraUserControl {
5 | public PivotOverview() {
6 | InitializeComponent();
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/sample_5_6/PivotOverview.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 187, 17
125 |
126 |
--------------------------------------------------------------------------------
/sample_5_6/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 | using DevExpress.Skins;
6 | using DevExpress.Xpo;
7 | using DevExpress.Xpo.DB;
8 | using pct.BizRulez;
9 | using EventsDB.Validation;
10 | using pct.BizRulez.Rules;
11 | using EventsDB;
12 | using EventsDB.Populate;
13 |
14 | namespace sample_5_6 {
15 | static class Program {
16 | ///
17 | /// The main entry point for the application.
18 | ///
19 | [STAThread]
20 | static void Main() {
21 | Application.EnableVisualStyles();
22 | Application.SetCompatibleTextRenderingDefault(false);
23 |
24 | SkinManager.EnableMdiFormSkins();
25 |
26 | DemoDatabase.Populate();
27 |
28 | mainForm = new MainForm();
29 | Application.Run(MainForm);
30 | }
31 |
32 | static MainForm mainForm;
33 | public static MainForm MainForm {
34 | get {
35 | return mainForm;
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/sample_5_6/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("sample_5_6")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("sample_5_6")]
13 | [assembly: AssemblyCopyright("Copyright © 2009 - 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("00947cba-0262-4125-98c2-fb9b623e9206")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/sample_5_6/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\dashboard.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
123 |
124 |
125 | ..\Resources\roombooking-alt.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
126 |
127 |
128 | ..\Resources\discardchanges.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
129 |
130 |
131 | ..\Resources\customers.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
132 |
133 |
134 | ..\Resources\report.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
135 |
136 |
137 | ..\Resources\event.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
138 |
139 |
140 | ..\Resources\pivotoverview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
141 |
142 |
143 | ..\Resources\savechanges.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
144 |
145 |
146 | ..\Resources\venue.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
147 |
148 |
149 | ..\Resources\printexport.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.1
150 |
151 |
--------------------------------------------------------------------------------
/sample_5_6/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace sample_5_6.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sample_5_6/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sample_5_6/Properties/licenses.licx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nirzaf/dev_express_final_sample_5_6/1ac17e1192eb56d28c444ff722b885fca4ee0c42/sample_5_6/Properties/licenses.licx
--------------------------------------------------------------------------------
/sample_5_6/Resources/customers.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/dashboard.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/discardchanges.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/event.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/pivotoverview.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/printexport.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/report.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/roombooking-alt.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/savechanges.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/Resources/venue.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample_5_6/RoomBookingView.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace sample_5_6 {
2 | partial class RoomBookingView {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.components = new System.ComponentModel.Container();
27 | this.saveChangesItem = new DevExpress.XtraBars.BarButtonItem();
28 | this.discardChangesItem = new DevExpress.XtraBars.BarButtonItem();
29 | this.unitOfWork = new DevExpress.Xpo.UnitOfWork(this.components);
30 | this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
31 | this.splitContainerControl2 = new DevExpress.XtraEditors.SplitContainerControl();
32 | this.venueCollection = new DevExpress.Xpo.XPCollection(this.components);
33 | this.schedulerStorage = new DevExpress.XtraScheduler.SchedulerStorage(this.components);
34 | this.ribbonControl1 = new DevExpress.XtraBars.Ribbon.RibbonControl();
35 | this.ribbonPageCategory1 = new DevExpress.XtraBars.Ribbon.RibbonPageCategory();
36 | this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
37 | this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
38 | ((System.ComponentModel.ISupportInitialize)(this.unitOfWork)).BeginInit();
39 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
40 | this.splitContainerControl1.SuspendLayout();
41 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl2)).BeginInit();
42 | this.splitContainerControl2.SuspendLayout();
43 | ((System.ComponentModel.ISupportInitialize)(this.venueCollection)).BeginInit();
44 | ((System.ComponentModel.ISupportInitialize)(this.schedulerStorage)).BeginInit();
45 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).BeginInit();
46 | this.SuspendLayout();
47 | //
48 | // saveChangesItem
49 | //
50 | this.saveChangesItem.Caption = "Save Changes";
51 | this.saveChangesItem.Id = 0;
52 | this.saveChangesItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.savechanges;
53 | this.saveChangesItem.Name = "saveChangesItem";
54 | //
55 | // discardChangesItem
56 | //
57 | this.discardChangesItem.Caption = "Discard Changes";
58 | this.discardChangesItem.Id = 1;
59 | this.discardChangesItem.ImageOptions.SvgImage = global::sample_5_6.Properties.Resources.discardchanges;
60 | this.discardChangesItem.Name = "discardChangesItem";
61 | //
62 | // splitContainerControl1
63 | //
64 | this.splitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill;
65 | this.splitContainerControl1.Horizontal = false;
66 | this.splitContainerControl1.Location = new System.Drawing.Point(0, 150);
67 | this.splitContainerControl1.Name = "splitContainerControl1";
68 | this.splitContainerControl1.Panel1.Text = "Panel1";
69 | this.splitContainerControl1.Panel2.Controls.Add(this.splitContainerControl2);
70 | this.splitContainerControl1.Panel2.Text = "Panel2";
71 | this.splitContainerControl1.Size = new System.Drawing.Size(607, 210);
72 | this.splitContainerControl1.SplitterPosition = 95;
73 | this.splitContainerControl1.TabIndex = 4;
74 | this.splitContainerControl1.Text = "splitContainerControl1";
75 | //
76 | // splitContainerControl2
77 | //
78 | this.splitContainerControl2.Dock = System.Windows.Forms.DockStyle.Fill;
79 | this.splitContainerControl2.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2;
80 | this.splitContainerControl2.Location = new System.Drawing.Point(0, 0);
81 | this.splitContainerControl2.Name = "splitContainerControl2";
82 | this.splitContainerControl2.Panel1.Text = "Panel1";
83 | this.splitContainerControl2.Panel2.Text = "Panel2";
84 | this.splitContainerControl2.Size = new System.Drawing.Size(607, 105);
85 | this.splitContainerControl2.SplitterPosition = 178;
86 | this.splitContainerControl2.TabIndex = 0;
87 | this.splitContainerControl2.Text = "splitContainerControl2";
88 | //
89 | // venueCollection
90 | //
91 | this.venueCollection.ObjectType = typeof(EventsDB.Venue);
92 | this.venueCollection.Session = this.unitOfWork;
93 | //
94 | // schedulerStorage
95 | //
96 | this.schedulerStorage.Appointments.CustomFieldMappings.Add(new DevExpress.XtraScheduler.AppointmentCustomFieldMapping("CustomCapReq", "CapacityRequirement!"));
97 | this.schedulerStorage.Appointments.Mappings.End = "EndTime";
98 | this.schedulerStorage.Appointments.Mappings.ResourceId = "Room!Key";
99 | this.schedulerStorage.Appointments.Mappings.Start = "StartTime";
100 | this.schedulerStorage.EnableReminders = false;
101 | this.schedulerStorage.Resources.Mappings.Caption = "Name";
102 | this.schedulerStorage.Resources.Mappings.Id = "Oid";
103 | //
104 | // ribbonControl1
105 | //
106 | this.ribbonControl1.ExpandCollapseItem.Id = 0;
107 | this.ribbonControl1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
108 | this.ribbonControl1.ExpandCollapseItem,
109 | this.ribbonControl1.SearchEditItem,
110 | this.saveChangesItem,
111 | this.discardChangesItem});
112 | this.ribbonControl1.Location = new System.Drawing.Point(0, 0);
113 | this.ribbonControl1.MaxItemId = 1;
114 | this.ribbonControl1.Name = "ribbonControl1";
115 | this.ribbonControl1.PageCategories.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageCategory[] {
116 | this.ribbonPageCategory1});
117 | this.ribbonControl1.Size = new System.Drawing.Size(607, 150);
118 | //
119 | // ribbonPageCategory1
120 | //
121 | this.ribbonPageCategory1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
122 | this.ribbonPageCategory1.Appearance.Options.UseBackColor = true;
123 | this.ribbonPageCategory1.Name = "ribbonPageCategory1";
124 | this.ribbonPageCategory1.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
125 | this.ribbonPage1});
126 | this.ribbonPageCategory1.Text = "Room Bookings";
127 | //
128 | // ribbonPage1
129 | //
130 | this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
131 | this.ribbonPageGroup1});
132 | this.ribbonPage1.Name = "ribbonPage1";
133 | this.ribbonPage1.Text = "Data Operations";
134 | //
135 | // ribbonPageGroup1
136 | //
137 | this.ribbonPageGroup1.ItemLinks.Add(this.saveChangesItem);
138 | this.ribbonPageGroup1.ItemLinks.Add(this.discardChangesItem);
139 | this.ribbonPageGroup1.Name = "ribbonPageGroup1";
140 | this.ribbonPageGroup1.Text = "Persistence";
141 | //
142 | // RoomBookingsView
143 | //
144 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
145 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
146 | this.Controls.Add(this.splitContainerControl1);
147 | this.Controls.Add(this.ribbonControl1);
148 | this.Name = "RoomBookingsView";
149 | this.Size = new System.Drawing.Size(607, 360);
150 | this.Load += new System.EventHandler(this.RoomBookingView_Load);
151 | ((System.ComponentModel.ISupportInitialize)(this.unitOfWork)).EndInit();
152 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
153 | this.splitContainerControl1.ResumeLayout(false);
154 | ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl2)).EndInit();
155 | this.splitContainerControl2.ResumeLayout(false);
156 | ((System.ComponentModel.ISupportInitialize)(this.venueCollection)).EndInit();
157 | ((System.ComponentModel.ISupportInitialize)(this.schedulerStorage)).EndInit();
158 | ((System.ComponentModel.ISupportInitialize)(this.ribbonControl1)).EndInit();
159 | this.ResumeLayout(false);
160 | this.PerformLayout();
161 |
162 | }
163 |
164 | #endregion
165 | private DevExpress.Xpo.UnitOfWork unitOfWork;
166 | private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
167 | private DevExpress.Xpo.XPCollection venueCollection;
168 | private DevExpress.XtraBars.BarButtonItem saveChangesItem;
169 | private DevExpress.XtraBars.BarButtonItem discardChangesItem;
170 | private DevExpress.XtraEditors.SplitContainerControl splitContainerControl2;
171 | private DevExpress.XtraScheduler.SchedulerStorage schedulerStorage;
172 | private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl1;
173 | private DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage1;
174 | private DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup1;
175 | private DevExpress.XtraBars.Ribbon.RibbonPageCategory ribbonPageCategory1;
176 | }
177 | }
--------------------------------------------------------------------------------
/sample_5_6/RoomBookingView.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Windows.Forms;
3 | using DevExpress.XtraEditors;
4 | using DevExpress.Xpo;
5 | using EventsDB;
6 | using System.Collections.Generic;
7 | using EventsDB.Populate;
8 | using DevExpress.XtraBars.Docking2010;
9 | using DevExpress.XtraBars.Docking2010.Views;
10 |
11 | namespace sample_5_6 {
12 | public partial class RoomBookingView : XtraUserControl {
13 | public RoomBookingView() {
14 | InitializeComponent();
15 | }
16 |
17 | private void RoomBookingView_Load(object sender, System.EventArgs e) {
18 | TransactionalChangeHandler.Hookup(
19 | DocumentManager.FromControl(ParentForm).View, unitOfWork, saveChangesItem,
20 | discardChangesItem, null, null, null, null, null, null,
21 | RoomBookingView_Closing,
22 | saveChangesItem_ItemClick,
23 | discardChangesItem_ItemClick);
24 | }
25 |
26 | #region Change Handling
27 | private void saveChangesItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
28 | // use my own ValidateAndCommit
29 | ValidateAndCommit();
30 | }
31 |
32 | private bool ValidateAndCommit() {
33 | var checkables = TransactionalChangeHandler.GetCheckables(unitOfWork);
34 | if (TransactionalChangeHandler.Validate(checkables) == false)
35 | return false;
36 |
37 | var relatedRooms = checkables.
38 | OfType().
39 | Where(rb => rb.Room != null).
40 | Select(rb => rb.Room);
41 |
42 | var relatedRoomResults = DemoDatabase.BizRulezChecker.Check("save", relatedRooms).ToList();
43 | if (relatedRoomResults.Count > 0) {
44 | XtraMessageBox.Show("There have been errors during data validation.");
45 | return false;
46 | }
47 |
48 | unitOfWork.CommitChanges();
49 | return true;
50 | }
51 |
52 | private void RoomBookingView_Closing(object sender, DocumentCancelEventArgs e) {
53 | if (TransactionalChangeHandler.ObjectsToSave(unitOfWork)) {
54 | var answer = XtraMessageBox.Show("There are unsaved changes. Do you want to validate and save before closing the list?", "Question",
55 | MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
56 | if (answer == DialogResult.Yes) {
57 | // use my own ValidateAndCommit
58 | if (!ValidateAndCommit())
59 | e.Cancel = true;
60 | }
61 | else if (answer == DialogResult.Cancel)
62 | e.Cancel = true;
63 | }
64 | }
65 |
66 | private void discardChangesItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
67 | if (TransactionalChangeHandler.ObjectsToSave(unitOfWork)) {
68 | if (XtraMessageBox.Show("This operation is going to discard all unsaved changes. Are you sure you want to proceed?", "Question",
69 | MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) {
70 | //scheduler.BeginUpdate();
71 | try {
72 | // Use my own DiscardChanges
73 | DiscardChanges(unitOfWork, null);
74 | }
75 | finally {
76 | //scheduler.EndUpdate();
77 | }
78 | }
79 | }
80 | }
81 |
82 | public void DiscardChanges(UnitOfWork unitOfWork, XPBaseCollection collection) {
83 | var deletedTLObjects = TransactionalChangeHandler.GetDeletedTLObjects(unitOfWork);
84 |
85 | foreach (var newObject in TransactionalChangeHandler.GetSavedNewObjects(unitOfWork)) {
86 | TransactionalChangeHandler.ResetAssociations(newObject);
87 |
88 | // special behavior for this form
89 | if (newObject is RoomBooking) {
90 | // remove the appointment from the collection, this doesn't
91 | // happen automatically
92 | var appt = schedulerStorage.Appointments.Items.Find(
93 | a => object.ReferenceEquals(a.GetRow(schedulerStorage), newObject));
94 | schedulerStorage.Appointments.Remove(appt);
95 | }
96 | }
97 |
98 | unitOfWork.ReloadChangedObjects();
99 |
100 | // special behavior: get the right collection first
101 | var roomBookingCollection = (IList)schedulerStorage.Appointments.DataSource;
102 | foreach (var item in deletedTLObjects)
103 | roomBookingCollection.Add(item);
104 | }
105 |
106 |
107 | #endregion
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/sample_5_6/RoomBookingView.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 251, 17
122 |
123 |
124 | 359, 17
125 |
126 |
127 | 494, 17
128 |
129 |
--------------------------------------------------------------------------------
/sample_5_6/TransactionalChangeHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Windows.Forms;
4 | using DevExpress.Xpo;
5 | using DevExpress.XtraBars;
6 | using DevExpress.XtraEditors;
7 | using DevExpress.Xpo.Metadata;
8 | using System.Collections.Generic;
9 | using EventsDB;
10 | using EventsDB.Populate;
11 | using DevExpress.XtraBars.Docking2010.Views;
12 |
13 | namespace sample_5_6 {
14 | public static class TransactionalChangeHandler {
15 | public static void Hookup(BaseView view, UnitOfWork unitOfWork, BarButtonItem saveChangesItem, BarButtonItem discardChangesItem, XPBaseCollection topLevelCollection)
16 | where T : class {
17 | Hookup(view, unitOfWork, saveChangesItem, discardChangesItem, topLevelCollection,
18 | null, null, null, null, null, null, null, null);
19 | }
20 | public static void Hookup(BaseView view, UnitOfWork unitOfWork,
21 | BarButtonItem saveChangesItem, BarButtonItem discardChangesItem,
22 | XPBaseCollection topLevelCollection,
23 | SessionManipulationEventHandler afterCommitTransactionEventHandler,
24 | SessionManipulationEventHandler afterRollbackTransactionEventHandler,
25 | ObjectChangeEventHandler objectChangedEventHandler,
26 | ObjectManipulationEventHandler objectDeletedEventHandler,
27 | ObjectManipulationEventHandler objectSavedEventHandler,
28 | DocumentCancelEventHandler documentClosingHandler,
29 | ItemClickEventHandler saveChangesItemClickEventHandler,
30 | ItemClickEventHandler discardChangesItemClickEventHandler)
31 | where T : class {
32 | var container = new TransactionalChangeEventHandlerContainer(
33 | view, unitOfWork, saveChangesItem,
34 | discardChangesItem, topLevelCollection
35 | );
36 |
37 | unitOfWork.AfterCommitTransaction +=
38 | afterCommitTransactionEventHandler ??
39 | container.SessionManipulationHandler;
40 | unitOfWork.AfterRollbackTransaction +=
41 | afterRollbackTransactionEventHandler ??
42 | container.SessionManipulationHandler;
43 | unitOfWork.ObjectChanged +=
44 | objectChangedEventHandler ?? container.ObjectChangeHandler;
45 | unitOfWork.ObjectDeleted +=
46 | objectDeletedEventHandler ??
47 | container.ObjectManipulationHandler;
48 | unitOfWork.ObjectSaved +=
49 | objectSavedEventHandler ?? container.ObjectManipulationHandler;
50 |
51 | view.DocumentClosing +=
52 | documentClosingHandler ?? container.DocumentClosingHandler;
53 |
54 | saveChangesItem.ItemClick +=
55 | saveChangesItemClickEventHandler ??
56 | container.SaveChangesItemClickHandler;
57 | discardChangesItem.ItemClick +=
58 | discardChangesItemClickEventHandler ??
59 | container.DiscardChangesItemClickHandler;
60 | }
61 |
62 | public static IEnumerable GetCheckables(UnitOfWork unitOfWork) {
63 | var savedObjects = unitOfWork.GetObjectsToSave();
64 | var checkables = savedObjects.Cast().Where(o => !o.IsDeleted);
65 | return checkables;
66 | }
67 |
68 | public static bool Validate(IEnumerable checkables) {
69 | var results = DemoDatabase.BizRulezChecker.Check("save", checkables).ToList();
70 | if (results.Count > 0) {
71 | XtraMessageBox.Show("There have been errors during data validation.");
72 | return false;
73 | }
74 | return true;
75 | }
76 |
77 | public static bool ValidateAndCommit(UnitOfWork unitOfWork) {
78 | if (Validate(GetCheckables(unitOfWork))) {
79 | unitOfWork.CommitChanges();
80 | return true;
81 | }
82 |
83 | return false;
84 | }
85 |
86 | public static bool ObjectsToSave(UnitOfWork unitOfWork) {
87 | return unitOfWork.GetObjectsToSave().Count > 0 ||
88 | unitOfWork.GetObjectsToDelete().Count > 0;
89 | }
90 |
91 | public static List GetDeletedTLObjects(UnitOfWork unitOfWork)
92 | where T : class {
93 | return unitOfWork.GetObjectsToDelete().Cast().
94 | OfType().ToList();
95 | }
96 |
97 | public static IEnumerable GetSavedNewObjects(UnitOfWork unitOfWork) {
98 | return unitOfWork.GetObjectsToSave().Cast().
99 | Where(o => unitOfWork.IsNewObject(o));
100 | }
101 |
102 | public static void ResetAssociations(XPBaseObject newObject) {
103 | foreach (var member in newObject.ClassInfo.ObjectProperties.
104 | Cast().
105 | Where(mi => mi.IsAssociation)) {
106 | member.SetValue(newObject, null);
107 | }
108 | }
109 |
110 | public static void RemoveTLObjects(XPBaseCollection collection, XPBaseObject ob)
111 | where T : class {
112 | var obAsT = ob as T;
113 | if (obAsT != null)
114 | collection.BaseRemove(ob);
115 | }
116 |
117 | public static void DiscardChanges(UnitOfWork unitOfWork, XPBaseCollection collection) where T : class {
118 | // remember which top-level objects were going to be deleted
119 | // so we can restore them back into the UI collection
120 | var deletedTLObjects = GetDeletedTLObjects(unitOfWork);
121 |
122 | // as long as the unit of work hasn't been committed, the newly added
123 | // objects are recognized by the IsNewObject method
124 | // for the elements that had been added, find their association
125 | // properties and set their values to null, so that they are
126 | // removed from the collections they had been added to
127 | foreach (var newObject in GetSavedNewObjects(unitOfWork)) {
128 | ResetAssociations(newObject);
129 | RemoveTLObjects(collection, newObject);
130 | }
131 |
132 | unitOfWork.ReloadChangedObjects();
133 |
134 | // add the deleted objects back into the top level collection
135 | collection.BaseAddRange(deletedTLObjects);
136 | }
137 |
138 |
139 | private class TransactionalChangeEventHandlerContainer where T : class {
140 | BaseView view;
141 | UnitOfWork unitOfWork;
142 | BarButtonItem saveChangesItem;
143 | BarButtonItem discardChangesItem;
144 | XPBaseCollection topLevelCollection;
145 |
146 | public TransactionalChangeEventHandlerContainer(BaseView view, UnitOfWork unitOfWork,
147 | BarButtonItem saveChangesItem, BarButtonItem discardChangesItem,
148 | XPBaseCollection topLevelCollection) {
149 | this.view = view;
150 | this.unitOfWork = unitOfWork;
151 | this.saveChangesItem = saveChangesItem;
152 | this.discardChangesItem = discardChangesItem;
153 | this.topLevelCollection = topLevelCollection;
154 |
155 | this.unitOfWork.TrackPropertiesModifications = true;
156 |
157 | EvalTransactionState();
158 | }
159 |
160 | public void ObjectManipulationHandler(object sender, ObjectManipulationEventArgs e) {
161 | EvalTransactionState();
162 | }
163 |
164 | public void SessionManipulationHandler(object sender, SessionManipulationEventArgs e) {
165 | EvalTransactionState();
166 | }
167 |
168 | void RemoveFromObjectToSaveIfNeeded(Session session, object o) {
169 | if (session.TrackPropertiesModifications && (session.IsObjectToSave(o) || session.IsObjectToDelete(o))) {
170 | var classInfo = session.GetClassInfo(o);
171 |
172 | if (classInfo.HasModifications(o)) {
173 | foreach (XPMemberInfo property in classInfo.PersistentProperties) {
174 | if (property.GetModified(o)) {
175 | if (!object.Equals(property.GetOldValue(o), property.GetValue(o))) {
176 | return;
177 | }
178 | }
179 | }
180 | }
181 | session.RemoveFromLists(o);
182 | if (session.GetObjectsToSave().Count == 0 && session.GetObjectsToDelete().Count == 0) {
183 | session.DropChanges();
184 | }
185 | }
186 | }
187 |
188 | public void ObjectChangeHandler(object sender, ObjectChangeEventArgs e) {
189 | if (e.Reason == ObjectChangeReason.CancelEdit)
190 | RemoveFromObjectToSaveIfNeeded(unitOfWork, e.Object);
191 | EvalTransactionState();
192 | }
193 |
194 | void EvalTransactionState() {
195 | var objectsToSave = TransactionalChangeHandler.ObjectsToSave(unitOfWork);
196 | saveChangesItem.Enabled =
197 | discardChangesItem.Enabled = objectsToSave;
198 | }
199 |
200 | public void DocumentClosingHandler(object sender, DocumentCancelEventArgs e) {
201 | if (TransactionalChangeHandler.ObjectsToSave(unitOfWork)) {
202 | var answer = XtraMessageBox.Show("There are unsaved changes. Do you want to validate and save before closing the list?", "Question",
203 | MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
204 | if (answer == DialogResult.Yes) {
205 | if (!TransactionalChangeHandler.ValidateAndCommit(unitOfWork))
206 | e.Cancel = true;
207 | }
208 | else if (answer == DialogResult.Cancel)
209 | e.Cancel = true;
210 | }
211 | }
212 |
213 | public void SaveChangesItemClickHandler(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
214 | TransactionalChangeHandler.ValidateAndCommit(unitOfWork);
215 | }
216 |
217 | public void DiscardChangesItemClickHandler(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
218 | if (ObjectsToSave(unitOfWork)) {
219 | if (XtraMessageBox.Show("This operation is going to discard all unsaved changes. Are you sure you want to proceed?", "Question",
220 | MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) {
221 | TransactionalChangeHandler.DiscardChanges(unitOfWork, topLevelCollection);
222 | }
223 | }
224 | }
225 | }
226 | }
227 | }
--------------------------------------------------------------------------------
/sample_5_6/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | System
12 |
13 |
14 | True
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/sample_5_6/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------