Mono.UIAutomation.UiaDbusSource.UiaDbusAutomationSource.GetOrCreateElement C# (CSharp) Method

GetOrCreateElement() public method

public GetOrCreateElement ( string busName, string elementPath ) : UiaDbusElement
busName string
elementPath string
return UiaDbusElement
		public UiaDbusElement GetOrCreateElement (string busName, string elementPath)
		{
			if (string.IsNullOrEmpty (elementPath) ||
			    string.IsNullOrEmpty (busName))
				return null;

			UiaDbusElement element;
			lock (elementMapping) {
				if (elementMapping.TryGetValue (new DbusElementTuple (busName, elementPath),
				                                out element))
					return element;

				DCI.IAutomationElement dbusElement =
					Bus.Session.GetObject<DCI.IAutomationElement> (busName,
					                                               new ObjectPath (elementPath));
				element = CreateElement (dbusElement, busName, elementPath);
			}
			return element;
		}

Usage Example

Beispiel #1
0
        public IElement GetDescendantFromPoint(double x, double y)
        {
            string descendantPath = null;

            try {
                descendantPath = dbusElement.GetDescendantPathFromPoint(x, y);
            } catch (Exception ex) {
                throw DbusExceptionTranslator.Translate(ex);
            }
            return(source.GetOrCreateElement(busName, descendantPath));
        }
All Usage Examples Of Mono.UIAutomation.UiaDbusSource.UiaDbusAutomationSource::GetOrCreateElement