Ejemplo n.º 1
0
        // Creates LogicalCircuit wrapper
        private LogicalCircuit CreateItem(
            // Fields of LogicalCircuit table
            Guid LogicalCircuitId,
            string Name,
            string Notation,
            string Note,
            string Category,
            bool IsDisplay
            // Fields of Circuit table

            )
        {
            TableSnapshot <CircuitData> tableCircuit = (TableSnapshot <CircuitData>) this.CircuitProject.Table("Circuit");
            CircuitData dataCircuit = new CircuitData()
            {
                CircuitId = LogicalCircuitId
            };
            RowId rowIdCircuit = tableCircuit.Insert(ref dataCircuit);

            LogicalCircuitData dataLogicalCircuit = new LogicalCircuitData()
            {
                LogicalCircuitId = LogicalCircuitId,
                Name             = Name,
                Notation         = Notation,
                Note             = Note,
                Category         = Category,
                IsDisplay        = IsDisplay,
            };

            return(this.Create(this.Table.Insert(ref dataLogicalCircuit), rowIdCircuit));
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        // Constructor
        public LogicalCircuitSet(CircuitProject store)
        {
            ITableSnapshot table = store.Table("LogicalCircuit");

            if (table != null)
            {
                Debug.Assert(store.IsFrozen, "The store should be frozen");
                this.Table = (TableSnapshot <LogicalCircuitData>)table;
            }
            else
            {
                Debug.Assert(!store.IsFrozen, "In order to create table, the store should not be frozen");
                this.Table = LogicalCircuitData.CreateTable(store);
            }
            this.InitializeLogicalCircuitSet();
        }