public ColumnConfig(string header, ColumnTypes type, string path = null) { if (string.IsNullOrWhiteSpace(header)) { header = type.ToString() + _unnamedColumnIndex++; } Header = header; Type = type; if (string.IsNullOrWhiteSpace(path)) { switch (type) { case ColumnTypes.Level: case ColumnTypes.Message: case ColumnTypes.Time: Path = type.ToString(); break; default: Path = header; break; } } else { Path = path; } }
public static AccountSettingsColumn GetColumnByType(this AccountSettings settings, ColumnTypes columnType) { #pragma warning disable 618 return settings.Columns .FirstOrDefault(c => string.Compare(c.ColumnType.SystemName, columnType.ToString(), true) == 0); #pragma warning restore 618 }
internal static string GetVariableColumnType(this ColumnTypes columnType) { switch (columnType) { case ColumnTypes.AutoNumber: return("auto_number"); case ColumnTypes.ColorPicker: return("color_picker"); case ColumnTypes.CreationLog: return("creation_log"); case ColumnTypes.ItemId: return("item_id"); case ColumnTypes.LastUpdated: return("last_updated"); case ColumnTypes.LongText: return("long_text"); case ColumnTypes.TimeTracking: return("time_tracking"); case ColumnTypes.WorldClock: return("world_clock"); case ColumnTypes.Checkbox: case ColumnTypes.Country: case ColumnTypes.Date: case ColumnTypes.Dropdown: case ColumnTypes.Email: case ColumnTypes.Hour: case ColumnTypes.Link: case ColumnTypes.Location: case ColumnTypes.Numbers: case ColumnTypes.People: case ColumnTypes.Phone: case ColumnTypes.Progress: case ColumnTypes.Rating: case ColumnTypes.Status: case ColumnTypes.Team: case ColumnTypes.Tags: case ColumnTypes.Text: case ColumnTypes.Timeline: case ColumnTypes.Vote: case ColumnTypes.Week: case ColumnTypes.Integration: return(columnType.ToString().ToLower()); } return(null); }
public ColumnAttribute(int ordinal_position, string name, ColumnTypes dataType = ColumnTypes.undefined, bool nullable = true, int size = -1, int precision = -1, int scale = -1, string abstractType = null, bool isArray = false) : this(ordinal_position, name, dataType.ToString()) { }
private static FieldTypeInfo CreateFieldType(ColumnTypes columnType) { return new FieldTypeInfo(columnType.ToString(), columnType.ToString(), true); }
public string GetTypeName(ColumnTypes type) { string typeString = ""; switch (type) { case ColumnTypes.BigInt: typeString = "long"; break; case ColumnTypes.Binary: typeString = "byte[]"; break; case ColumnTypes.Bit: typeString = "bool"; break; case ColumnTypes.Char: typeString = "char"; break; case ColumnTypes.Date: typeString = "DateTime"; break; case ColumnTypes.DateTime: typeString = "DateTime"; break; case ColumnTypes.DateTime2: typeString = "DateTime"; break; case ColumnTypes.DateTimeOffset: typeString = "TimeSpan"; break; case ColumnTypes.Decimal: typeString = "decimal"; break; case ColumnTypes.Float: typeString = "float"; break; case ColumnTypes.Int: typeString = "int"; break; case ColumnTypes.Money: typeString = "decimal"; break; case ColumnTypes.NChar: typeString = "string"; break; case ColumnTypes.NText: typeString = "string"; break; case ColumnTypes.Numeric: typeString = "decimal"; break; case ColumnTypes.NVarChar: typeString = "string"; break; case ColumnTypes.SmallInt: typeString = "short"; break; case ColumnTypes.SmallMoney: typeString = "double"; break; case ColumnTypes.Text: typeString = "string"; break; case ColumnTypes.Time: typeString = "DateTime"; break; case ColumnTypes.TimeStamp: typeString = "string"; break; case ColumnTypes.UniqueIdentifier: typeString = "Guid"; break; case ColumnTypes.VarBinnary: typeString = "byte[]"; break; case ColumnTypes.VarChar: typeString = "string"; break; case ColumnTypes.Variant: typeString = "object"; break; case ColumnTypes.Xml: typeString = "string"; break; default: throw new ApplicationException("Unknown type: " + type.ToString()); } return(typeString); }
/// <summary> /// Creates the version field information. /// </summary> /// <param name="processName">Name of the process.</param> /// <param name="fieldSystemName">Name of the field system.</param> /// <param name="columnType">Type of the column.</param> /// <returns>The FieldInfoDto.</returns> private static FieldInfoDto CreateVersionFieldInfo(string processName, string fieldSystemName, ColumnTypes columnType) { return new FieldInfoDto { DataType = columnType.ToString(), DefinedIn = processName, Name = LanguageService.Translate(fieldSystemName), SystemName = fieldSystemName }; }