| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 | using System;using System.Collections;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Linq;using System.Windows;using InABox.Core;using InABox.WPF;using Syncfusion.Data;using Syncfusion.UI.Xaml.Grid;using Syncfusion.UI.Xaml.Grid.Cells;using Syncfusion.UI.Xaml.TreeGrid;namespace InABox.DynamicGrid;public abstract class DynamicGridNumericColumn<TEntity, TEditor, TGridColumn, TTreeColumn> : DynamicGridEditorColumn<TEntity, TEditor, TGridColumn, TTreeColumn>, IDynamicGridNumericColumn     where TEntity : BaseObject    where TEditor : NumericEditor, new()    where TGridColumn : GridColumn, new()    where TTreeColumn : TreeGridColumn, new(){        protected int GetDigits(TEditor editor)    {        int digits = editor.Digits;        if (!string.IsNullOrWhiteSpace(Definition?.Format))        {            try            {                var formatted = 0.ToString(Definition.Format);                var separator = formatted.IndexOf(".", StringComparison.InvariantCulture);                digits = separator == -1                    ? 0                    : formatted.Length - (separator + 1);            }            catch (Exception e)            {                Logger.Send(LogType.Error,"","{0} is not a valid format specifier",Definition.Format);            }        }        return digits;    }        protected DynamicGridNumericColumn(DynamicGridColumn definition) : base(definition)    {    }}
 |