// Creates Constant wrapper private Constant CreateItem( // Fields of Constant table Guid ConstantId, int BitWidth, int Value, PinSide PinSide, string Note // Fields of Circuit table ) { TableSnapshot <CircuitData> tableCircuit = (TableSnapshot <CircuitData>) this.CircuitProject.Table("Circuit"); CircuitData dataCircuit = new CircuitData() { CircuitId = ConstantId }; RowId rowIdCircuit = tableCircuit.Insert(ref dataCircuit); ConstantData dataConstant = new ConstantData() { ConstantId = ConstantId, BitWidth = BitWidth, Value = Value, PinSide = PinSide, Note = Note, }; return(this.Create(this.Table.Insert(ref dataConstant), rowIdCircuit)); }
public CircuitProject() : base() { // Create all sets this.CreateSets(); // Create foreign keys ProjectData.CreateForeignKeys(this); CollapsedCategoryData.CreateForeignKeys(this); CircuitData.CreateForeignKeys(this); DevicePinData.CreateForeignKeys(this); GateData.CreateForeignKeys(this); LogicalCircuitData.CreateForeignKeys(this); PinData.CreateForeignKeys(this); CircuitProbeData.CreateForeignKeys(this); ConstantData.CreateForeignKeys(this); CircuitButtonData.CreateForeignKeys(this); MemoryData.CreateForeignKeys(this); LedMatrixData.CreateForeignKeys(this); SplitterData.CreateForeignKeys(this); SensorData.CreateForeignKeys(this); SoundData.CreateForeignKeys(this); GraphicsArrayData.CreateForeignKeys(this); CircuitSymbolData.CreateForeignKeys(this); WireData.CreateForeignKeys(this); TextNoteData.CreateForeignKeys(this); this.FreezeShape(); this.Init(); }
// Constructor public ConstantSet(CircuitProject store) { ITableSnapshot table = store.Table("Constant"); if (table != null) { Debug.Assert(store.IsFrozen, "The store should be frozen"); this.Table = (TableSnapshot <ConstantData>)table; } else { Debug.Assert(!store.IsFrozen, "In order to create table, the store should not be frozen"); this.Table = ConstantData.CreateTable(store); } this.InitializeConstantSet(); }