private void PrepareDataTypeAndParams(CoreDataType dataType, int length, int decimals) { switch (dataType) { case CoreDataType.INT: DataType = "int"; DataTypeParameters = ""; Length = 0; Decimals = 0; break; case CoreDataType.DATE: case CoreDataType.TIME: case CoreDataType.DATETIME: DataType = "datetime"; DataTypeParameters = ""; break; case CoreDataType.VARCHAR: DataType = "varchar"; DataTypeParameters = $"({length})"; Length = length; Decimals = 0; break; case CoreDataType.DECIMAL: DataType = "decimal"; DataTypeParameters = $"({length},{decimals})"; Length = length; Decimals = decimals; break; } }
private object DataTypeToString(CoreDataType dataType) { switch (dataType) { case CoreDataType.INT: return("int"); case CoreDataType.DECIMAL: return("decimal"); case CoreDataType.VARCHAR: return("varchar"); case CoreDataType.DATE: return("date"); case CoreDataType.DATETIME: return("datetime"); case CoreDataType.TIME: return("time"); default: throw new InvalidDataTypeException(); } }
public string GetByDataType(CoreDataType dataType) { switch (dataType) { case CoreDataType.Customs: return(Customs); case CoreDataType.Drones: return(Drones); case CoreDataType.Flavour: return(Flavour); case CoreDataType.FusionBundles: return(FusionBundles); case CoreDataType.Gear: return(Gear); case CoreDataType.Keys: return(Keys); case CoreDataType.Recipes: return(Recipes); case CoreDataType.Regions: return(Recipes); case CoreDataType.RelicArcane: return(RelicArcane); case CoreDataType.Resources: return(Resources); case CoreDataType.Sentinels: return(Sentinels); case CoreDataType.SortieRewards: return(SortieRewards); case CoreDataType.Upgrades: return(Upgrades); case CoreDataType.Warframes: return(Warframes); case CoreDataType.Weapons: return(Weapons); case CoreDataType.Manifest: return(Manifest); default: throw new ArgumentOutOfRangeException(nameof(dataType), dataType, null); } }
public ILAttribute(string name, CoreDataType dataType, int length, int decimals, bool primaryKey) { Name = name; IsPrimaryKey = primaryKey; PrepareDataTypeAndParams(dataType, length, decimals); if (IsPrimaryKey) { DataTypeParameters += " not null"; } }
public async Task <string> GetData(CoreDataType dataType) { var task = _client.GetAsync(_index.GetByDataType(dataType)); task.Wait(); var response = task.Result; using (response) { return(await response.Content.ReadAsStringAsync()); } }
/// <summary> /// Initializes a new <see cref="CoreDataFieldDescription"/> instance /// </summary> /// <param name="Position">The peer-relative position of the field</param> /// <param name="Name">The name of the field</param> /// <param name="DataType">The <see cref="CoreDataType"/> of the field</param> /// <param name="DataFacets">The applicable <see cref="CoreDataFacets"/></param> /// <param name="Documentation">Describes the purposes of the field</param> public CoreDataFieldDescription ( int Position, string Name, CoreDataType DataType, CoreDataFacets DataFacets = null, string Documentation = null ) { this.Position = Position; this.Name = Name; this.DataType = DataType; this.Documentation = Documentation ?? String.Empty; this.DataFacets = DataFacets; }
public void SaveData(CoreDataType dataType, string targetFileLocation) { var data = GetData(dataType); var dir = Path.GetDirectoryName(targetFileLocation); var dirInfo = new DirectoryInfo(dir); if (!dirInfo.Exists) { dirInfo.Create(); } using (var fs = new FileStream(targetFileLocation, FileMode.Create)) { using (var sw = new StreamWriter(fs)) { sw.Write(data); } } }
public static string GetSqlDataType(CoreDataType dataType) { switch (dataType) { case CoreDataType.DATE: return("date"); case CoreDataType.DATETIME: return("datetime"); case CoreDataType.DECIMAL: return("decimal"); case CoreDataType.INT: // Achtung: Sonderfall: ID in Faktentabllen ist BigInt !!! return("int"); case CoreDataType.VARCHAR: return("varchar"); default: throw new InvalidDataTypeException($"Ungültiger Datentyp: {dataType.ToString()}"); } }
public CoreDataChangedEventArgs(CoreDataType key) { this.key = key; }
public void SaveData(CoreDataType dataType) { _client.SaveData(dataType, Path.Combine(_rootDirectory, dataType.ToString() + ".json")); }
public BLDataType(CoreDataType core) { this.Core = core; }