示例#1
0
 public FormsEventRunner(BoardStack stateStack, ContextMenuStrip rightClickMenu, ListBox circuitPropertyBox, ComboBox circuitPropertyValueBox, TextBox circuitPropertyTextBox, Panel drawingPanel, Func <Keys> getModifiers, Func <char?> getKey)
 {
     this.rightClickMenu          = rightClickMenu;
     this.circuitPropertyBox      = circuitPropertyBox;
     this.circuitPropertyValueBox = circuitPropertyValueBox;
     this.circuitPropertyTextBox  = circuitPropertyTextBox;
     this.drawingPanel            = drawingPanel;
     this.stateStack   = stateStack;
     this.getModifiers = getModifiers;
     this.getKey       = getKey;
 }
 // whiteboard
 public void Add(
     string equipmentName,
     string currentRoom,
     string notes,
     bool hasMarker,
     bool hasEraser)
 {
     equipment[collectionPosition] = new WhiteBoardEquipment(equipmentName, currentRoom, notes, hasMarker, hasEraser);
     BoardStack.Push(equipment[collectionPosition]);
     //AllEquipment[collectionPosition] = equipment[collectionPosition];
     collectionPosition++;
 }
示例#3
0
        public WireformForm()
        {
            InitializeComponent();

            typeof(Panel).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, DrawingPanel, new object[] { true });

            stateStack = new BoardStack(new LocalSaver(openFileDialog, saveFileDialog));

            var eventRunner = new FormsEventRunner(stateStack, GateMenu, CircuitPropertyBox, CircuitPropertyValueBox, CircuitPropertyValueTextBox, DrawingPanel, () => ModifierKeys, () => GetKey);

            inputStateManager        = new InputStateManager(eventRunner);
            eventRunner.stateManager = inputStateManager;

            toolBox.SelectedIndex = 0;
            //FlowPropagator.DebugStep = DrawingPanel.Refresh;
        }
        public string PrintAStack(string stack)
        {
            string output = "";

            switch (stack)
            {
            case "w":
                while (!WowStack.IsEmpty)
                {
                    output += WowStack.Pop().EquipmentListing + Environment.NewLine;
                    WowStack.Print();
                }
                break;

            case "v":
                while (!VisStack.IsEmpty)
                {
                    output += VisStack.Pop().EquipmentListing + Environment.NewLine;
                    VisStack.Print();
                }
                break;

            case "b":
                while (!BoardStack.IsEmpty)
                {
                    output += BoardStack.Pop().EquipmentListing + Environment.NewLine;
                    BoardStack.Print();
                }
                break;

            case "m":
                while (!WowStack.IsEmpty)
                {
                    output += WowStack.Pop().EquipmentListing + Environment.NewLine;
                    MiscStack.Print();
                }
                break;

            default:
                break;
            }

            Console.WriteLine(output);
            return(output);
        }