private void ListAccessoryConnections() { OutputEditorControl control; AccessoryDecoderConnection connection; if (!this.Element.Properties.IsAccessory || this.Element.Properties.NumberOfAccessoryConnections <= 0) { tabAccessoryConnections.PageVisible = false; return; } // Create connection controls for (int i = 1; i <= this.Element.Properties.NumberOfAccessoryConnections; i++) { connection = AccessoryDecoderConnection.GetByIndex(this.Element, i); if (connection != null) { control = new OutputEditorControl(connection); } else { control = new OutputEditorControl(this.Element); } control.ConnectionIndex = i; control.Text = string.Format("Accessory connection {0}", i); control.Dock = DockStyle.Top; control.ConnectionChanged += Connection_ConnectionChanged; tabAccessoryInputs.Controls.Add(control); control.BringToFront(); } this.StatusEditorControl = new OutputStatusEditorControl(this.Element); this.StatusEditorControl.Dock = DockStyle.Fill; this.StatusEditorControl.MapChanged += StatusEditorControl_MapChanged; tabAccessoryMap.Controls.Add(this.StatusEditorControl); this.StatusEditorControl.Refresh(); }
private void ListOutputs() { OutputEditorControl connection; if (!this.Element.Properties.IsAccessory) { tabBlockOutputs.PageVisible = false; return; } // Get element outputs // this.Element.AccessoryConnections = DeviceConnection.FindBy("Element", this.Element); // Create connection controls for (int i = 0; i < this.Element.Properties.NumConnections; i++) { if (this.Element.AccessoryConnections.Count > i && this.Element.AccessoryConnections[i] != null) { connection = new OutputEditorControl(this.Element.AccessoryConnections[i]); } else { connection = new OutputEditorControl(this.Element); } connection.ConnectionIndex = i + 1; connection.Text = string.Format("Accessory connection {0}", i + 1); connection.Dock = System.Windows.Forms.DockStyle.Top; connection.ConnectionChanged += connection_ConnectionChanged; tabAccessoryConnections.Controls.Add(connection); connection.BringToFront(); } this.StatusEditorControl = new OutputStatusEditorControl(this.Element); this.StatusEditorControl.Dock = DockStyle.Fill; this.StatusEditorControl.MapChanged += StatusEditorControl_MapChanged; tabAccessorySetup.Controls.Add(this.StatusEditorControl); this.StatusEditorControl.Refresh(); }