protected void AddColumnIfNotExists <T>(IEnumerable <ColumnInfo> columns, string tableName, string columnName) { var table = DefinitionFactory.GetTableDefinition(typeof(T), SqlSyntax); if (columns.Any(x => x.TableName.InvariantEquals(tableName) && !x.ColumnName.InvariantEquals(columnName))) { AddColumn(table, tableName, columnName); } }
public InfoMagneticVariationTest() { this.model = new InfoMagneticVariation( 12.154, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public InfoLongitudeTest() { this.model = new InfoLongitude( "def", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public InfoNameTest() { this.model = new InfoName( "Super Cool Sector", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
private void DeleteIndex <TDto>(string indexName) { var tableDef = DefinitionFactory.GetTableDefinition(typeof(TDto), Context.SqlContext.SqlSyntax); if (IndexExists(indexName)) { Delete.Index(indexName).OnTable(tableDef.Name).Do(); } }
public void TestItReturnsElementsInOrder() { OutputGroup group1 = new("1"); OutputGroup group2 = new("2"); outputGroups.AddGroupWithFiles(group1, new List <string> { "foo.txt" }); outputGroups.AddGroupWithFiles(group2, new List <string> { "goo.txt" }); ControllerPosition first = ControllerPositionFactory.Make( order: PositionOrder.MENTOR_POSITION, definition: DefinitionFactory.Make("goo.txt") ); ControllerPosition second = ControllerPositionFactory.Make( order: PositionOrder.MENTOR_POSITION, definition: DefinitionFactory.Make("foo.txt") ); ControllerPosition third = ControllerPositionFactory.Make( order: PositionOrder.PRE_POSITION, definition: DefinitionFactory.Make("foo.txt") ); ControllerPosition fourth = ControllerPositionFactory.Make( order: PositionOrder.CONTROLLER_POSITION, definition: DefinitionFactory.Make("goo.txt") ); ControllerPosition fifth = ControllerPositionFactory.Make( order: PositionOrder.CONTROLLER_POSITION, definition: DefinitionFactory.Make("foo.txt") ); ControllerPosition sixth = ControllerPositionFactory.Make( order: PositionOrder.CONTROLLER_POSITION, definition: DefinitionFactory.Make("foo.txt") ); sectorElements.Add(first); sectorElements.Add(second); sectorElements.Add(third); sectorElements.Add(fourth); sectorElements.Add(fifth); sectorElements.Add(sixth); IEnumerable <ICompilableElementProvider> expected = new List <ICompilableElementProvider>() { third, fifth, sixth, fourth, second, first }; AssertCollectedItems(expected); }
public FixTest() { this.fix = new Fix( "ADMAG", new Coordinate("abc", "def"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public RegionTest() { this.region = new Region( "Region1", this.points, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public SectorActiveTest() { this.model = new SectorActive( "EGLL", "09R", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public ColourTest() { this.colour = new Colour( "colour1", 123, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public RunwayCentrelineTest() { segment = RunwayCentrelineSegmentFactory.Make(); centreline = new RunwayCentreline( segment, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public SectorlineDisplayRuleTest() { this.model = new SectorlineDisplayRule( "Deancross", "Deancross", "East", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public NdbTest() { this.model = new Ndb( "BRI", "123.456", new Coordinate("abc", "def"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public SectorGuestTest() { this.model = new SectorGuest( "MWAL", "EGBB", "*", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public FreetextTest() { this.model = new Freetext( "Freetext", "Some text", new Coordinate("abc", "def"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public GeoSegmentTest() { this.segment = new GeoSegment( new Point(new Coordinate("abc", "def")), new Point(new Coordinate("ghi", "jkl")), "red", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
protected void AlterColumn <T>(string tableName, string columnName) { var table = DefinitionFactory.GetTableDefinition(typeof(T), SqlSyntax); var column = table.Columns.First(x => x.Name == columnName); SqlSyntax.Format(column, SqlSyntax.GetQuotedTableName(tableName), out var sqls); foreach (var sql in sqls) { Execute.Sql(sql).Do(); } }
public LabelTest() { this.label = new Label( "label 1", new Coordinate("abc", "def"), "colour", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public ActiveRunwayTest() { this.activeRunway = new ActiveRunway( "33", "EGBB", 1, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public RouteSegmentTest() { this.segment = new RouteSegment( "FOO", new Point("BIG"), new Point("LAM"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
private void AddNewDefinition <TEntity>() where TEntity : class { lock (Locker) { if (!Definitions.ContainsKey(typeof(TEntity))) { Definitions.Add(typeof(TEntity), DefinitionFactory.Create <TEntity>(this)); } } }
private void DeleteIndexes <T>(params string[] toDelete) { var tableDef = DefinitionFactory.GetTableDefinition(typeof(T), Context.SqlContext.SqlSyntax); foreach (var i in toDelete) { if (IndexExists(i)) { Delete.Index(i).OnTable(tableDef.Name).Do(); } } }
private static AirwaySegment GetAirway(AirwayType type, string startPointIdentifier, string endPointIdentifier) { return(new( "test", type, new Point(startPointIdentifier), new Point(endPointIdentifier), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() )); }
public AbstractSectorElementTest() { this.docblock = DocblockFactory.Make(); this.comment = CommentFactory.Make(); this.definition = DefinitionFactory.Make(); this.element = new MockSectorElement( this.definition, this.docblock, this.comment ); }
public ArtccSegmentTest() { this.artcc = new ArtccSegment( "EGTT", ArtccType.HIGH, new Point("abc"), new Point("def"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
private void SelectTargetFile(object sender, EventArgs e) { _targetStream?.Dispose(); targetGridView.Rows.Clear(); var fileName = string.Empty; using (var dialog = new OpenFileDialog()) { dialog.Title = "Select the file to use as reference."; dialog.Filter = "DBC files (*.dbc, *.db2)|*.dbc;*.db2"; if (dialog.ShowDialog() == DialogResult.OK) { fileName = dialog.FileName; } } if (string.IsNullOrEmpty(fileName)) { return; } textBox2.Text = fileName; _targetStream = File.OpenRead(fileName); _targetFileAnalyzer = AnalyzerFactory.Create(_targetStream); if (Properties.Settings.Default.LoadTargetDefinition) { var definitionName = Path.GetFileNameWithoutExtension(fileName); if (!_definitionContainer.TryGetValue(definitionName, out var definitionStore) || definitionStore == null) { definitionStore = _definitionContainer[definitionName] = DefinitionFactory.Open(definitionName); } var fileType = definitionStore[_targetFileAnalyzer.LayoutHash]; _targetFileAnalyzer = AnalyzerFactory.Create(fileType, _targetStream); // Add to GUI ShowTypeToGUI(_targetFileAnalyzer.RecordType, targetGridView); } else { var definitionName = Path.GetFileNameWithoutExtension(fileName); if (_definitionContainer.TryGetValue(definitionName, out var definitionStore)) { if (definitionStore.ContainsKey(_targetFileAnalyzer.LayoutHash)) { throw new InvalidOperationException("Structure is already known"); } } } }
public NovaSettingsManager() { _definitions = new Dictionary <string, IDefinition>(); //TODO; _factory = new ComboBoxFactory(); //Good starter since it's a special case. _factory.SetSuccessor <RadioButtonFactory>() .SetSuccessor <CheckBoxFactory>() .SetSuccessor <DatePickerFactory>() //.......... .SetSuccessor <TextBoxFactory>(); //Decent Fallback in case nothing matches. }
public AirwaySegmentTest() { this.airway = new AirwaySegment( "UN864", AirwayType.HIGH, new Point("ABCDE"), new Point("FGHIJ"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
private void CreateIndex <TDto>(string indexName) { var tableDef = DefinitionFactory.GetTableDefinition(typeof(TDto), Context.SqlContext.SqlSyntax); // get the definition by name var index = tableDef.Indexes.First(x => x.Name == indexName); new ExecuteSqlStatementExpression(Context) { SqlStatement = Context.SqlContext.SqlSyntax.Format(index) }.Execute(); }
public AirportTest() { this.airport = new Airport( "Testville", "EGTT", new Coordinate("abc", "def"), "123.456", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }