209 references to Misc
UIAutomationClient (209)
MS\Internal\Automation\Accessible.cs (1)
126&& Misc.IsCriticalException(e);
MS\Internal\Automation\BoundingRectTracker.cs (1)
99if (!Misc.GetWindowRect(nativeHwnd, out rc32))
MS\Internal\Automation\EventListenerClientSide.cs (9)
108if( !Misc.Compare( _refRid, rid ) ) 125Misc.Compare(_refRid, AutomationElement.RootElement.GetRuntimeId())) 139if ((_eventListener.TreeScope & TreeScope.Element) != 0 && Misc.Compare(el, elThis)) 150if (elParent != null && Misc.Compare(elParent, elThis)) 158if (elParent != null && Misc.Compare(elParent, el)) 182Misc.Compare(_refRid, AutomationElement.RootElement.GetRuntimeId())) 196if ( Misc.Compare( rid, _refRid ) ) 274if( ! Misc.Compare( el, elPossibleParent ) ) 279if( Misc.Compare( elPossibleChild, elPossibleParent ) )
MS\Internal\Automation\FocusTracker.cs (4)
200if( Misc.IsCriticalException( e ) ) 269if( Misc.IsCriticalException( e ) ) 302IntPtr i = Misc.SendMessageTimeout(NativeMethods.HWND.Cast(hwnd), UnsafeNativeMethods.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero); 324if (!Misc.GetGUIThreadInfo(0, ref guiThreadInfo))
MS\Internal\Automation\HwndProxyElementProvider.cs (62)
114int id = Misc.GetWindowLong(_hwnd, SafeNativeMethods.GWL_ID); 133IntPtr len = Misc.SendMessageTimeout( _hwnd, UnsafeNativeMethods.WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero ); 143if (Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETTEXT, new IntPtr(ilen + 1), str) == IntPtr.Zero) 149return Misc.StripMnemonic(str.ToString()); 179if (!Misc.GetGUIThreadInfo(0, ref gti)) 188return Misc.IsWindowsFormsControl(ProxyManager.GetClassName(_hwnd)) ? "WinForm" : "Win32"; 254if (!Misc.GetWindowRect(_hwnd, out rcW32)) 331if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 340if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 361if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_MINIMIZE, IntPtr.Zero)) 382if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_MAXIMIZE, IntPtr.Zero)) 404if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_CLOSE, IntPtr.Zero)) 667if (!Misc.GetWindowRect(_hwnd, out currentRect)) 691if (!Misc.GetClientRect(hwndParent, out parentRect)) 713if (!Misc.SetWindowPos(_hwnd, NativeMethods.HWND.NULL, (int)x, (int)y, 0, 0, UnsafeNativeMethods.SWP_NOSIZE | UnsafeNativeMethods.SWP_NOZORDER | UnsafeNativeMethods.SWP_NOACTIVATE)) 723if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 743if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 752if (!Misc.GetWindowRect(_hwnd, out currentRect)) 760if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 770if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 783if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 817Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETMINMAXINFO, IntPtr.Zero, ref minMaxInfo); 835if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 847if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 993bool result = Misc.GetMenuBarInfo(hwnd, idObject, idItem, ref mbi); 1161hwnd = Misc.GetWindow( hwnd, dir ); 1164for( ; hwnd != NativeMethods.HWND.NULL ; hwnd = Misc.GetWindow( hwnd, dir ) ) 1192NativeMethods.HWND scan = Misc.GetWindow(desktop, SafeNativeMethods.GW_CHILD); 1196scan = Misc.GetWindow(scan, SafeNativeMethods.GW_HWNDLAST); 1250hwnd = Misc.GetWindow(hwndOwner, SafeNativeMethods.GW_CHILD); 1317hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1339NativeMethods.HWND hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1342hwnd = Misc.GetWindow(hwnd, SafeNativeMethods.GW_HWNDLAST); 1420for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1422hChild = Misc.GetWindow(hChild, SafeNativeMethods.GW_HWNDNEXT)) 1475if (!Misc.GetWindowRect(hwnd, out rcW32)) 1518NativeMethods.HWND hwndOwner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1604NativeMethods.HWND owner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1642if (!Misc.GetGUIThreadInfo(0, ref gui)) 1731IntPtr hrgn = Misc.CreateRectRgn(0, 0, 0, 0); // NOTE: Must be deleted before returning 1740for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1742hChild = Misc.GetWindow(hChild, SafeNativeMethods.GW_HWNDNEXT)) 1750if (!Misc.GetWindowRect(hChild, out rc)) 1828IntPtr lr = Misc.SendMessageTimeout( hChild, UnsafeNativeMethods.WM_NCHITTEST, IntPtr.Zero, MAKELPARAM( (int)x, (int)y ) ); 1844if (!Misc.GetWindowRect(hChild, out rcBest)) 1854if (!Misc.GetWindowRect(hChild, out rcChild)) 1873if (!Misc.GetClientRect(hChild, out rcClient) || 1880Misc.DeleteObject(hrgn); // finished with region 1884Misc.DeleteObject(hrgn); // finished with region 1931Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 1956Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 1973int style = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_STYLE); 1984int exstyle = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_EXSTYLE); 2009IntPtr lresult = Misc.SendMessageTimeout(parent, UnsafeNativeMethods.WM_MDIACTIVATE, (IntPtr)hwnd, IntPtr.Zero); 2016short atom = Misc.GlobalAddAtom("FocusHotKey"); 2026if( Misc.RegisterHotKey( NativeMethods.HWND.NULL, atom, 0, vk ) ) 2064int result = Misc.MsgWaitForMultipleObjects(null, false, 2000, UnsafeNativeMethods.QS_ALLINPUT); 2069if (Misc.GetMessage(ref msg, NativeMethods.HWND.NULL, 0, 0) == 0) 2091Misc.UnregisterHotKey(NativeMethods.HWND.NULL, atom); 2093Misc.GlobalDeleteAtom(atom); 2105if (!Misc.GetGUIThreadInfo(0, ref gti)) 2120if (Misc.GetGUIThreadInfo(0, ref gti))
MS\Internal\Automation\Input.cs (2)
73Misc.SendInput(1, ref ki, Marshal.SizeOf(ki)); 90Misc.SendInput(1, ref ki, Marshal.SizeOf(ki));
MS\Internal\Automation\InvokeHandlers.cs (1)
110if (Misc.IsCriticalException(e))
MS\Internal\Automation\ProxyManager.cs (6)
245Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 259Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 314int instance = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_HINSTANCE); 328if (Misc.GetModuleFileNameEx(processHandle, (IntPtr)instance, sb, NativeMethods.MAX_PATH) == 0) 718if( Misc.IsCriticalException( e ) ) 809IntPtr result = Misc.SendMessageTimeout(hwnd, UnsafeNativeMethods.WM_GETOBJECT, IntPtr.Zero, (IntPtr)OBJID_QUERYCLASSNAMEIDX);
MS\Internal\Automation\QueueProcessor.cs (2)
152int result = Misc.TryMsgWaitForMultipleObjects(handle, false, UnsafeNativeMethods.INFINITE, UnsafeNativeMethods.QS_ALLINPUT, ref lastWin32Error); 181if (Misc.IsCriticalException(e))
MS\Internal\Automation\SafeProcessHandle.cs (2)
47SetHandle(Misc.OpenProcess(UnsafeNativeMethods.PROCESS_QUERY_INFORMATION | UnsafeNativeMethods.PROCESS_VM_READ, false, processId, hwnd)); 56return Misc.CloseHandle(handle);
MS\Internal\Automation\WinEventWrap.cs (2)
215if( Misc.IsCriticalException( e ) ) 230if( Misc.IsCriticalException( ex ) )
System\Windows\Automation\AndCondition.cs (3)
48Misc.ValidateArgumentNonNull( conditions, "conditions" ); 49Misc.ValidateArgument( conditions.Length >= 2, SRID.MustBeAtLeastTwoConditions ); 52Misc.ValidateArgumentNonNull( condition, "conditions" );
System\Windows\Automation\Automation.cs (27)
90return Misc.Compare(el1, el2); 108return Misc.Compare(runtimeId1, runtimeId2); 120Misc.ValidateArgumentNonNull(property, "property"); 134Misc.ValidateArgumentNonNull(pattern, "pattern"); 162Misc.ValidateArgumentNonNull(element, "element" ); 163Misc.ValidateArgumentNonNull(eventHandler, "eventHandler" ); 164Misc.ValidateArgument( eventId != AutomationElement.AutomationFocusChangedEvent, SRID.EventIdMustNotBeAutomationFocusChanged ); 165Misc.ValidateArgument( eventId != AutomationElement.StructureChangedEvent,SRID.EventIdMustNotBeStructureChanged ); 166Misc.ValidateArgument( eventId != AutomationElement.AutomationPropertyChangedEvent, SRID.EventIdMustNotBeAutomationPropertyChanged ); 177if ( Misc.Compare( element, AutomationElement.RootElement ) ) 238Misc.ValidateArgumentNonNull(element, "element" ); 239Misc.ValidateArgumentNonNull(eventHandler, "eventHandler" ); 240Misc.ValidateArgument( eventId != AutomationElement.AutomationFocusChangedEvent, SRID.EventIdMustNotBeAutomationFocusChanged ); 241Misc.ValidateArgument( eventId != AutomationElement.StructureChangedEvent, SRID.EventIdMustNotBeStructureChanged ); 242Misc.ValidateArgument( eventId != AutomationElement.AutomationPropertyChangedEvent, SRID.EventIdMustNotBeAutomationPropertyChanged ); 269Misc.ValidateArgumentNonNull(element, "element" ); 270Misc.ValidateArgumentNonNull(eventHandler, "eventHandler" ); 271Misc.ValidateArgumentNonNull(properties, "properties" ); 282Misc.ValidateArgumentNonNull(property, "properties" ); 305Misc.ValidateArgumentNonNull(element, "element" ); 306Misc.ValidateArgumentNonNull(eventHandler, "eventHandler" ); 327Misc.ValidateArgumentNonNull(element, "element"); 328Misc.ValidateArgumentNonNull(eventHandler, "eventHandler"); 348Misc.ValidateArgumentNonNull(element, "element"); 349Misc.ValidateArgumentNonNull(eventHandler, "eventHandler"); 369Misc.ValidateArgumentNonNull(eventHandler, "eventHandler" ); 392Misc.ValidateArgumentNonNull(eventHandler, "eventHandler" );
System\Windows\Automation\AutomationElement.cs (16)
313return Misc.Compare(this, el); 442Misc.ValidateArgument(hwnd != IntPtr.Zero, SRID.HwndMustBeNonNULL); 470Misc.ValidateArgumentNonNull(localImpl, "localImpl"); 523Misc.ValidateArgumentNonNull(property, "property"); 616Misc.ValidateArgumentNonNull(pattern, "pattern"); 627if (Misc.IsCriticalException(e)) 638patternObject = Misc.WrapInterfaceOnClientSide(this, hpatternobj, pattern); 693Misc.ValidateArgumentNonNull(property, "property"); 755Misc.ValidateArgumentNonNull(pattern, "pattern"); 789Misc.ValidateArgumentNonNull(request, "request"); 809Misc.ValidateArgumentNonNull(condition, "condition"); 832Misc.ValidateArgumentNonNull(condition, "condition"); 883return (AutomationProperty[])Misc.RemoveDuplicates(Misc.CombineArrays(propArrays, typeof(AutomationProperty)), typeof(AutomationProperty)); 1362val = Misc.WrapInterfaceOnClientSide(this, hpatternobj, automationPattern); 1386Misc.ValidateArgumentNonNull(condition, "condition");
System\Windows\Automation\CacheRequest.cs (3)
252Misc.ValidateArgumentNonNull(property, "property"); 270Misc.ValidateArgumentNonNull(pattern, "pattern"); 347Misc.ValidateArgumentNonNull(value, "TreeFilter");
System\Windows\Automation\ClientSettings.cs (2)
50Misc.ValidateArgumentNonNull( assemblyName, "assemblyName" ); 61Misc.ValidateArgumentNonNull(clientSideProviderDescription, "clientSideProviderDescription ");
System\Windows\Automation\DockPattern.cs (2)
116Misc.ValidateCached(_cached); 141Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ExpandCollapsePattern.cs (2)
126Misc.ValidateCached(_cached); 151Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\GridItemPattern.cs (2)
117Misc.ValidateCached(_cached); 142Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\GridPattern.cs (2)
119Misc.ValidateCached(_cached); 144Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\MultipleViewPattern.cs (2)
134Misc.ValidateCached(_cached); 159Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\NotCondition.cs (1)
44Misc.ValidateArgumentNonNull( condition, "condition" );
System\Windows\Automation\OrCondition.cs (3)
48Misc.ValidateArgumentNonNull( conditions, "conditions" ); 49Misc.ValidateArgument( conditions.Length >= 2, SRID.MustBeAtLeastTwoConditions ); 52Misc.ValidateArgumentNonNull( condition, "conditions" );
System\Windows\Automation\PropertyCondition.cs (2)
136Misc.ValidateArgumentNonNull(property, "property"); 157Misc.ValidateArgument(val is string, SRID.IgnoreCaseRequiresString);
System\Windows\Automation\RangeValuePattern.cs (2)
149Misc.ValidateCached(_cached); 174Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ScrollPattern.cs (2)
183Misc.ValidateCached(_cached); 208Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\SelectionItemPattern.cs (2)
161Misc.ValidateCached(_cached); 186Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\SelectionPattern.cs (2)
118Misc.ValidateCached(_cached); 143Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TableItemPattern.cs (2)
107Misc.ValidateCached(_cached); 132Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TablePattern.cs (2)
97Misc.ValidateCached(_cached); 122Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\Text\TextRange.cs (9)
188Misc.ValidateArgumentNonNull(attribute, "attribute"); 189Misc.ValidateArgumentNonNull(value, "value"); // no text attributes can have null as a valid value 230Misc.ValidateArgumentNonNull(text, "text"); 232Misc.ValidateArgument(text.Length != 0, SRID.TextMustNotBeNullOrEmpty); 246Misc.ValidateArgumentNonNull(attribute, "attribute"); 301Misc.ValidateArgumentInRange(maxLength >= -1, "maxLength"); 454Misc.ThrowInvalidArgument(name); 470Misc.ThrowInvalidArgument(name); 480Misc.ThrowInvalidArgument(name);
System\Windows\Automation\TextPattern.cs (1)
299return Misc.Compare(t1._element, t2._element);
System\Windows\Automation\TogglePattern.cs (2)
115Misc.ValidateCached(_cached); 140Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TransformPattern.cs (2)
158Misc.ValidateCached(_cached); 183Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TreeWalker.cs (19)
46Misc.ValidateArgumentNonNull(condition, "condition"); 98Misc.ValidateArgumentNonNull(element, "element"); 113Misc.ValidateArgumentNonNull(element, "element"); 128Misc.ValidateArgumentNonNull(element, "element"); 143Misc.ValidateArgumentNonNull(element, "element"); 158Misc.ValidateArgumentNonNull(element, "element"); 183Misc.ValidateArgumentNonNull(element, "element"); 201Misc.ValidateArgumentNonNull(element, "element"); 202Misc.ValidateArgumentNonNull(request, "request"); 219Misc.ValidateArgumentNonNull(element, "element"); 220Misc.ValidateArgumentNonNull(request, "request"); 237Misc.ValidateArgumentNonNull(element, "element"); 238Misc.ValidateArgumentNonNull(request, "request"); 255Misc.ValidateArgumentNonNull(element, "element"); 256Misc.ValidateArgumentNonNull(request, "request"); 273Misc.ValidateArgumentNonNull(element, "element"); 274Misc.ValidateArgumentNonNull(request, "request"); 301Misc.ValidateArgumentNonNull(element, "element"); 302Misc.ValidateArgumentNonNull(request, "request");
System\Windows\Automation\ValuePattern.cs (3)
88Misc.ValidateArgumentNonNull(value, "value"); 137Misc.ValidateCached(_cached); 162Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\WindowPattern.cs (2)
183Misc.ValidateCached(_cached); 208Misc.ValidateCurrent(_hPattern);