C# Class SIL.FieldWorks.Common.RootSites.StringMeasureEnv

This subclass is used to estimate the total width (and max height) of all text that the display shows. Currently it only supports a rough approximation by picking one font to use throughout. Could be enhanced to consider changes in text properties. Could be much more easily made to do the right thing if we had a valid base VwEnv.
Inheritance: CollectorEnv
ファイルを表示 Open project: sillsdev/FieldWorks

Protected Properties

Property Type Description
m_font System.Drawing.Font
m_width int

Public Methods

Method Description
StringMeasureEnv ( IVwEnv baseEnv, ISilDataAccess sda, int hvoRoot, System graphics, System font ) : System

Initializes a new instance of the T:StringMeasureEnv class.

Protected Methods

Method Description
AddResultString ( string s ) : void

Accumulate a string into our result, by adding its width

AddStringWidth ( string s ) : void

update total pixel width for display

Method Details

AddResultString() protected method

Accumulate a string into our result, by adding its width
protected AddResultString ( string s ) : void
s string The s.
return void

AddStringWidth() protected method

update total pixel width for display
protected AddStringWidth ( string s ) : void
s string
return void

StringMeasureEnv() public method

Initializes a new instance of the T:StringMeasureEnv class.
public StringMeasureEnv ( IVwEnv baseEnv, ISilDataAccess sda, int hvoRoot, System graphics, System font ) : System
baseEnv IVwEnv The base env.
sda ISilDataAccess Date access to get prop values etc.
hvoRoot int The root object to display, if m_baseEnv is null. /// If baseEnv is not null, hvoRoot is ignored.
graphics System To use to measure string
font System To use to measure strings
return System

Property Details

m_font protected_oe property

protected Font,System.Drawing m_font
return System.Drawing.Font

m_width protected_oe property

total pixel width (and max height) of all text in the display
protected int m_width
return int