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


C# Automation.AutomationEvent类代码示例

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


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

示例1: AdviseEventAdded

        //------------------------------------------------------
        //
        //  Patterns Implementation
        //
        //------------------------------------------------------

        #region ProxyHwnd Methods

        // ------------------------------------------------------
        //
        // Internal Methods
        //
        // ------------------------------------------------------

        // Advises proxy that an event has been added.
        // Maps the Automation Events into WinEvents and add those to the list of WinEvents notification hooks
        internal virtual void AdviseEventAdded (AutomationEvent eventId, AutomationProperty [] aidProps)
        {
            // No RawElementBase creation callback, exit from here
            if (_createOnEvent == null)
            {
                return;
            }

            int cEvents = 0;
            WinEventTracker.EvtIdProperty [] aEvents;

            // Gets an Array of WinEvents to trap on a per window handle basis
            if (eventId == AutomationElement.AutomationPropertyChangedEvent)
            {
                aEvents = PropertyToWinEvent (aidProps, out cEvents);
            }
            else
            {
                aEvents = EventToWinEvent (eventId, out cEvents);
            }

            // If we have WinEvents to trap, add those to the list of WinEvent
            // notification list
            if (cEvents > 0)
            {
                WinEventTracker.AddToNotificationList (_hwnd, _createOnEvent, aEvents, cEvents);
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:44,代码来源:ProxyHwnd.cs

示例2: RaiseAutomationEvent

		public void RaiseAutomationEvent (AutomationEvent eventId, object provider, AutomationEventArgs e)
		{
			var providerSimple = provider as IRawElementProviderSimple;
			if (providerSimple == null)
				return;
			ClientEventManager.RaiseAutomationEvent (eventId, providerSimple, e);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:ClientAutomationBridge.cs

示例3: WindowPatternIdentifiers

		static WindowPatternIdentifiers ()
		{
			Pattern =
				new AutomationPattern (PatternId,
				                       "WindowPatternIdentifiers.Pattern");
			CanMaximizeProperty =
				new AutomationProperty (CanMaximizePropertyId,
				                        "WindowPatternIdentifiers.CanMaximizeProperty");
			CanMinimizeProperty =
				new AutomationProperty (CanMinimizePropertyId,
				                        "WindowPatternIdentifiers.CanMinimizeProperty");
			IsModalProperty =
				new AutomationProperty (IsModalPropertyId,
				                        "WindowPatternIdentifiers.IsModalProperty");
			IsTopmostProperty =
				new AutomationProperty (IsTopmostPropertyId,
				                        "WindowPatternIdentifiers.IsTopmostProperty");
			WindowInteractionStateProperty =
				new AutomationProperty (WindowInteractionStatePropertyId,
				                        "WindowPatternIdentifiers.WindowInteractionStateProperty");
			WindowVisualStateProperty =
				new AutomationProperty (WindowVisualStatePropertyId,
				                        "WindowPatternIdentifiers.WindowVisualStateProperty");
			WindowClosedEvent =
				new AutomationEvent (WindowClosedEventId,
				                     "WindowPatternIdentifiers.WindowClosedProperty");
			WindowOpenedEvent =
				new AutomationEvent (WindowOpenedEventId,
				                     "WindowPatternIdentifiers.WindowOpenedProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:30,代码来源:WindowPatternIdentifiers.cs

示例4: RemoveAutomationEventHandler

		public static void RemoveAutomationEventHandler (AutomationEvent eventId, IRawElementProviderSimple provider, AutomationEventHandler eventHandler)
		{
			lock (automationEventEntries)
				automationEventEntries.RemoveAll (e =>
					e.EventId == eventId &&
					e.Provider == provider &&
					e.Handler == eventHandler);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:ClientEventManager.cs

示例5: 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

示例6: RaiseAutomationEvent

		public override void RaiseAutomationEvent (AutomationEvent eventId, AutomationEventArgs e)
		{
			if (eventId == GridPatternIdentifiers.ColumnReorderedEvent)
				EmitSignal ("column_reordered");
			else
				base.RaiseAutomationEvent (eventId, e);
			// TODO
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:Table.cs

示例7: RaiseAutomationEvent

		public override void RaiseAutomationEvent (AutomationEvent eventId, AutomationEventArgs e)
		{
			if (eventId != AutomationElementIdentifiers.MenuClosedEvent)
				base.RaiseAutomationEvent (eventId, e);

			TopLevelRootItem.Instance.RemoveChild (Parent);
			((ParentAdapter)Parent).RemoveChild (this);
			AutomationBridge.HandleTotalElementRemoval (this.Provider);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:9,代码来源:ContextMenu.cs

示例8: InvokePatternIdentifiers

		static InvokePatternIdentifiers ()
		{
			InvokedEvent =
				new AutomationEvent (InvokedEventId, 
				                     "InvokePatternIdentifiers.InvokedEvent");
			Pattern =
				new AutomationPattern (PatternId,
				                       "InvokePatternIdentifiers.Pattern");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:9,代码来源:InvokePatternIdentifiers.cs

示例9: RaiseAutomationEvent

		public override void RaiseAutomationEvent (AutomationEvent eventId, AutomationEventArgs e)
		{
			if (eventId == AutomationElementIdentifiers.AsyncContentLoadedEvent) {
				// TODO: Handle AsyncContentLoadedEvent
			} else if (eventId == AutomationElementIdentifiers.StructureChangedEvent) {
				// TODO: Handle StructureChangedEvent
			}
			else
				base.RaiseAutomationEvent (eventId, e);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:Container.cs

示例10: 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

示例11: AddAutomationEventHandler

		public void AddAutomationEventHandler (AutomationEvent eventId, IElement element, TreeScope scope, AutomationEventHandler eventHandler)
		{
			if (element == null)
				// elements from local providers are not descendants of the RootElement.
				return;
			ClientElement clientElement = element as ClientElement;
			if (clientElement == null) {
				Log.Error ("[ClientAutomationSource.AddAutomationEventHandler] Not ClientElement");
				return;
			}
			ClientEventManager.AddAutomationEventHandler (eventId,
				clientElement.Provider, scope, eventHandler);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:13,代码来源:ClientAutomationSource.cs

示例12: EventListener

        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------
 
        #region Constructors

        // full ctor
        internal EventListener(
            AutomationEvent eventId, 
            TreeScope scope, 
            AutomationProperty [] properties,
            UiaCoreApi.UiaCacheRequest cacheRequest
            )
        {
            _eventId = eventId;
            _scope = scope;
            if (properties != null)
                _properties = (AutomationProperty[])properties.Clone();
            else
                _properties = null;
            _cacheRequest = cacheRequest;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:24,代码来源:EventListener.cs

示例13: AddEventHandler

        private void AddEventHandler(
			AutomationEvent automationEvent,
			AutomationEventHandler eventHandler)
        {
            _currentElement = AutomationElement.FocusedElement;
            if (_currentElement != null)
            {
                Automation.AddAutomationEventHandler(
                    automationEvent,
                    _currentElement,
                    TreeScope.Element,
                    eventHandler);
            }
            else
                this.UiFeedback("(no element)");
        }
开发者ID:jfbosch,项目名称:Tsillah,代码行数:16,代码来源:MainForm.cs

示例14: GridPatternIdentifiers

		static GridPatternIdentifiers ()
		{
			Pattern =
				new AutomationPattern (PatternId,
						"GridPatternIdentifiers.Pattern");

			RowCountProperty =
				new AutomationProperty (RowCountPropertyId,
						"GridPatternIdentifiers.RowCountProperty");

			ColumnCountProperty =
				new AutomationProperty (ColumnCountPropertyId,
						"GridPatternIdentifiers.ColumnCountProperty");
			ColumnReorderedEvent =
				new AutomationEvent (ColumnReorderedEventId,
				                     "GridPatternIdentifiers.ColumnReorderedEvent");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:17,代码来源:GridPatternIdentifiers.cs

示例15: Remove

 public static EventListener Remove(AutomationEvent eventId, AutomationElement element, Delegate handler)
 {
     // Create a prototype to seek
     int[] runtimeId = (element == null) ? null : element.GetRuntimeId();
     EventListener prototype = new EventListener(eventId.Id, runtimeId, handler);
     lock (_events)
     {
         LinkedListNode<EventListener> node = _events.Find(prototype);
         if (node == null)
         {
             throw new ArgumentException("event handler not found");
         }
         EventListener result = node.Value;
         _events.Remove(node);
         return result;
     }
 }
开发者ID:van800,项目名称:UIAComWrapper,代码行数:17,代码来源:ClientEventList.cs


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