コード例 #1
0
        public void Redraw()
        {
            LogicalCircuit currentCircuit = this.project.LogicalCircuit;

            if (this.lastLogicalCircuit != currentCircuit)
            {
                this.lastLogicalCircuit = currentCircuit;
                this.lastBack           = null;
            }
            if (this.lastBack == null)
            {
                if (this.circuitSymbol.Count == 1)
                {
                    this.lastBack = (Canvas)this.circuitSymbol[0].ProbeView;
                }
                else
                {
                    CircuitSymbol symbol = this.circuitSymbol.First(s => s.LogicalCircuit == currentCircuit);
                    this.lastBack = this.ProbeView(symbol);
                }
                Tracer.Assert(this.lastBack.Children.Count == this.BitWidth);
            }
            for (int i = 0; i < this.BitWidth; i++)
            {
                Function7Segment.SetVisual((Shape)this.lastBack.Children[i], this[i]);
            }
        }
コード例 #2
0
 public void TurnOff()
 {
     foreach (CircuitSymbol symbol in this.circuitSymbol)
     {
         if (symbol.HasCreatedGlyph)
         {
             Canvas back = this.ProbeView(symbol);
             for (int i = 0; i < 8; i++)
             {
                 Function7Segment.SetVisual((Shape)back.Children[i], State.Off);
             }
         }
     }
 }