/// <summary> /// Loads data (SKU options) to the selection control. /// </summary> private void LoadSKUOptions() { // Only for none-text types if (SelectionControl != null) { if (SelectionControl is TextBoxWithLabel) { if (!DataHelper.DataSourceIsEmpty(ProductOptionsData)) { DataRow dr = ProductOptionsData.Tables[0].Rows[0]; TextOptionSKUID = ValidationHelper.GetInteger(ProductOptionsData.Tables[0].Rows[0]["SKUID"], 0); if (OptionCategory.CategoryDisplayPrice) { TextBoxWithLabel tb = SelectionControl as TextBoxWithLabel; tb.LabelText = GetPrice(dr); } } } else if (SelectionControl is ListControl) { ((ListControl)SelectionControl).DataSource = ProductOptionsData; SelectionControl.DataBind(); // Add '(none)' record when it is allowed if ((OptionCategory != null) && (OptionCategory.CategoryDefaultRecord != "")) { ListItem noneRecord = new ListItem(OptionCategory.CategoryDefaultRecord, "0"); ((ListControl)SelectionControl).Items.Insert(0, noneRecord); } } } }
void Start() { GameController.OnlineDel += testExe;// lineRenderer = GetComponent <LineRenderer>(); // Controllers manualInputControl = GetComponent <ManualInputControl>(); selectionControl = GetComponent <SelectionControl>(); targetControl = GetComponent <TargetControl>(); commandControl = GetComponent <CommandControl>(); panelControl = GetComponent <PanelControl>(); //selectionControl.SetActiveAxis(target, false); axisCamera.SetActive(true); defaultPosition = target.position; target.GetComponent <ClampName>().textPanel.gameObject.SetActive(false); target.gameObject.SetActive(false); // Initial target //Destroy(target.GetComponent<ClampName>().textPanel.gameObject); //Destroy(target.gameObject); //SetTarget(targetControl.GetTarget(0)); //selectionControl.SetActiveAxis(targetControl.GetTarget(0), false); UpdateTargets(targetControl.GetNames()); commandsDropdown.AddOptions(commandControl.GetNames()); CommandsDropdown_IndexChanged(0); }
// Use this for initialization void Start() { am = amObj.GetComponent<AnimationManager> (); fs = faceSelObj.GetComponent<FaceSelection> (); hsTracker = hsObj.GetComponent<HighscoreTracker> (); sc = selectionControl.GetComponent<SelectionControl> (); cd = clkObj.GetComponent<ClickDetection> (); }
void Start() { sc = selectionControlGameObect.GetComponent<SelectionControl> (); expr = this.transform.Find ("Expression").gameObject; ans = this.transform.Find ("Answer").gameObject; print (expr); exprT = expr.GetComponent<Text> (); ansT = ans.GetComponent<Text> (); }
void Start() { // Planes planeXY = GetComponent <GameController>().planeXY; planeXZ = GetComponent <GameController>().planeXZ; planeYZ = GetComponent <GameController>().planeYZ; // Camera cam = GetComponent <GameController>().cam; //Controllers selectionControl = GetComponent <SelectionControl>(); cameraControl = GetComponent <CameraControl>(); // Needed because of accumulation error in axis Y posPlaneXY = planeXY.position; }
/// <summary> /// At run-time, this method is called during the node /// creation. Here you can create custom UI elements and /// add them to the node view, but we recommend designing /// your UI declaratively using xaml, and binding it to /// properties on this node as the DataContext. /// </summary> /// <param name="model">The NodeModel representing the node's core logic.</param> /// <param name="nodeView">The NodeView representing the node in the graph.</param> public void CustomizeView(SelectFusionEntityNodeModel model, NodeView nodeView) { // The view variable is a reference to the node's view. // In the middle of the node is a grid called the InputGrid. // We reccommend putting your custom UI in this grid, as it has // been designed for this purpose. // Create an instance of our custom UI class (defined in xaml), // and put it into the input grid. var selectionControl = new SelectionControl(); nodeView.inputGrid.Children.Add(selectionControl); // Set the data context for our control to be this class. // Properties in this class which are data bound will raise // property change notifications which will update the UI. selectionControl.DataContext = model; }
void Start() { // Drawing tool lineRenderer = GetComponent <LineRenderer>(); // Controllers manualInputControl = GetComponent <ManualInputControl>(); selectionControl = GetComponent <SelectionControl>(); targetControl = GetComponent <TargetControl>(); commandControl = GetComponent <CommandControl>(); panelControl = GetComponent <PanelControl>(); stateMessageControl = GetComponent <StateMessageControl>(); cameraControl = GetComponent <CameraControl>(); backupFileControl = GetComponent <BackUpFileControl>(); effectorFileControl = GetComponent <EffectorFileControl>(); // Initial config cameraControl.SetIsProcessing(true);// axisCamera.SetActive(true); defaultPosition = target.position; target.GetComponent <ClampName>().textPanel.gameObject.SetActive(false); target.gameObject.SetActive(false); SetTarget(null); UpdateTargets(targetControl.GetNames()); // Get commands names commandsDropdown.AddOptions(commandControl.GetNames()); CommandsDropdown_IndexChanged(0); byXYZPRDropdown.AddOptions(new List <string>() { "X", "Y", "Z", "P", "R" }); // Ports list portsDropdown.AddOptions(new List <string>(controller.List_Ports())); // Scorbot ER IX version list scorbotVersionDropdown.AddOptions(new List <string>() { "Original" }); }
public MainForm() { InitializeComponent(); _globalKeys = new List <GlobalHotkey> { new GlobalHotkey(Constants.Nomod, Keys.D1, this), new GlobalHotkey(Constants.Nomod, Keys.D2, this), new GlobalHotkey(Constants.Nomod, Keys.D3, this), new GlobalHotkey(Constants.Nomod, Keys.D4, this), new GlobalHotkey(Constants.Nomod, Keys.R, this), new GlobalHotkey(Constants.Nomod, Keys.E, this) }; FormUtils.DisableResizing(this); _selectionControl = new SelectionControl(); //Set the icon to be the one in resources. Icon = Properties.Resources.icon; }
/// <summary> /// Gets selected product options from the selection control. /// </summary> public string GetSelectedSKUOptions() { if (SelectionControl != null) { // Dropdown list, Radiobutton list - single selection if ((SelectionControl.GetType() == typeof(LocalizedDropDownList)) || (SelectionControl.GetType() == typeof(LocalizedRadioButtonList))) { return(((ListControl)SelectionControl).SelectedValue); } // Checkbox list - multiple selection else if (SelectionControl.GetType() == typeof(LocalizedCheckBoxList)) { string result = ""; foreach (ListItem item in ((CheckBoxList)SelectionControl).Items) { if (item.Selected) { result += item.Value + ","; } } return(result.TrimEnd(',')); } // TextBox else if (SelectionControl is TextBox) { return(((TextBox)(SelectionControl)).Text); } // Form control else if (SelectionControl is FormEngineUserControl) { FormEngineUserControl fc = SelectionControl as FormEngineUserControl; return(ValidationHelper.GetString(fc.Value, string.Empty)); } } return(null); }
/// <summary> /// Loads data (SKU options) to the selection control. /// </summary> public void LoadSelectorOptions() { // Only for none-text types if (SelectionControl is TextBox) { if (TextOptionsExists) { DataRow dr = TextOptionData.Tables[0].Rows[0]; lblTextPrice.Text = DisplayPrice ? GetPrice(dr) : ""; } } else { if (ProductOptionsExist) { var control = SelectionControl as ListControl; if (control != null) { control.DataSource = ProductOptionsData; SelectionControl.DataBind(); } } } }
// Use this for initialization void Start() { cc = null; prevFaces = new FaceBehaviour[6]; location = -1; ft = faceTransplantObject.GetComponent<FaceTransplant> (); compc = compCubeObject.GetComponent<CompleteCube> (); sc = cubeSelection.GetComponent<SelectionControl> (); }
public List <ShoppingCartItemParameters> GetSelectedOptionsParameters() { List <ShoppingCartItemParameters> options = new List <ShoppingCartItemParameters>(); ShoppingCartItemParameters param = null; if (SelectionControl != null) { // Dropdown list, Radiobutton list - single selection if ((SelectionControl.GetType() == typeof(LocalizedDropDownList)) || (SelectionControl.GetType() == typeof(LocalizedRadioButtonList))) { param = new ShoppingCartItemParameters(); param.SKUID = ValidationHelper.GetInteger(((ListControl)SelectionControl).SelectedValue, 0); if (param.SKUID > 0) { options.Add(param); } } // Checkbox list - multiple selection else if (SelectionControl.GetType() == typeof(LocalizedCheckBoxList)) { foreach (ListItem item in ((CheckBoxList)SelectionControl).Items) { if (item.Selected) { param = new ShoppingCartItemParameters(); param.SKUID = ValidationHelper.GetInteger(item.Value, 0); if (param.SKUID > 0) { options.Add(param); } } } } else if (SelectionControl is TextBox) { // Bind data if (SelectionControl is TextBoxWithLabel) { if (TextOptionSKUID > 0) { param = new ShoppingCartItemParameters(); param.SKUID = TextOptionSKUID; param.Text = ((TextBox)(SelectionControl)).Text; if (param.SKUID > 0) { options.Add(param); } } } } else if (SelectionControl is FormEngineUserControl) { FormEngineUserControl fc = SelectionControl as FormEngineUserControl; string val = ValidationHelper.GetString(fc.Value, string.Empty); int[] optionsIds = ValidationHelper.GetIntegers(val.Split(','), 0); // Add selected options to parameters foreach (int id in optionsIds) { if (id > 0) { param = new ShoppingCartItemParameters(); param.SKUID = id; options.Add(param); } } } } return(options); }
private void RecursiveSerializeXML(XmlNode parentNode, UIControl parentControl, string dir) { foreach (XmlNode node in parentNode.ChildNodes) { if (node is XmlComment) { continue; } UIControl control = new UIControl(); switch (node.Name) { case "TextBlock": case "TextBox": case "Label": case "CheckBox": case "GroupBox": var textcontrol = new TextControl(); textcontrol.FontSize = StringToObjectConverter.StringTo <double>(((XmlElement)node).GetAttribute("FontSize")); textcontrol.FontStretch = (FontStretch)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("FontStretch"), typeof(FontStretches), FontStretches.Normal); textcontrol.FontStyle = (FontStyle)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("FontStyle"), typeof(FontStyles), FontStyles.Normal); textcontrol.FontWeight = (FontWeight)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("FontWeight"), typeof(FontWeights), FontWeights.Normal); textcontrol.Text = (((XmlElement)node).GetAttribute("Text")); textcontrol.TextAlignment = (TextAlignment?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("TextAlignment"), typeof(TextAlignment)); textcontrol.TextDecoration = (TextDecoration)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("TextDecoration"), typeof(TextDecorations), null); textcontrol.TextWrapping = (TextWrapping?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("TextWrapping"), typeof(TextWrapping)); control = textcontrol; break; case "ComboBox": var selectionControl = new SelectionControl(); selectionControl.FontSize = StringToObjectConverter.StringTo <double>(((XmlElement)node).GetAttribute("FontSize")); selectionControl.FontStretch = (FontStretch)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("FontStretch"), typeof(FontStretches), FontStretches.Normal); selectionControl.FontStyle = (FontStyle)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("FontStyle"), typeof(FontStyles), FontStyles.Normal); selectionControl.FontWeight = (FontWeight)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("FontWeight"), typeof(FontWeights), FontWeights.Normal); selectionControl.Text = (((XmlElement)node).GetAttribute("Text")); selectionControl.TextAlignment = (TextAlignment?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("TextAlignment"), typeof(TextAlignment)); selectionControl.TextDecoration = (TextDecoration)StringToObjectConverter.StringToProperty(((XmlElement)node).GetAttribute("TextDecoration"), typeof(TextDecorations), null); selectionControl.TextWrapping = (TextWrapping?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("TextWrapping"), typeof(TextWrapping)); selectionControl.ItemsSource = (((XmlElement)node).GetAttribute("ItemsSource")); control = selectionControl; break; case "Image": var imagecontrol = new ImageControl(); imagecontrol.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(dir + ((XmlElement)node).GetAttribute("ImageSource"))); control = imagecontrol; break; default: control = new UIControl(); break; } control.Background = StringToObjectConverter.StringToBrush(((XmlElement)node).GetAttribute("Background"), new System.Windows.Media.SolidColorBrush(new System.Windows.Media.Color() { A = (byte)0xFF, R = (byte)0xFF, G = (byte)0xFF, B = (byte)0xFF })); control.Component = StringToObjectConverter.StringToComponents(((XmlElement)node).Name); control.Foreground = StringToObjectConverter.StringToBrush(((XmlElement)node).GetAttribute("Foreground"), new System.Windows.Media.SolidColorBrush(new System.Windows.Media.Color() { A = (byte)0xFF, R = (byte)0x00, G = (byte)0x00, B = (byte)0x00 })); control.Height = StringToObjectConverter.StringTo <double>(((XmlElement)node).GetAttribute("Height")); control.HorizontalAlignment = (HorizontalAlignment?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("HorizontalAlignment"), typeof(HorizontalAlignment)); control.IsEnabled = StringToObjectConverter.StringTo <bool>(((XmlElement)node).GetAttribute("IsEnabled"), true); control.IsVisible = StringToObjectConverter.StringTo <bool>(((XmlElement)node).GetAttribute("IsVisible")); control.Margin = ParseMargin(((XmlElement)node).GetAttribute("Margin")); control.Name = (((XmlElement)node).GetAttribute("Name")); control.Opacity = StringToObjectConverter.StringTo <double>(((XmlElement)node).GetAttribute("Opacity")); control.ToolTip = (((XmlElement)node).GetAttribute("ToolTip")); control.VerticalAlignment = (VerticalAlignment?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("VerticalAlignment"), typeof(VerticalAlignment)); control.Visibility = (Visibility?)StringToObjectConverter.StringToEnum(((XmlElement)node).GetAttribute("Visibility"), typeof(Visibility)); control.Width = StringToObjectConverter.StringTo <double>(((XmlElement)node).GetAttribute("Width")); control.IsRequired = StringToObjectConverter.StringTo <bool>(((XmlElement)node).GetAttribute("IsRequired"), false); parentControl.Children.Add(control); RecursiveSerializeXML(node, control, dir); } }