当前位置: 首页>>代码示例>>C#>>正文


C# IUiElement类代码示例

本文整理汇总了C#中IUiElement的典型用法代码示例。如果您正苦于以下问题:C# IUiElement类的具体用法?C# IUiElement怎么用?C# IUiElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IUiElement类属于命名空间,在下文中一共展示了IUiElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveAutomationEventHandler

 public void RemoveAutomationEventHandler(classic.AutomationEvent eventId, IUiElement element, classic.AutomationEventHandler eventHandler)
 {
     classic.Automation.RemoveAutomationEventHandler(
         eventId,
         element.GetSourceElement() as classic.AutomationElement,
         eventHandler);
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:7,代码来源:UiaAutomation.cs

示例2: ConvertElementToSearchCriteria

 protected internal string ConvertElementToSearchCriteria(IUiElement element)
 {
     string result = "@{";
     result += GetPropertyCompleteString(element, result, "Name");
     result += GetPropertyCompleteString(element, result, "AutomationId");
     result += GetPropertyCompleteString(element, result, "ControlType");
     result += GetPropertyCompleteString(element, result, "Class");
     result += GetPropertyCompleteString(element, result, "AcceleratorKey");
     result += GetPropertyCompleteString(element, result, "AccessKey");
     result += GetPropertyCompleteString(element, result, "BoundingRectangle");
     result += GetPropertyCompleteString(element, result, "FrameworkId");
     result += GetPropertyCompleteString(element, result, "HasKeyboardFocus");
     result += GetPropertyCompleteString(element, result, "HelpText");
     result += GetPropertyCompleteString(element, result, "IsContentElement");
     result += GetPropertyCompleteString(element, result, "IsControlElement");
     result += GetPropertyCompleteString(element, result, "IsEnabled");
     result += GetPropertyCompleteString(element, result, "IsKeyboardFocusable");
     result += GetPropertyCompleteString(element, result, "IsOffscreen");
     result += GetPropertyCompleteString(element, result, "IsPassword");
     result += GetPropertyCompleteString(element, result, "IsRequiredForForm");
     result += GetPropertyCompleteString(element, result, "ItemStatus");
     result += GetPropertyCompleteString(element, result, "ItemType");
     //result += getPropertyCompleteString(inputObject, result, "LabeledBy");
     result += GetPropertyCompleteString(element, result, "LocalizedControlType");
     result += GetPropertyCompleteString(element, result, "NativeWindowHandle");
     result += GetPropertyCompleteString(element, result, "Orientation");
     result += GetPropertyCompleteString(element, result, "ProcessId");
     result += GetPatternStrings(element);
     result += "}";
     
     return result;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:32,代码来源:ConvertToUiaSearchCriteriaCommand.cs

示例3: CallDockPatternForGet

        internal void CallDockPatternForGet(PatternCmdletBase cmdlet, IUiElement control, IUiElement inputObject)
        {
            try {
                WriteObject(this, control.GetDockPosition());
            } catch (Exception) {
                WriteObject(this, false);
                // throw;
            }
//            //dockPattern.Current.DockPosition
//            try {
//                // 20131208
//                // DockPattern dockPattern = control.GetCurrentPattern(classic.DockPattern.Pattern) as DockPattern;
//                // DockPattern dockPattern = control.GetCurrentPattern<IDockPattern, DockPattern>(classic.DockPattern.Pattern) as DockPattern;
//                IDockPattern dockPattern = control.GetCurrentPattern<IDockPattern>(classic.DockPattern.Pattern);
//                if (null != dockPattern) {
//                    WriteObject(this, dockPattern.Current.DockPosition);
//                } else {
//                    WriteVerbose(this, "couldn't get DockPattern");
//                    WriteObject(this, false);
//                }
//            }
//            catch {
//                
//            }
        }
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:25,代码来源:PatternCmdletBase.cs

示例4: AddAutomationPropertyChangedEventHandler

 public void AddAutomationPropertyChangedEventHandler(IUiElement element, classic.TreeScope scope, classic.AutomationPropertyChangedEventHandler eventHandler, params classic.AutomationProperty[] properties)
 {
     classic.Automation.AddAutomationPropertyChangedEventHandler(
         element.GetSourceElement() as classic.AutomationElement,
         scope,
         eventHandler,
         properties);
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:8,代码来源:UiaAutomation.cs

示例5: AddAutomationEventHandler

 public void AddAutomationEventHandler(classic.AutomationEvent eventId, IUiElement element, classic.TreeScope scope, classic.AutomationEventHandler eventHandler)
 {
     classic.Automation.AddAutomationEventHandler(
         eventId,
         element.GetSourceElement() as classic.AutomationElement,
         scope,
         eventHandler);
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:8,代码来源:UiaAutomation.cs

示例6: GetResultList_ExactSearch

 public static List<IUiElement> GetResultList_ExactSearch(IUiElement element, Condition conditions, Hashtable[] searchCriteria)
 {
     var resultListOfControls =
         ControlSearcher.SearchByExactConditionsViaUia(
             element,
             searchCriteria,
             conditions);
     return resultListOfControls;
 }
开发者ID:universsky,项目名称:STUPS,代码行数:9,代码来源:RealCodeCaller.cs

示例7: GetResultList_ViaWildcards

 public static List<IUiElement> GetResultList_ViaWildcards(IUiElement element, Condition condition, ControlSearcherData data)
 {
     List<IUiElement> resultList =
         ControlSearcher.SearchByWildcardOrRegexViaUia(
             element,
             data,
             condition,
             true);
     
     return resultList;
 }
开发者ID:universsky,项目名称:STUPS,代码行数:11,代码来源:RealCodeCaller.cs

示例8: WritingAvailablePatterns

        public static string WritingAvailablePatterns(IUiElement element)
        {
            string resultString = string.Empty;
            
            try {
                resultString = "available patterns";
                resultString += "\r\n";
                
                // 20120618 UiaCOMWrapper
                // 20131209
                // AutomationPattern[] supportedPatterns =
                //     element.GetSupportedPatterns();
                
                IBasePattern[] supportedPatterns =
                    element.GetSupportedPatterns();
                //UiaCOM::System.Windows.Automation.AutomationPattern[] supportedPatterns =
                //    element.GetSupportedPatterns();                                    

                if (supportedPatterns == null || supportedPatterns.Length <= 0) return resultString;
                
                for (int i = 0; i < supportedPatterns.Length; i++) {
                    if (i > 0) {
                        resultString += "\r\n";
                    }
                    
                    resultString +=
                        // 20131209
                        // supportedPatterns[i].ProgrammaticName.Replace("Identifiers.Pattern", "");
                        // 20131210
                        // (supportedPatterns[i] as AutomationPattern).ProgrammaticName.Replace("Identifiers.Pattern", "");
                        // (supportedPatterns[i].SourcePattern as AutomationPattern).ProgrammaticName.Replace("Identifiers.Pattern", "");
                        // 20140112
                        // (supportedPatterns[i].GetSourcePattern() as AutomationPattern).ProgrammaticName.Replace("Identifiers.Pattern", string.Empty);
                        supportedPatterns[i].GetType().Name.Substring(3);
                }

                /*
                if (supportedPatterns != null &&
                    supportedPatterns.Length > 0) {
                    for (int i = 0; i < supportedPatterns.Length; i++) {
                        if (i > 0) {
                            this.richPatterns.Text += "\r\n";
                        }
                        this.richPatterns.Text += 
                            supportedPatterns[i].ProgrammaticName.Replace("Identifiers.Pattern", "");
                    }
                }
                */
               return resultString;
            }
            catch {
                return resultString;
            }
        }
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:54,代码来源:ExSpyCode.cs

示例9: SearchByContainsTextViaWin32

 public static List<IUiElement> SearchByContainsTextViaWin32(
 	IUiElement inputObject,
     string containsText,
     string[] controlTypeNames,
     IEnumerable<IUiElement> collection,
     IEnumerable<int> handles)
 {
 	var singleControlSearcherData = new SingleControlSearcherData { Name = containsText, ControlType = controlTypeNames };
 	var controlProvider = FakeFactory.GetControlFromWin32Provider_old(collection, singleControlSearcherData);
 	
 	controlProvider.HandleCollector = FakeFactory.GetHandleCollector(inputObject, new int[] {}, collection.ToArray());
 	return ControlSearcher.SearchByContainsTextViaWin32(inputObject, controlProvider).ToList();
 }
开发者ID:universsky,项目名称:STUPS,代码行数:13,代码来源:RealCodeCaller.cs

示例10: GetControlCmdletBase

 public GetControlCmdletBase()
 {
     Class = string.Empty;
     Name = string.Empty;
     AutomationId = string.Empty;
     Value = string.Empty;
     
     InputObject =
         new IUiElement[] { CurrentData.CurrentWindow };
     
     // CacheRequest
     FromCache = Preferences.FromCache;
     
     Regex = false;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:15,代码来源:GetControlCmdletBase.cs

示例11: GetResultList_ViaWildcards_Legacy

 public static List<IUiElement> GetResultList_ViaWildcards_Legacy(IUiElement element, Condition condition, ControlSearcherData data)
 {
     var cmdletDerived = new GetControlCollectionCmdletBase();
     
     List<IUiElement> resultList =
         cmdletDerived.GetAutomationElementsWithFindAll(
             element,
             data,
             condition,
             false,
             false,
             false,
             true);
     
     return resultList;
 }
开发者ID:universsky,项目名称:STUPS,代码行数:16,代码来源:RealCodeCaller.cs

示例12: Buttons_Descendants_None

 public void Buttons_Descendants_None()
 {
     // Arrange
     var elements = new IUiElement[] {};
     IUiElement element =
         FakeFactory.GetElement_ForFindAll(
             elements,
             new PropertyCondition(
                 AutomationElement.ControlTypeProperty,
                 ControlType.Button));
     
     // Act
     var resultCollection = ((element as ISupportsExtendedModel).Descendants as IExtendedModel).Buttons;
     
     // Assert
     MbUnit.Framework.Assert.AreEqual(AutomationFactory.GetUiEltCollection(elements), resultCollection);
     Xunit.Assert.Equal(AutomationFactory.GetUiEltCollection(elements), resultCollection);
 }
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:18,代码来源:ISupportsExtendedModelTestFixture.cs

示例13: TestElementsCollectionOfCertainType

 private IUiElement TestElementsCollectionOfCertainType(ControlType controlType, out IUiElement[] elements)
 {
     // Arrange
     IUiElement[] elementsArray =
         new[] {
             FakeFactory.GetAutomationElementExpected(controlType, string.Empty, string.Empty, string.Empty, string.Empty),
             FakeFactory.GetAutomationElementExpected(controlType, string.Empty, string.Empty, string.Empty, string.Empty),
             FakeFactory.GetAutomationElementExpected(controlType, string.Empty, string.Empty, string.Empty, string.Empty)
         };
     elements = elementsArray;
     IUiElement element =
         FakeFactory.GetElement_ForFindAll(
             elements,
             new PropertyCondition(
                 AutomationElement.ControlTypeProperty,
                 controlType));
     
     return element;
 }
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:19,代码来源:ISupportsExtendedModelTestFixture.cs

示例14: CollectRecursively

 public virtual List<IntPtr> CollectRecursively(
     IUiElement containerElement,
     string name,
     int level)
 {
     var resultHandle = IntPtr.Zero;
     var controlHandle = IntPtr.Zero;
     var controlHandles = new List<IntPtr>();
     var tempControlHandles = new List<IntPtr>();
     // 20140312
     // var containerHandle = new IntPtr(containerElement.Current.NativeWindowHandle);
     var containerHandle = new IntPtr(containerElement.GetCurrent().NativeWindowHandle);
     
     if (containerHandle == IntPtr.Zero) return controlHandles;
     
     // search at this level
     do {
         // using null instead of name
         controlHandle =
             NativeMethods.FindWindowEx(containerHandle, controlHandle, null, null);
         
         if (controlHandle == IntPtr.Zero) continue;
         controlHandles.Add(controlHandle);
         
         tempControlHandles =
             CollectRecursively(
                 UiElement.FromHandle(controlHandle),
                 name,
                 level + 1);
         
         if (null == tempControlHandles || 0 == tempControlHandles.Count) continue;
         controlHandles.AddRange(tempControlHandles);
         
     } while (controlHandle != IntPtr.Zero);
     
     return controlHandles;
 }
开发者ID:apetrovskiy,项目名称:STUPS,代码行数:37,代码来源:HandleCollector.cs

示例15: UiaSelectionPattern

 public UiaSelectionPattern(IUiElement element)
 {
     this._element = element;
 }
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:4,代码来源:UiaSelectionPattern.cs


注:本文中的IUiElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。