C# Class SIL.CoreImpl.PalasoWritingSystemManager

Inheritance: IWritingSystemManager
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Méthodes publiques

Méthode Description
CanSave ( IWritingSystem ws, string &path ) : bool

Return true if we expect (absent pathological changes while we're not looking) to be able to save changes to this writing system.

CheckForNewerGlobalWritingSystems ( ) : IEnumerable

Gets all newer shared writing systems.

Create ( LanguageSubtag languageSubtag, ScriptSubtag scriptSubtag, RegionSubtag regionSubtag, VariantSubtag variantSubtag ) : IWritingSystem

Creates a new writing system.

Create ( string identifier ) : IWritingSystem

Creates a new writing system.

CreateFrom ( IWritingSystem ws ) : IWritingSystem

Creates a copy of the specified writing system.

Exists ( int handle ) : bool

Determines if a writing system exists with the specified handle.

Exists ( string identifier ) : bool

Determines if a writing system exists with the specified RFC5646 identifier.

Get ( int handle ) : IWritingSystem

Gets the writing system with the specified handle.

Get ( string identifier ) : IWritingSystem

Gets the specified writing system. Throws KeyNotFoundException if it can not be found, there is a TryGet available to avoid this.

GetOrSet ( string identifier, IWritingSystem &ws ) : bool

Gets the specified writing system if it exists, otherwise it creates a writing system using the specified identifier and sets it.

GetStrFromWs ( int handle ) : string

Gets the RFC5646 identifier from the handle.

GetValidLangTagForNewLang ( string langName ) : string

Returns an ISO 639 language tag that is guaranteed to be valid and unique for both the local and the global writing system store. NOTE: This method should only be used for writing systems that are custom (i.e. not defined in the current version of the ethnologue). The returned code will *not* have the 'x-' prefix denoting a user-defined writing system, but it will check that an existing user-defined writing system does not exist with the returned language tag. This method also does not worry about regions, variants, etc. as it's use is restricted to the language tag for a custom writing system.

GetWritingSystems ( SIL.FieldWorks.Common.COMInterfaces.ArrayPtr rgws, int cws ) : void

Get the list of writing systems currrently installed in the system.

GetWsFromStr ( string identifier ) : int

Gets the HVO from the RFC5646 identifier.

PalasoWritingSystemManager ( ) : System

Initializes a new instance of the PalasoWritingSystemManager class.

PalasoWritingSystemManager ( IFwWritingSystemStore store ) : System

Initializes a new instance of the PalasoWritingSystemManager class.

PalasoWritingSystemManager ( IFwWritingSystemStore localStore, IFwWritingSystemStore globalStore ) : System

Initializes a new instance of the PalasoWritingSystemManager class.

localStore and globalStore will be disposed by the PalasoWritingSystemManager!

Replace ( IWritingSystem ws ) : void

Replaces an existing writing system with the specified writing system if they have the same identifier.

Save ( ) : void

Persists all modified writing systems.

Set ( string identifier ) : IWritingSystem

Creates a writing system using the specified identifier and sets it.

Set ( IWritingSystem ws ) : void

Sets the specified writing system.

TryGet ( string identifier, IWritingSystem &ws ) : bool

Gets the specified writing system if it exists.

TryGetOrSet ( string identifier, IWritingSystem &ws ) : bool

Gets the specified writing system if it exists, otherwise it creates a writing system using the specified identifier and sets it.

get_CharPropEngine ( int ws ) : ILgCharacterPropertyEngine

Get the char prop engine for a particular WS

get_Engine ( string bstrIdentifier ) : ILgWritingSystem

Get the actual writing system object for a given ICU Locale string. The current implementation returns any existing writing system for that ICU Locale, or creates one with default settings if one is not already known. (Use get_EngineOrNull to avoid automatic creation of a new engine.)

get_EngineOrNull ( int ws ) : ILgWritingSystem

Get the actual writing system object for a given code, or returns NULL if one does not already exist. (Use get_Engine if you prefer to have an writing system created automatically if one does not already exist.)

get_Renderer ( int ws, IVwGraphics vg ) : IRenderEngine

Get the renderer for a particular WS

get_RendererFromChrp ( IVwGraphics vg, LgCharRenderProps &chrp ) : IRenderEngine

Get the renderer for a particular Chrp

Méthodes protégées

Méthode Description
UnionSettingsKeyboardsWithLocalStore ( ) : string

Performs the Union of Settings.Default.LocalKeyboards and m_localStore.LocalKeyboardSettings and returns the result as an XML string. Protected for tests.

Private Methods

Méthode Description
LangTagInUse ( string identifier ) : bool

Determines whether or not the specified language tag is in use by another writing system in either the local or global writing system store.

RegisterRenderEngine ( IRenderEngine engine ) : void
Set ( string identifier, bool &foundExisting ) : IWritingSystem

Create the writing system. Typically we will create it, but we may have to modify the ID and then find that there is an existing one. Set foundExisting true if so.

Method Details

CanSave() public méthode

Return true if we expect (absent pathological changes while we're not looking) to be able to save changes to this writing system.
public CanSave ( IWritingSystem ws, string &path ) : bool
ws IWritingSystem
path string
Résultat bool

CheckForNewerGlobalWritingSystems() public méthode

Gets all newer shared writing systems.
public CheckForNewerGlobalWritingSystems ( ) : IEnumerable
Résultat IEnumerable

Create() public méthode

Creates a new writing system.
public Create ( LanguageSubtag languageSubtag, ScriptSubtag scriptSubtag, RegionSubtag regionSubtag, VariantSubtag variantSubtag ) : IWritingSystem
languageSubtag LanguageSubtag The language subtag.
scriptSubtag ScriptSubtag The script subtag.
regionSubtag RegionSubtag The region subtag.
variantSubtag VariantSubtag The variant subtag.
Résultat IWritingSystem

Create() public méthode

Creates a new writing system.
public Create ( string identifier ) : IWritingSystem
identifier string
Résultat IWritingSystem

CreateFrom() public méthode

Creates a copy of the specified writing system.
public CreateFrom ( IWritingSystem ws ) : IWritingSystem
ws IWritingSystem The writing system.
Résultat IWritingSystem

Exists() public méthode

Determines if a writing system exists with the specified handle.
public Exists ( int handle ) : bool
handle int The handle.
Résultat bool

Exists() public méthode

Determines if a writing system exists with the specified RFC5646 identifier.
public Exists ( string identifier ) : bool
identifier string The identifier.
Résultat bool

Get() public méthode

Gets the writing system with the specified handle.
public Get ( int handle ) : IWritingSystem
handle int The handle.
Résultat IWritingSystem

Get() public méthode

Gets the specified writing system. Throws KeyNotFoundException if it can not be found, there is a TryGet available to avoid this.
public Get ( string identifier ) : IWritingSystem
identifier string The identifier.
Résultat IWritingSystem

GetOrSet() public méthode

Gets the specified writing system if it exists, otherwise it creates a writing system using the specified identifier and sets it.
public GetOrSet ( string identifier, IWritingSystem &ws ) : bool
identifier string The identifier.
ws IWritingSystem The writing system.
Résultat bool

GetStrFromWs() public méthode

Gets the RFC5646 identifier from the handle.
public GetStrFromWs ( int handle ) : string
handle int The handle.
Résultat string

GetValidLangTagForNewLang() public méthode

Returns an ISO 639 language tag that is guaranteed to be valid and unique for both the local and the global writing system store. NOTE: This method should only be used for writing systems that are custom (i.e. not defined in the current version of the ethnologue). The returned code will *not* have the 'x-' prefix denoting a user-defined writing system, but it will check that an existing user-defined writing system does not exist with the returned language tag. This method also does not worry about regions, variants, etc. as it's use is restricted to the language tag for a custom writing system.
public GetValidLangTagForNewLang ( string langName ) : string
langName string The full name of the language.
Résultat string

GetWritingSystems() public méthode

Get the list of writing systems currrently installed in the system.
public GetWritingSystems ( SIL.FieldWorks.Common.COMInterfaces.ArrayPtr rgws, int cws ) : void
rgws SIL.FieldWorks.Common.COMInterfaces.ArrayPtr
cws int
Résultat void

GetWsFromStr() public méthode

Gets the HVO from the RFC5646 identifier.
public GetWsFromStr ( string identifier ) : int
identifier string The identifier.
Résultat int

PalasoWritingSystemManager() public méthode

Initializes a new instance of the PalasoWritingSystemManager class.
public PalasoWritingSystemManager ( ) : System
Résultat System

PalasoWritingSystemManager() public méthode

Initializes a new instance of the PalasoWritingSystemManager class.
public PalasoWritingSystemManager ( IFwWritingSystemStore store ) : System
store IFwWritingSystemStore The store.
Résultat System

PalasoWritingSystemManager() public méthode

Initializes a new instance of the PalasoWritingSystemManager class.
localStore and globalStore will be disposed by the PalasoWritingSystemManager!
public PalasoWritingSystemManager ( IFwWritingSystemStore localStore, IFwWritingSystemStore globalStore ) : System
localStore IFwWritingSystemStore The local store.
globalStore IFwWritingSystemStore The global store.
Résultat System

Replace() public méthode

Replaces an existing writing system with the specified writing system if they have the same identifier.
public Replace ( IWritingSystem ws ) : void
ws IWritingSystem The writing system.
Résultat void

Save() public méthode

Persists all modified writing systems.
public Save ( ) : void
Résultat void

Set() public méthode

Creates a writing system using the specified identifier and sets it.
public Set ( string identifier ) : IWritingSystem
identifier string The identifier.
Résultat IWritingSystem

Set() public méthode

Sets the specified writing system.
public Set ( IWritingSystem ws ) : void
ws IWritingSystem The writing system.
Résultat void

TryGet() public méthode

Gets the specified writing system if it exists.
public TryGet ( string identifier, IWritingSystem &ws ) : bool
identifier string The identifier.
ws IWritingSystem The writing system.
Résultat bool

TryGetOrSet() public méthode

Gets the specified writing system if it exists, otherwise it creates a writing system using the specified identifier and sets it.
public TryGetOrSet ( string identifier, IWritingSystem &ws ) : bool
identifier string The identifier.
ws IWritingSystem The writing system.
Résultat bool

UnionSettingsKeyboardsWithLocalStore() protected méthode

Performs the Union of Settings.Default.LocalKeyboards and m_localStore.LocalKeyboardSettings and returns the result as an XML string. Protected for tests.
protected UnionSettingsKeyboardsWithLocalStore ( ) : string
Résultat string

get_CharPropEngine() public méthode

Get the char prop engine for a particular WS
public get_CharPropEngine ( int ws ) : ILgCharacterPropertyEngine
ws int
Résultat ILgCharacterPropertyEngine

get_Engine() public méthode

Get the actual writing system object for a given ICU Locale string. The current implementation returns any existing writing system for that ICU Locale, or creates one with default settings if one is not already known. (Use get_EngineOrNull to avoid automatic creation of a new engine.)
public get_Engine ( string bstrIdentifier ) : ILgWritingSystem
bstrIdentifier string The identifier.
Résultat ILgWritingSystem

get_EngineOrNull() public méthode

Get the actual writing system object for a given code, or returns NULL if one does not already exist. (Use get_Engine if you prefer to have an writing system created automatically if one does not already exist.)
public get_EngineOrNull ( int ws ) : ILgWritingSystem
ws int
Résultat ILgWritingSystem

get_Renderer() public méthode

Get the renderer for a particular WS
public get_Renderer ( int ws, IVwGraphics vg ) : IRenderEngine
ws int
vg IVwGraphics
Résultat IRenderEngine

get_RendererFromChrp() public méthode

Get the renderer for a particular Chrp
public get_RendererFromChrp ( IVwGraphics vg, LgCharRenderProps &chrp ) : IRenderEngine
vg IVwGraphics
chrp LgCharRenderProps
Résultat IRenderEngine