Beispiel #1
0
        private static string GetFormatValue(Helpers.ContractPropertyHelper propertyHelper)
        {
            propertyHelper.CheckArgument(nameof(propertyHelper));

            var result = string.Empty;

            if (propertyHelper.PropertyType.Equals(typeof(TimeSpan)))
            {
                result = "HH:mm";
            }
            else if (propertyHelper.PropertyType.Equals(typeof(TimeSpan?)))
            {
                result = "HH:mm";
            }
            else if (propertyHelper.PropertyType.Equals(typeof(DateTime)))
            {
                result = "dd.MM.yyyy";
                if (propertyHelper.ContentType == CommonBase.Attributes.ContentType.DateTime)
                {
                    result += " HH:mm:ss";
                }
            }
            else if (propertyHelper.PropertyType.Equals(typeof(DateTime?)))
            {
                result = "dd.MM.yyyy";
                if (propertyHelper.ContentType == CommonBase.Attributes.ContentType.DateTime)
                {
                    result += " HH:mm:ss";
                }
            }
            return(result);
        }
Beispiel #2
0
        private static ReadonlyMode GetReadonlyMode(Helpers.ContractPropertyHelper propertyHelper)
        {
            propertyHelper.CheckArgument(nameof(propertyHelper));

            var result = ReadonlyMode.None;

            if (propertyHelper.Property.CanWrite == false)
            {
                result = ReadonlyMode.Readonly;
            }
            return(result);
        }
Beispiel #3
0
        private static string GetListWitdh(Helpers.ContractPropertyHelper propertyHelper)
        {
            propertyHelper.CheckArgument(nameof(propertyHelper));

            var result = "100%";
            var type   = propertyHelper.PropertyType;

            if (type.IsGenericType)
            {
                type = type.GenericTypeArguments[0];
            }

            if (type.IsNumericType())
            {
                result = "100px";
            }
            else if (type == typeof(DateTime))
            {
                result = "160px";
            }
            return(result);
        }
Beispiel #4
0
        private static VisibilityMode GetVisibilityMode(Helpers.ContractPropertyHelper propertyHelper)
        {
            propertyHelper.CheckArgument(nameof(propertyHelper));

            var result = VisibilityMode.Visible;
            var name   = propertyHelper.PropertyName;
            var type   = propertyHelper.PropertyType;

            if (name.Equals("Id"))
            {
                result = VisibilityMode.Hidden;
            }
            else if (name.Equals("RowVersion"))
            {
                result = VisibilityMode.Hidden;
            }
            else if (type == typeof(byte[]))
            {
                result = VisibilityMode.Hidden;
            }
            return(result);
        }