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


C# TreeScope类代码示例

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


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

示例1: BuildCacheRequest

 public static CacheRequest BuildCacheRequest(TreeScope treeScope, params AutomationProperty[] properties)
 {
     var cr = new CacheRequest { TreeScope = treeScope };
      foreach (var property in properties)
     cr.Add(property);
      return cr;
 }
开发者ID:softek,项目名称:WinUIScraper,代码行数:7,代码来源:AutomationExtensions.cs

示例2: GetAllChildNodes

 public AutomationElementCollection GetAllChildNodes(AutomationElement element, AutomationProperty automationProperty, object value, TreeScope treeScope)
 {
     var allChildNodes = element.FindAll(treeScope, GetPropertyCondition(automationProperty, value));
     if (allChildNodes == null)
         throw new ElementNotAvailableException("Not able to find the child nodes of the element");
     return allChildNodes;
 }
开发者ID:prasannarhegde2015,项目名称:MySQLBackupCsharpScript,代码行数:7,代码来源:SampleUIAAutoamtion.cs

示例3: FindElementByNameFilteredByControlTypeAndMouseClick

 /// <summary>
 /// Get automationelement by name, filtered by classname - mouse click if found
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="automationName">case-insensitive automation name</param>
 /// <param name="controlType"></param>
 /// <param name="controlType2"></param>
 /// <exception cref="ApplicationException">if matching element not found</exception>
 /// <exception cref="ApplicationException">if specified element is not enabled</exception>
 public static void FindElementByNameFilteredByControlTypeAndMouseClick(AutomationElement parent, string automationName, ControlType controlType, ControlType controlType2, TimeSpan mouseClickDelay, TreeScope treeScope)
 {
     FindElementByNameFilteredByControlTypeWithTimeoutAndMouseClick(parent, automationName, controlType, controlType2,
             AddinTestUtility.FindRibbonButtonsTimeout, //findDelay
             mouseClickDelay,
             treeScope);
 }
开发者ID:brogersyh,项目名称:.NET-WindowsUI-AutomationElementsTest,代码行数:16,代码来源:UIAUtility.cs

示例4: btnProps_Click

        /// <summary>
        ///     Responds to button click; saves options and starts
        ///     the UI Automation worker thread.
        /// </summary>
        /// <param name="sender">Object that raised the event.</param>
        /// <param name="e">Event arguments.</param>
        private void btnProps_Click(object sender, EventArgs e)
        {
            // Convert Drawing.Point to Windows.Point.
            var drawingPoint = Cursor.Position;
            _targetPoint = new Point(drawingPoint.X, drawingPoint.Y);

            // Save caching settings in member variables so UI isn't accessed 
            // directly by the other thread.

            _elementMode = rbFull.Checked ? AutomationElementMode.Full : AutomationElementMode.None;

            // For simplicity, always include Element in scope.
            _cacheScope = TreeScope.Element;
            if (cbDescendants.Checked)
            {
                _cacheScope |= TreeScope.Descendants;
            }
            // Note: if descendants are specified, children 
            // are automatically included.
            else if (cbChildren.Checked)
            {
                _cacheScope |= TreeScope.Children;
            }

            _fetcher = new UiAutomationFetcher(this, _targetPoint,
                _cacheScope, _elementMode);

            // Start another thread to do the UI Automation work.
            var threadDelegate = new ThreadStart(StartWorkerThread);
            _workerThread = new Thread(threadDelegate) {Priority = ThreadPriority.Highest};
            _workerThread.Start();
            OutputResults("Wait..." + Environment.NewLine);
        }
开发者ID:blinds52,项目名称:WPF-Samples,代码行数:39,代码来源:FetchTimerForm.cs

示例5: FindAll

 internal static IEnumerable<AutomationElement> FindAll(
     AutomationElement parent, 
     TreeScope scope, 
     Condition condition)
 {
     return FindAll(parent, scope, condition, FindTimeout);
 }
开发者ID:horst14,项目名称:Winium.Cruciatus,代码行数:7,代码来源:AutomationElementHelper.cs

