protected override void OnStart(string[] args) { String path = "C:\\Windows\\RemoteControl\\config.xml"; ControlItemConfiguration config = this.GetConfig(path); this.ctl = new DesktopControl(config); ctl.Start(); }
internal static UITestControl GenerateUITestControl(DesktopControl desktopControl) { //Create the control stack, reverse it, and walk backwards up it. var controlStack = new List<DesktopControl>(); var control = desktopControl; while (control != null) { controlStack.Add(control); control = control.Parent; } controlStack.Reverse(); var uiTestControl = UITestControl.Desktop; foreach (var ctrl in controlStack) { if (ctrl.SearchProperties.Count() == 0) throw new Exception("Search Properties must not be empty."); uiTestControl = new UITestControl(uiTestControl); uiTestControl.TechnologyName = ctrl._technologyName; foreach (var searchProperty in ctrl.SearchProperties) { if (searchProperty.SearchOperator == Core.SearchOperator.EqualTo) { uiTestControl.SearchProperties.Add(searchProperty.Name, searchProperty.Value, PropertyExpressionOperator.EqualTo); } else { uiTestControl.SearchProperties.Add(searchProperty.Name, searchProperty.Value, PropertyExpressionOperator.Contains); } } } return uiTestControl; //foreach (var searchProperties in desktopControl.SearchProperties) //{ // if (searchProperties.Count() == 0) // throw new Exception("Search Properties must not be empty."); // uiTestControl = new UITestControl(uiTestControl); // uiTestControl.TechnologyName = desktopControl._technologyName; // foreach (var searchProperty in searchProperties) // { // if(searchProperty.SearchOperator == Core.SearchOperator.EqualTo) // { // uiTestControl.SearchProperties.Add(searchProperty.Name, searchProperty.Value, PropertyExpressionOperator.EqualTo); // } // else // { // uiTestControl.SearchProperties.Add(searchProperty.Name, searchProperty.Value, PropertyExpressionOperator.Contains); // } // } //} //return uiTestControl; }
void Start() { if (SystemInfo.supportsGyroscope) { touchControl = GetComponent <TouchControl>(); touchControl.enabled = true; userIsOnPhone = true; GameObject.Find("Main Camera").GetComponent <GyroControl>().enabled = true; } else { desktopControl = GetComponent <DesktopControl>(); desktopControl.enabled = true; userIsOnDesktop = true; } }
/// <summary>Initializes a new GUI</summary> /// <param name="width">Width of the area the GUI can occupy</param> /// <param name="height">Height of the area the GUI can occupy</param> /// <remarks> /// Width and height should reflect the entire drawable area of your GUI. If you /// want to limit the region which the GUI is allowed to use (eg. to only use the /// safe area of a TV) please resize the desktop control accordingly! /// </remarks> public MainScreen(float width, float height) { Width = width; Height = height; heldKeys = new BitArray(maxKeyboardKey + 1); // this.heldButtons = 0; // By default, the desktop control will cover the whole drawing area desktopControl = new DesktopControl(); desktopControl.Bounds.Size.X.Fraction = 1.0f; desktopControl.Bounds.Size.Y.Fraction = 1.0f; desktopControl.SetScreen(this); focusedControl = new WeakReference <Control>(null); TooltipTimeout = 500; }