1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using Comal.Classes;
- using InABox.Clients;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace PRSDesktop.Configuration;
- internal class CustomPropertyGrid : DynamicDataGrid<CustomProperty>
- {
- protected override void Init()
- {
- base.Init();
- HiddenColumns.Add(x => x.Class);
- HiddenColumns.Add(x => x.Type);
- }
- protected override void DoReconfigure(DynamicGridOptions options)
- {
- base.DoReconfigure(options);
- options.RecordCount = true;
- options.SelectColumns = true;
- }
- protected override void DoValidate(CustomProperty[] items, List<string> errors)
- {
- base.DoValidate(items, errors);
- if (items.Any(x => string.IsNullOrWhiteSpace(x.Class)))
- errors.Add("[Class] must not be blank!");
- if (items.Any(x => string.IsNullOrWhiteSpace(x.Name)))
- errors.Add("[Name] must not be blank!");
- if (items.Any(x => string.IsNullOrWhiteSpace(x.Type)))
- errors.Add("[Type] must not be blank!");
- }
- }
|