//+1 Button private void button_more_passenger_Click(object sender, EventArgs e) { _passengersIO = Defaults.MoreOrLess.More; //Wo ist der Typ von _passengersIO deklariert? wirkt unsauber implementiert?! Defaults.ManualResetEvent.Set(); }
//-1 Button private void button_less_passenger_Click(object sender, EventArgs e) { _passengersIO = Defaults.MoreOrLess.Less; Defaults.ManualResetEvent.Set(); }
public void ResetPassengerIO() { _passengersIO = Defaults.MoreOrLess.Neither; }
/// <summary> /// Konstruktor /// </summary> public UserInterface() { InitializeComponent(); //Intialisierung der statisch erzeugten Formularelemente _passengersIO = Defaults.MoreOrLess.Neither; floors = new GroupBox[Defaults.Floors]; floor_numbers = new Label[Defaults.Floors]; current_position = new Label[Defaults.Floors]; required = new CheckedListBox[Defaults.Floors]; doorstates = new PictureBox[Defaults.Floors]; door1 = Image.FromFile(Defaults.GetProjectPath() + @"\Pictures\Aufzugtueren_auf.gif"); door2 = Image.FromFile(Defaults.GetProjectPath() + @"\Pictures\Aufzugtueren_zu.gif"); for (int i = Defaults.Floors -1 ; i >= 0; i--) { floors[i] = new GroupBox(); floors[i].Text = ""; floors[i].Location = new Point(30, Defaults.Floors*100 - 110*i ); floors[i].Height = 110; floors[i].Width = 350; floors[i].Name = "groupBox_floor" + i; groupBox_outsite.Controls.Add(floors[i]); floor_numbers[i] = new Label(); switch (i){ case 0: floor_numbers[i].Text = "1. UG"; break; case 1: floor_numbers[i].Text = "EG"; break; default: floor_numbers[i].Text = (i -1) + ". OG"; break; } floor_numbers[i].Width = 70; floor_numbers[i].Location = new Point(10,10); floor_numbers[i].Name = "label_floor" + i; floors[i].Controls.Add(floor_numbers[i]); floor_numbers[i].Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); doorstates[i] = new PictureBox(); doorstates[i].Width = 30; doorstates[i].Height = 30; doorstates[i].Location = new Point(100, 50); doorstates[i].Name = "pictureBox_doorstate" + i; doorstates[i].Image = door1; floors[i].Controls.Add(doorstates[i]); current_position[i] = new Label(); current_position[i].Text = "#Position"; current_position[i].Name = "label_position" + i; current_position[i].Width = 60; current_position[i].Location = new Point(100, 12); floors[i].Controls.Add(current_position[i]); required[i] = new CheckedListBox(); required[i].Location = new Point(210, 20); required[i].Height = 50; required[i].Name = "checkedListBox_floor" + i; required[i].BackColor = System.Drawing.SystemColors.Control; if(i!=Defaults.Floors - 1 ) required[i].Items.Add("Aufwärts"); if(i!=0) required[i].Items.Add("Abwärts"); required[i].BorderStyle = System.Windows.Forms.BorderStyle.None; required[i].Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); floors[i].Controls.Add(required[i]); }// Ende der for-Schleife }
//+1 Button private void button_more_passenger_Click( object sender, EventArgs e ) { _passengersIO = Defaults.MoreOrLess.More; Syncronize.ExecuteLoop(); _passengersIO = Defaults.MoreOrLess.Neither; }
/// <summary> /// Konstruktor /// </summary> public UserInterface() { InitializeComponent(); //Intialisierung der statisch erzeugten Formularelemente SwitchDirection(); _passengersIO = Defaults.MoreOrLess.Neither; groupBox_Floors = new GroupBox[Defaults.Floors]; label_FloorNumbers = new Label[ Defaults.Floors ]; label_CurrentPosition = new Label[Defaults.Floors]; pictBox_DoorStates = new PictureBox[Defaults.Floors]; button_intern = new Button[Defaults.Floors]; button_upward = new Button[Defaults.Floors]; button_downward = new Button[Defaults.Floors]; img_door1 = Image.FromFile(Defaults.GetProjectPath() + @"\Pictures\Aufzugtueren_auf.gif"); img_door2 = Image.FromFile(Defaults.GetProjectPath() + @"\Pictures\Aufzugtueren_zu.gif"); for (int i = Defaults.Floors -1 ; i >= 0; i--) { groupBox_Floors[i] = new GroupBox(); groupBox_Floors[i].Text = ""; groupBox_Floors[i].Location = new Point(30, Defaults.Floors*100 - 110*i ); groupBox_Floors[i].Height = 110; groupBox_Floors[i].Width = 350; groupBox_Floors[i].Name = "groupBox_floor" + i; groupBox_outsite.Controls.Add(groupBox_Floors[i]); label_FloorNumbers[ i ] = new Label(); switch (i) { case 0: label_FloorNumbers[ i ].Text = "1. UG"; break; case 1: label_FloorNumbers[ i ].Text = "EG"; break; default: label_FloorNumbers[ i ].Text = ( i - 1 ) + ". OG"; break; } label_FloorNumbers[ i ].Width = 70; label_FloorNumbers[i].Name = "label_floor" + i; groupBox_Floors[ i ].Controls.Add( label_FloorNumbers[ i ] ); label_FloorNumbers[ i ].Font = new System.Drawing.Font( "Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte)( 0 ) ) ); pictBox_DoorStates[i] = new PictureBox(); pictBox_DoorStates[i].Width = 30; pictBox_DoorStates[i].Height = 30; pictBox_DoorStates[i].Location = new Point(100, 50); pictBox_DoorStates[i].Name = "pictureBox_doorstate" + i; pictBox_DoorStates[i].Image = img_door2; groupBox_Floors[i].Controls.Add(pictBox_DoorStates[i]); label_CurrentPosition[i] = new Label(); label_CurrentPosition[i].Text = "#Position"; label_CurrentPosition[i].Name = "label_position" + i; label_CurrentPosition[i].Width = 60; label_CurrentPosition[i].Location = new Point(100, 12); groupBox_Floors[i].Controls.Add(label_CurrentPosition[i]); button_intern[i] = new Button(); button_intern[i].Location = new Point(20, Defaults.Floors*45 - 45 * i); button_intern[i].Height = 40; button_intern[i].Width = 100; button_intern[i].Name = "Button_int_"+i; switch (i){ case 0: button_intern[i].Text = "1. UG"; break; case 1: button_intern[i].Text = "EG"; break; default: button_intern[i].Text = (i -1) + ". OG"; break; } groupBox_floor_selection.Controls.Add(button_intern[i]); button_intern[i].Click += new System.EventHandler(ClickInnerButton); if(i!=Defaults.Floors - 1){ button_upward[i] = new Button(); button_upward[i].Location = new Point(250, 25); button_upward[i].Height = 30; button_upward[i].Width = 70; button_upward[i].Text = "Aufwärts"; button_upward[i].Name = "Button_up_" + i; groupBox_Floors[i].Controls.Add(button_upward[i]); button_upward[i].Click += new System.EventHandler(ClickOutsideButton); } if (i != 0) { button_downward[i] = new Button(); button_downward[i].Location = new Point(250, 65); button_downward[i].Height = 30; button_downward[i].Width = 70; button_downward[i].Text = "Abwärts"; button_downward[i].Name = "Button_down_" + i; groupBox_Floors[i].Controls.Add(button_downward[i]); button_downward[i].Click += new System.EventHandler(ClickOutsideButton); } }// for-Schleife }