C# Class InternalHelper.TextLibrary

Utilities used by TextPattern testing both within UIA Verify and without
显示文件 Open project: geeksree/cSharpGeeks

Public Methods

Method Description
AutomationElementFromCustomId ( AutomationElement element, object identifier, bool verbose ) : AutomationElement
CountParagraphs ( string actualText ) : int

Count # of LF within a TextPatternRange (provide agnostic... for now)

GetClassName ( AutomationElement autoElement ) : string

Gets ClassName property

GetClassName ( AutomationElement autoElement, string &className, string &localizedControlType ) : void

Gets ClassName and LocalizedControlType properties

IdentifySupportedTextUnits ( AutomationElement element, TextUnit &supportedTextUnits ) : void

Identifies supported text units. Some units will map upwards TextUnit.Page, for example, maps up to a Document for all controls/providers except Word/Office

IsRichEdit ( AutomationElement autoElement ) : bool

Identify if we're on RichEdit control or not

ProviderSupportedTextSelection ( ) : SupportedTextSelection

Does underlying application / provider support text selection ? - Win32: Yes. Always - Avalon: ??? (likely yes, always) - Trident: Yes, no, maybe. See TextPattern spec for variatances. - Office: TBD

Win32CountLines ( AutomationElement element ) : int

Private Methods

Method Description
CountTextUnit ( TextUnit tu, TextPatternRange rangeToCount ) : int
CountTrailingCRLF ( AutomationElement autoElement, TextPatternRange callingRange ) : int
GetTrailingCRLFOffset ( string text ) : int
IsMultiLine ( AutomationElement element ) : bool
SendOneKey ( System key, string msg, int sleepTime ) : void
SendThreeKeys ( System key1, System key2, System key3, string msg, int sleepTime ) : void
SendTwoKeys ( System key1, System key2, string msg, int sleepTime ) : void
SetProvider ( string _typeOfProvider ) : void
TrimRangeCRLF ( AutomationElement autoElement, TextPatternRange callingRange ) : void
Win32CountTextUnit ( TextUnit textUnit, TextPatternRange rangeToCount ) : int

Count a single TextUnit

Win32IsStyle ( AutomationElement element, int style ) : bool
win32_IdentifySupportedTextUnits ( AutomationElement element, TextUnit targetUnit ) : TextUnit

Method Details

AutomationElementFromCustomId() static public method

static public AutomationElementFromCustomId ( AutomationElement element, object identifier, bool verbose ) : AutomationElement
element System.Windows.Automation.AutomationElement
identifier object
verbose bool
return System.Windows.Automation.AutomationElement

CountParagraphs() public static method

Count # of LF within a TextPatternRange (provide agnostic... for now)
public static CountParagraphs ( string actualText ) : int
actualText string
return int

GetClassName() public static method

Gets ClassName property
public static GetClassName ( AutomationElement autoElement ) : string
autoElement System.Windows.Automation.AutomationElement
return string

GetClassName() public static method

Gets ClassName and LocalizedControlType properties
public static GetClassName ( AutomationElement autoElement, string &className, string &localizedControlType ) : void
autoElement System.Windows.Automation.AutomationElement
className string
localizedControlType string
return void

IdentifySupportedTextUnits() public static method

Identifies supported text units. Some units will map upwards TextUnit.Page, for example, maps up to a Document for all controls/providers except Word/Office
public static IdentifySupportedTextUnits ( AutomationElement element, TextUnit &supportedTextUnits ) : void
element System.Windows.Automation.AutomationElement
supportedTextUnits TextUnit
return void

IsRichEdit() public static method

Identify if we're on RichEdit control or not
public static IsRichEdit ( AutomationElement autoElement ) : bool
autoElement System.Windows.Automation.AutomationElement
return bool

ProviderSupportedTextSelection() public static method

Does underlying application / provider support text selection ? - Win32: Yes. Always - Avalon: ??? (likely yes, always) - Trident: Yes, no, maybe. See TextPattern spec for variatances. - Office: TBD
public static ProviderSupportedTextSelection ( ) : SupportedTextSelection
return SupportedTextSelection

Win32CountLines() public static method

public static Win32CountLines ( AutomationElement element ) : int
element AutomationElement
return int