示例6: AddAutomationPropertyChangedEventHandler

        public static void AddAutomationPropertyChangedEventHandler(AutomationElement element, TreeScope scope, AutomationPropertyChangedEventHandler eventHandler, params AutomationProperty[] properties)
        {
            Utility.ValidateArgumentNonNull(element, "element");
            Utility.ValidateArgumentNonNull(eventHandler, "eventHandler");
            Utility.ValidateArgumentNonNull(properties, "properties");
            if (properties.Length == 0)
            {
                throw new ArgumentException("AtLeastOnePropertyMustBeSpecified");
            }
            int[] propertyIdArray = new int[properties.Length];
            for (int i = 0; i < properties.Length; ++i)
            {
                Utility.ValidateArgumentNonNull(properties[i], "properties");
                propertyIdArray[i] = properties[i].Id;
            }

            try
            {
                PropertyEventListener listener = new PropertyEventListener(AutomationElement.StructureChangedEvent, element, eventHandler);
                Factory.AddPropertyChangedEventHandler(
                    element.NativeElement,
                    (UIAutomationClient.TreeScope)scope,
                    CacheRequest.CurrentNativeCacheRequest,
                    listener,
                    propertyIdArray);
                ClientEventList.Add(listener);
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }
开发者ID:jeffras,项目名称:uiverify,代码行数:32,代码来源:Automation.cs

示例7: AddStructureChangedEventHandler

		public static void AddStructureChangedEventHandler (
			IRawElementProviderSimple provider, TreeScope scope,
			StructureChangedEventHandler eventHandler)
		{
			var entry = new StructureChangedEventEntry (provider, scope, eventHandler);
			lock (structureChangedEventEntries)
				structureChangedEventEntries.Add (entry);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:ClientEventManager.cs

示例8: TryElementByCondition

        public static AutomationElement TryElementByCondition(this AutomationElement element, TreeScope scope, Condition condition)
        {
            var result = scope == TreeScope.Parent || scope == TreeScope.Ancestors ?
                        new TreeWalker(condition).GetParent(element) :
                        element.FindFirst(scope, condition);

            return result;
        } 
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:8,代码来源:FindExtensions.cs

示例9: AddAutomationEventHandler

		public static void AddAutomationEventHandler (AutomationEvent eventId,
			IRawElementProviderSimple provider, TreeScope scope,
			AutomationEventHandler eventHandler)
		{
			var entry = new AutomationEventEntry (eventId, provider, scope, eventHandler);
			lock (automationEventEntries)
				automationEventEntries.Add (entry);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:ClientEventManager.cs

示例10: getAutomationElement

        public static AutomationElement getAutomationElement(AutomationElement parent, TreeScope scope, ControlType type, string name)
        {
            var element = parent.FindFirst(scope, new AndCondition(
                new PropertyCondition(AutomationElement.ControlTypeProperty, type),
                new PropertyCondition(AutomationElement.NameProperty, name),
                Automation.ControlViewCondition));

            return element;
        }
开发者ID:xia-sava,项目名称:PVCtrl,代码行数:9,代码来源:PvCtrlUtil.cs

示例11: UiAutomationFetcher

 /// <summary>
 ///     Constructor.
 /// </summary>
 /// <param name="form">The application form.</param>
 /// <param name="targetPoint">The screen coordinates of the cursor.</param>
 /// <param name="scope">The TreeScope for caching.</param>
 /// <param name="mode">The mode for caching.</param>
 public UiAutomationFetcher(FetchTimerForm form,
     Point targetPt,
     TreeScope scope, AutomationElementMode cacheMode)
 {
     _appForm = form;
     _treeScope = scope;
     _targetPoint = targetPt;
     _mode = cacheMode;
 }
开发者ID:GoodPICK,项目名称:WPF-Samples,代码行数:16,代码来源:uiautomationfetcher.cs

示例12: AddAutomationPropertyChangedEventHandler

		public static void AddAutomationPropertyChangedEventHandler (
			IRawElementProviderSimple provider, TreeScope scope,
			AutomationPropertyChangedEventHandler eventHandler,
			int [] properties)
		{
			var entry = new PropertyChangedEventEntry (provider, scope, properties, eventHandler);
			lock (propertyChangedEventEntries)
				propertyChangedEventEntries.Add (entry);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:9,代码来源:ClientEventManager.cs

示例13: Event

	internal static async Task<AutomationEventArgs> Event(
		AutomationEvent eventId, 
		AutomationElement element = null, 
		TreeScope scope = TreeScope.Descendants)
	{
		using (var waitr = new Waiter(eventId, element, scope))
		{
			await waitr.Completion.Task;
			return waitr.EvtArgs;
		}
	}
开发者ID:peterson1,项目名称:ErrH,代码行数:11,代码来源:WaitFor.cs

示例14: GetElement

        public AutomationElement GetElement(AutomationElement rootElement, AutomationProperty property, object value, TreeScope searchScope)
        {
            AutomationElement aeMainWindow = null;

            int numWaits = 0;
            do
            {
                aeMainWindow = rootElement.FindFirst(searchScope, new PropertyCondition(property, value));
                ++numWaits;
                Thread.Sleep(200);
            } while (aeMainWindow == null && numWaits < 50);
            return aeMainWindow;
        }
开发者ID:prasannarhegde2015,项目名称:MySQLBackupCsharpScript,代码行数:13,代码来源:SampleUIAAutoamtion.cs

示例15: AddAutomationPropertyChangedEventHandler

		public void AddAutomationPropertyChangedEventHandler (IElement element, TreeScope scope, AutomationPropertyChangedEventHandler eventHandler, AutomationProperty[] properties)
		{
			if (element == null)
				return;
			ClientElement clientElement = element as ClientElement;
			if (clientElement == null) {
				Log.Error ("[ClientAutomationSource.AddAutomationPropertyChangedEventHandler] Not ClientElement");
				return;
			}
			int [] propertyIds = Array.ConvertAll (properties, p => p.Id);
			ClientEventManager.AddAutomationPropertyChangedEventHandler (
				clientElement.Provider, scope, eventHandler, propertyIds);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:13,代码来源:ClientAutomationSource.cs


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