private string SelectedForElement(AutomationElement element)
        {
            var items = element.GetSelectedItems();
            if (items.Length == 0)
                return string.Empty;
            var sb = new StringBuilder();
            foreach (var automationElement in items)
            {
                sb.AppendLine(automationElement.Name());
                sb.AppendLine("-Properties");
                foreach (var automationProperty in automationElement.GetSupportedProperties())
                {
                    object value = automationElement.GetCurrentPropertyValue(automationProperty);
                    sb.AppendLine("\t"+automationProperty.ProgrammaticName+"-"+value);
                }
                sb.AppendLine("-Patterns");
                foreach (var automationPattern in automationElement.GetSupportedPatterns())
                {
                    object currentPattern = automationElement.GetCurrentPattern(automationPattern);
                    sb.AppendLine("\t"+automationPattern.ProgrammaticName+"-"+currentPattern);
                }

                if(automationElement.GetSupportedPatterns().Contains(InvokePattern.Pattern))
                {
                    ValuePattern pat = (ValuePattern)automationElement.GetCurrentPattern(ValuePattern.Pattern);

                }
            }
            return sb.ToString();
        }