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


C# Automation.AutomationPattern类代码示例

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


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

示例1: AutomationPatternInfo

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

        internal AutomationPatternInfo( 
            AutomationPattern id,
            WrapObject wcpWrapper)
        {
            _id = id;
            _wcpWrapper = wcpWrapper;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:15,代码来源:AutomationPatternInfo.cs

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

示例3: IsBehaviorEnabled

		protected override bool IsBehaviorEnabled (AutomationPattern pattern)
		{
			object behavior = GetPatternProvider (pattern.Id);
			if (behavior != null)
				return true;
			return base.IsBehaviorEnabled (pattern);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:FragmentControlProviderWrapper.cs

示例4: GetPatternProvider

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

        #region ProxySimple Interface

        // Returns a pattern interface if supported.
        internal override object GetPatternProvider (AutomationPattern iid)
        {
            if (iid == InvokePattern.Pattern && WindowsListView.ListViewInvokable(_hwnd))
            {
                return this;
            }

            if (iid == SelectionItemPattern.Pattern)
            {
                return this;
            }

            if (iid == ValuePattern.Pattern && WindowsListView.ListViewEditable (_hwnd))
            {
                return this;
            }

            if (iid == GridItemPattern.Pattern && IsImplementingGrid (_hwnd))
            {
                return this;
            }

            if (iid == TogglePattern.Pattern && IsItemWithCheckbox(_hwnd, _item))
            {
                return CreateListViewItemCheckbox();
            }

            if (iid == ScrollItemPattern.Pattern && WindowScroll.IsScrollable(_hwnd))
            {
                return this;
            }

            return null;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:43,代码来源:WindowsListViewItem.cs

示例5: GridItemPatternIdentifiers

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

			RowProperty =
				new AutomationProperty (RowPropertyId,
						"GridItemPatternIdentifiers.RowProperty");

			ColumnProperty =
				new AutomationProperty (ColumnPropertyId,
						"GridItemPatternIdentifiers.ColumnProperty");

			RowSpanProperty =
				new AutomationProperty (RowSpanPropertyId,
						"GridItemPatternIdentifiers.RowSpanProperty");

			ColumnSpanProperty =
				new AutomationProperty (ColumnSpanPropertyId,
						"GridItemPatternIdentifiers.ColumnSpanProperty");

			ContainingGridProperty =
				new AutomationProperty (ContainingGridPropertyId,
						"GridItemPatternIdentifiers.ContainingGridProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:26,代码来源:GridItemPatternIdentifiers.cs

示例6: GetPatternProvider

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

        #region ProxySimple Interface

        // Returns a pattern interface if supported.
        internal override object GetPatternProvider (AutomationPattern iid)
        {
            // Treate these toolbar items as menuitems and only support Invoke or Expand/Collapse patterns.
            // Invoke Pattern needs to be supported when the item has no children.  When the item does have
            // children it needs to support ExpandCollapse Pattern.

            // Check if button is a separator
            if (IsSeparator())
            {
                return null;
            }

            // Check if button is disabled
            if (Misc.ProxySendMessageInt(_hwnd, NativeMethods.TB_ISBUTTONENABLED, new IntPtr(_idCommand), IntPtr.Zero) == 0)
            {
                return null;
            }

            // Check if button is hidden
            if (Misc.ProxySendMessageInt(_hwnd, NativeMethods.TB_ISBUTTONHIDDEN, new IntPtr(_idCommand), IntPtr.Zero) != 0)
            {
                return null;
            }

            // 
            if (iid == InvokePattern.Pattern)
            {
                // button is enabled and not hidden and not a separator
                return this;
            }

            //

            return null;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:44,代码来源:WindowsToolbarItemAsMenuItem.cs

示例7: executePattern

 public void executePattern(AutomationElement subject, AutomationPattern inPattern)
 {
     switch (inPattern.ProgrammaticName)
     {
         case "InvokePatternIdentifiers.Pattern":
             {
                 InvokePattern invoke = (InvokePattern)subject.GetCurrentPattern(InvokePattern.Pattern);
                 invoke.Invoke();
                 break;
             }
         case "SelectionItemPatternIdentifiers.Pattern":
             {
                 SelectionItemPattern select = (SelectionItemPattern)subject.GetCurrentPattern(SelectionItemPattern.Pattern);
                 select.Select();
                 break;
             }
         case "TogglePatternIdentifiers.Pattern":
             {
                 TogglePattern toggle = (TogglePattern)subject.GetCurrentPattern(TogglePattern.Pattern);
                 toggle.Toggle();
                 break;
             }
         case "ExpandCollapsePatternIdentifiers.Pattern":
             {
                 ExpandCollapsePattern exColPat = (ExpandCollapsePattern)subject.GetCurrentPattern(ExpandCollapsePattern.Pattern);
                 // exColPat.Expand();
                 break;
             }
     }
 }
开发者ID:jdennis925,项目名称:guiwalker,代码行数:30,代码来源:PatternManager.cs

示例8: TryGetPattern

 protected object TryGetPattern(AutomationPattern pattern,AutomationElement elementNeedToGet = null)
 {
     elementNeedToGet = elementNeedToGet ?? this.self;
     object returnPattern;
     elementNeedToGet.TryGetCurrentPattern(pattern, out returnPattern);
     return returnPattern ?? null;
 }
开发者ID:Gnail-nehc,项目名称:Black,代码行数:7,代码来源:AEControlBase.cs

示例9: GetListItemBehaviorRealization

		public override IProviderBehavior GetListItemBehaviorRealization (AutomationPattern behavior,
		                                                                  ListItemProvider listItem)
		{
			if (behavior == TogglePatternIdentifiers.Pattern)
				return new ListItemToggleProviderBehavior (listItem);	
			else
				return base.GetListItemBehaviorRealization (behavior, listItem);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:CheckedListBoxProvider.cs

示例10: Pattern

 private object Pattern(AutomationPattern pattern) {
     try {
         return element.GetCurrentPattern(pattern);
     } catch (InvalidOperationException e) {
         ControlType type = (ControlType)element.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty);
         throw new InvalidOperationException(type.ProgrammaticName + " does not support " + pattern.ProgrammaticName, e);
     }
 }
开发者ID:kevtham,项目名称:twin,代码行数:8,代码来源:Element.cs

示例11: ProviderBehaviorEventArgs

		public ProviderBehaviorEventArgs (IProviderBehavior behavior,
		                                  AutomationPattern pattern,
		                                  bool replaced)
		{
			this.replaced = replaced;
			this.behavior = behavior;
			this.pattern = pattern;
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:ProviderBehaviorEventArgs.cs

示例12: DockPatternIdentifiers

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

示例13: AutomationPatternInfo

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

        public AutomationPatternInfo( 
            AutomationPattern id,
            AutomationProperty [ ] properties,
            WrapObjectClientSide clientSideWrapper )
        {
            _id = id;
            _properties = properties;
            _clientSideWrapper = clientSideWrapper;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:17,代码来源:AutomationPatternInfo.cs

示例14: InvokePatternIdentifiers

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

示例15: TogglePatternIdentifiers

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


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