Inheritance: ComponentParentAdapter, Atk.ISelectionImplementor
示例#1
0
文件: Hyperlink.cs 项目: mono/uia2atk
		public Hyperlink (IRawElementProviderSimple provider) : base (provider)
		{
			invokeProvider = (IInvokeProvider)provider.GetPatternProvider (InvokePatternIdentifiers.Pattern.Id);
			hypertext = (IHypertext)invokeProvider;
			links = new List<HyperlinkObject> ();
			Role = Atk.Role.Label;
			
			textExpert = TextImplementorFactory.GetImplementor (this, provider);
		}
示例#2
0
		protected override Atk.RelationSet OnRefRelationSet ()
		{
			Atk.RelationSet relSet = base.OnRefRelationSet ();
			if (relSet == null)
				relSet = new Atk.RelationSet ();
			
			List<Atk.Relation> relsToRemove = new List<Atk.Relation> ();
			for (int i = 0; i < relSet.NRelations; i++) {
				Atk.Relation rel = relSet.GetRelation (i);
				if (relSet.GetRelation (i).RelationType == Atk.RelationType.MemberOf)
					relsToRemove.Add (rel);
			}
			foreach (Atk.Relation relation in relsToRemove)
				relSet.Remove (relation);
			
			if (Parent != null) {
				var rel = new Atk.Relation (((ComponentParentAdapter)Parent).RadioButtons.ToArray (), 
				                            Atk.RelationType.MemberOf);
				relSet.Add (rel);
			}
			return relSet;
		}
示例#3
0
		public ActionImplementorHelper ()
		{
			actions = new List <ActionDescription> ();
		}
示例#4
0
		public int GetSelectedRows (out int [] selected)
		{
			ISelectionProvider selection 
				= (ISelectionProvider) resource.Provider.GetPatternProvider (SelectionPatternIdentifiers.Pattern.Id);
			if (selection == null) {
				selected = new int [0];
				return 0;
			}

			IRawElementProviderSimple []items = selection.GetSelection ();
			List<int> selectedItems = new List <int> ();
			foreach (IRawElementProviderSimple item in items) {
				ISelectionItemProvider selectionItem 
					= (ISelectionItemProvider) item.GetPatternProvider (SelectionItemPatternIdentifiers.Pattern.Id);
				IGridItemProvider gridItem 
					= (IGridItemProvider) item.GetPatternProvider (GridItemPatternIdentifiers.Pattern.Id);
				if (selectionItem != null && gridItem != null) {
					if (selectionItem.IsSelected)
						selectedItems.Add (gridItem.Row);
				}
			}

			selected = selectedItems.ToArray ();
			return selectedItems.Count;
		}