public EditRole(User user, controlPanel parent) { InitializeComponent(); this.user = user; this.parent = parent; apps = ApplicationDAO.getAllApplicationRecords(); String[] appNames = (from app in apps select app.Application_Name).ToArray <String>(); application_combobox.ItemsSource = appNames; application_combobox.SelectedIndex = 0; }
public EditUser(User user, controlPanel parent) { InitializeComponent(); this.user = user; this.parent = parent; applications = ApplicationDAO.getAllApplicationRecords(); users = UserDAO.getAllUsers(); user_combobox.ItemsSource = (from u in users select u.LoginID).ToArray <String>(); user_combobox.SelectedIndex = 0; }
private void Start() { scm = GameObject.FindWithTag("GameController").GetComponent <SCM>(); LS = GameObject.FindWithTag("GameController").GetComponent <lifeSystem>(); lManager = GameObject.FindWithTag("levelManager").GetComponent <levelManager>(); if (lManager.level2) { cPanel = GameObject.FindWithTag("jerigenMinyak").GetComponent <controlPanel>(); cPanel2 = GameObject.FindWithTag("pipa").GetComponent <controlPanel>(); } }
public EditApplication(User user, controlPanel parent) { InitializeComponent(); this.parent = parent; this.user = user; applications = ApplicationDAO.getAllApplicationRecords(); String[] appStrings = (from app in applications select app.Application_Name).ToArray <String>(); String[] active = { "Active", "Disabled" }; application_combobox.ItemsSource = appStrings; isActive_combobox.ItemsSource = active; save_btn.IsEnabled = false; }
public EditPermission(User user, controlPanel parent) { this.user = user; this.parent = parent; InitializeComponent(); applications = ApplicationDAO.getAllApplicationRecords(); permissions = PermissionDAO.getAllPermissions(); String [] permStrings = (from p in permissions select p.Permission_Name).ToArray <String>(); String[] active = { "Active", "Disabled" }; permission_combobox.ItemsSource = permStrings; isActive_combobox.ItemsSource = active; save_btn.IsEnabled = false; }
public void SetCP(controlPanel cp) { _cp = cp; }
public override void DocumentContextChanged(GH_Document document, GH_DocumentContext context) { base.DocumentContextChanged(document, context); if (context == GH_DocumentContext.Loaded) { myControlPanel = new controlPanel(); } }
void AddDevicePanel(InputDeviceType deviceType, string deviceName, int deviceSlotIndex) { GameObject newDevicePanelObj = (GameObject)GameObject.Instantiate(devicePanelPrefab); newDevicePanelObj.name = deviceName; newDevicePanelObj.transform.SetParent(rebindMenuContainer); newDevicePanelObj.transform.localScale = Vector3.one; devicePanel newDevicePanel = new devicePanel(); newDevicePanel.devicePanelObj = newDevicePanelObj; newDevicePanel.deviceName = deviceName; newDevicePanel.foldoutButton = newDevicePanelObj.transform.Find("DeviceNameFoldout").Find("FoldoutButton").GetComponent <Button>(); newDevicePanel.foldoutButton.enabled = false; //lets not have foldouts for now, they get reset all the time anyway newDevicePanel.deviceNameText = newDevicePanel.foldoutButton.transform.Find("DeviceNameText").GetComponent <Text>(); newDevicePanel.foldoutButton.onClick.AddListener(delegate { CollapseControlPanel(newDevicePanelObj.transform.Find("ControlsPanel").gameObject); }); newDevicePanel.deviceNameText.text = "Keyboard/Mouse:"; if (deviceType == InputDeviceType.GamepadAxis || deviceType == InputDeviceType.GamepadButton) { newDevicePanel.deviceNameText.text = "Gamepad: \"" + deviceName + "\""; } newDevicePanel.controlPanels = new List <controlPanel>(); for (int c = 0; c < controls.Length; c++) { GameObject newControlPanelObj = (GameObject)GameObject.Instantiate(ControlPanelPrefab); newControlPanelObj.name = controls[c].name; newControlPanelObj.transform.SetParent(newDevicePanelObj.transform.Find("ControlsPanel").transform); newControlPanelObj.transform.localScale = Vector3.one; controlPanel newControlPanel = new controlPanel(); newControlPanel.controlPanelObj = newControlPanelObj; newControlPanel.controlNameText = newControlPanelObj.transform.Find("ControlName").Find("ControlNameText").GetComponent <Text>(); newControlPanel.addInputButton = newControlPanelObj.transform.Find("AddInput").GetComponent <Button>(); newControlPanel.resetInputsButton = newControlPanelObj.transform.Find("ResetControl").GetComponent <Button>(); newControlPanel.controlNameText.text = controls[c].name; //Debug.Log(c); int controlIndex = c; newControlPanel.addInputButton.onClick.AddListener(delegate { AddControlInput(controlIndex, deviceName); }); newControlPanel.resetInputsButton.onClick.AddListener(delegate { ResetControlInputs(controlIndex, deviceName); }); newControlPanel.inputPanels = new List <inputPanel>(); for (int i = 0; i < controls[c].inputs.Count; i++) { bool applicableInput = false; if (deviceType == InputDeviceType.GamepadAxis || deviceType == InputDeviceType.GamepadButton) { if (null != controls[c].inputs[i].allowedSlots) { for (int s = 0; s < controls[c].inputs[i].allowedSlots.Length; s++) { if (controls[c].inputs[i].allowedSlots[s] == deviceSlotIndex) { applicableInput = true; } } } if (controls[c].inputs[i].deviceName == deviceName) { applicableInput = true; } } if (deviceType == InputDeviceType.Keyboard || deviceType == InputDeviceType.Mouse) { if (controls[c].inputs[i].inputType == InputDeviceType.Keyboard) { applicableInput = true; } if (controls[c].inputs[i].inputType == InputDeviceType.Mouse) { applicableInput = true; } } if (applicableInput) { //this input is referring to this device GameObject newInputPanelObj = (GameObject)GameObject.Instantiate(inputPanelPrefab); newInputPanelObj.transform.SetParent(newControlPanelObj.transform); newInputPanelObj.transform.localScale = Vector3.one; inputPanel newInputPanel = new inputPanel(); newInputPanel.inputButton = newInputPanelObj.transform.Find("Input").GetComponent <Button>(); newInputPanel.deleteButton = newInputPanelObj.transform.Find("InputDelete").GetComponent <Button>(); newInputPanel.inputButtonText = newInputPanel.inputButton.transform.Find("Text").GetComponent <Text>(); int inputIndex = i; newInputPanel.inputButton.onClick.AddListener(delegate { BeginRebindInput(controlIndex, inputIndex, deviceName, newInputPanel.inputButtonText); }); newInputPanel.deleteButton.onClick.AddListener(delegate { DeleteInput(controlIndex, inputIndex, deviceName); }); newInputPanel.inputButtonText.text = controls[c].inputs[i].GetDisplayName(); newControlPanel.inputPanels.Add(newInputPanel); } } newControlPanel.addInputButton.transform.SetSiblingIndex(98); newControlPanel.resetInputsButton.transform.SetSiblingIndex(99); newDevicePanel.controlPanels.Add(newControlPanel); } devicePanels.Add(newDevicePanel); }