public bool EffectMuteToggle(string effectName)
 {
     SimFeedbackInvoker.Instance.ClickElement((IntPtr)SimFeedbackInvoker.Instance.actionElements.Effects[effectName].Muted.Current.NativeWindowHandle);
     if (AutomationExtensions.IsElementToggledOn(SimFeedbackInvoker.Instance.actionElements.Effects[effectName].Muted))
     {
         return(true);
     }
     return(false);
 }
 public bool ControllerSmoothnessToggle(string controllerName)
 {
     SimFeedbackInvoker.Instance.ClickElement((IntPtr)SimFeedbackInvoker.Instance.actionElements.Controllers[controllerName].SmoothnessEnabled.Current.NativeWindowHandle);
     if (AutomationExtensions.IsElementToggledOn(SimFeedbackInvoker.Instance.actionElements.Controllers[controllerName].SmoothnessEnabled))
     {
         return(true);
     }
     return(false);
 }
        private static void loadControllerObjects(AutomationElement root)
        {
            Instance.actionElements.Controllers.Clear();

            try
            {
                var elt = root.FindFirst(TreeScope.Subtree, new PropertyCondition(AutomationElement.AutomationIdProperty, "tableLayoutPanel1"));
                var controllerConfigControls = elt.FindAll(TreeScope.Subtree, new PropertyCondition(AutomationElement.AutomationIdProperty, "ControllerConfigControl"));


                GuiLoggerProvider.Instance.Log("Controllers found: " + controllerConfigControls.Count);

                int i = 0;
                // Alle Controller
                foreach (AutomationElement controllerConfigControl in controllerConfigControls)
                {
                    ControllerActionElement controllerActionElements = new ControllerActionElement();
                    // Controller name            GuiLoggerProvider.Instance.Log("Checking availability of AutomationElements...");

                    var controllerName = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                           new PropertyCondition(AutomationElement.AutomationIdProperty, "labelIdType"));
                    var tmpName = AutomationExtensions.GetText(controllerName);
                    GuiLoggerProvider.Instance.Log("UI Controller name: " + tmpName);


                    controllerActionElements.Name = Instance.actionElements.ControllerIndexAssignment[i];
                    GuiLoggerProvider.Instance.Log("Desired Controller name: " + Instance.actionElements.ControllerIndexAssignment[i]);

                    // Controller intensity
                    var trackBarIntensity = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                              new PropertyCondition(AutomationElement.AutomationIdProperty, "trackBarIntensity"));
                    controllerActionElements.Intensity = trackBarIntensity;


                    // Button controller intensity reset
                    var buttonControllerIntensityReset = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                                           new PropertyCondition(AutomationElement.AutomationIdProperty, "buttonIntensityReset"));
                    controllerActionElements.IntensityResetButton = buttonControllerIntensityReset;

                    // Checkbox controller smoothness
                    var checkboxControllerSmoothness = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                                         new PropertyCondition(AutomationElement.AutomationIdProperty, "checkBoxOverallSmoothness"));
                    controllerActionElements.SmoothnessEnabled = checkboxControllerSmoothness;

                    // Controller smoothness
                    var trackBarControllerSmoothness = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                                         new PropertyCondition(AutomationElement.AutomationIdProperty, "trackBarSmoothness"));
                    controllerActionElements.Smoothness = trackBarControllerSmoothness;

                    // Controller acceleration
                    var trackBarControllerAcceleration = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                                           new PropertyCondition(AutomationElement.AutomationIdProperty, "trackBarAcceleration"));
                    controllerActionElements.Acceleration = trackBarControllerAcceleration;

                    // Controller min speed
                    var trackBarControllerMinSpeed = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                                       new PropertyCondition(AutomationElement.AutomationIdProperty, "trackBarMinSpeed"));
                    controllerActionElements.MinSpeed = trackBarControllerMinSpeed;

                    // Controller max speed
                    var trackBarControllerMaxSpeed = controllerConfigControl.FindFirst(TreeScope.Children,
                                                                                       new PropertyCondition(AutomationElement.AutomationIdProperty, "trackBarMaxSpeed"));
                    controllerActionElements.MaxSpeed = trackBarControllerMaxSpeed;

                    GuiLoggerProvider.Instance.Log("Add Controller: " + controllerActionElements.Name);
                    Instance.actionElements.Controllers.Add(controllerActionElements.Name, controllerActionElements);
                    i++;
                }
            }
            catch (Exception e)
            {
                GuiLoggerProvider.Instance.Log("Error during loading of Controller: " + e.Message);
            }
        }
 public bool EffectIsMuted(string effectName)
 {
     return(AutomationExtensions.IsElementToggledOn(SimFeedbackInvoker.Instance.actionElements.Effects[effectName].Muted));
 }
 public bool EffectLinearIsEnabled(string effectName)
 {
     return(AutomationExtensions.IsElementToggledOn(SimFeedbackInvoker.Instance.actionElements.Effects[effectName].LinearInterpolated));
 }
 public bool ControllerSmoothnessIsEnabled(string controllerName)
 {
     return(AutomationExtensions.IsElementToggledOn(SimFeedbackInvoker.Instance.actionElements.Controllers[controllerName].SmoothnessEnabled));
 }