C# Class SIL.CoreImpl.GlobalFileWritingSystemStore

Inheritance: IFwWritingSystemStore
Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
CanSave ( WritingSystemDefinition ws, string &path ) : bool

Since the current implementation of Save does nothing, it's always possible.

CanSet ( IWritingSystemDefinition ws ) : bool

Returns true if a call to Set should succeed, false if a call to Set would throw

Conflate ( string wsToConflate, string wsToConflateWith ) : void

This is a new required interface member. We don't use it, and I hope we don't use anything which uses it!

Contains ( string identifier ) : bool

Returns true if a writing system with the given Store ID exists in the store

CreateNew ( ) : IWritingSystemDefinition

Creates a new writing system object and returns it. Set will need to be called once identifying information has been changed in order to save it in the store.

Exists ( string identifier ) : bool

Obsolete method retained because required by interface defn for backwards compatibility

FilterForTextIds ( IEnumerable idsToFilter ) : IEnumerable

Added to satisfy IWritingSystemRepository definition...implementation copied from WritingSystemRepositoryBase

Get ( string identifier ) : IWritingSystemDefinition

Gets the writing system object for the given Store ID

GetNewStoreIDWhenSet ( IWritingSystemDefinition ws ) : string

If the given writing system were passed to Set, this function returns the new StoreID that would be assigned.

GetWsForInputLanguage ( string layoutName, CultureInfo cultureInfo, IWritingSystemDefinition wsCurrent, IWritingSystemDefinition candidates ) : IWritingSystemDefinition

Only needed in local store

GetWsForInputMethod ( IKeyboardDefinition keyboard, IWritingSystemDefinition wsCurrent, IWritingSystemDefinition candidates ) : IWritingSystemDefinition

Only needed in local store

GlobalFileWritingSystemStore ( ) : System

Initializes a new instance of the GlobalFileWritingSystemStore class.

LastChecked ( string identifier, System.DateTime dateModified ) : void

MakeDuplicate ( IWritingSystemDefinition definition ) : IWritingSystemDefinition

Makes a duplicate of an existing writing system definition. Set will need to be called with this new duplicate once identifying information has been changed in order to place the new definition in the store.

OnWritingSystemIDChange ( IWritingSystemDefinition ws, string oldId ) : void

Added to satisfy definition of IWritingSystemRepository...do we need to do anything?

Remove ( string identifier ) : void

Removes the writing system with the specified Store ID from the store.

Save ( ) : void

Writes the store to a persistable medium, if applicable.

Set ( IWritingSystemDefinition ws ) : void

Adds the writing system to the store or updates the store information about an already-existing writing system. Set should be called when there is a change that updates the RFC5646 information.

TryGet ( string identifier, IWritingSystemDefinition &ws ) : bool

Gets the specified writing system if it exists.

WritingSystemIdHasChanged ( string id ) : bool

This is used by the orphan finder, which we don't use (yet). It tells whether, typically in the scope of some current change log, a writing system ID has changed to something else...call WritingSystemIdHasChangedTo to find out what.

WritingSystemIdHasChangedTo ( string id ) : string

This is used by the orphan finder, which we don't use (yet). It tells what, typically in the scope of some current change log, a writing system ID has changed to.

WritingSystemsNewerIn ( IEnumerable rhs ) : IEnumerable

Returns a list of writing systems from rhs which are newer than ones in the store.

Private Methods

Method Description
GetFileName ( IWritingSystemDefinition ws ) : string
GetFileName ( string identifier ) : string
GetFilePath ( IWritingSystemDefinition ws ) : string
GetFilePath ( string identifier ) : string
GetFromFilePath ( string filePath ) : IWritingSystemDefinition
GlobalFileWritingSystemStore ( string path ) : System

Method Details

CanSave() public method

Since the current implementation of Save does nothing, it's always possible.
public CanSave ( WritingSystemDefinition ws, string &path ) : bool
ws WritingSystemDefinition
path string
return bool

CanSet() public method

Returns true if a call to Set should succeed, false if a call to Set would throw
public CanSet ( IWritingSystemDefinition ws ) : bool
ws IWritingSystemDefinition
return bool

Conflate() public method

This is a new required interface member. We don't use it, and I hope we don't use anything which uses it!
public Conflate ( string wsToConflate, string wsToConflateWith ) : void
wsToConflate string
wsToConflateWith string
return void

Contains() public method

Returns true if a writing system with the given Store ID exists in the store
public Contains ( string identifier ) : bool
identifier string
return bool

CreateNew() public method

Creates a new writing system object and returns it. Set will need to be called once identifying information has been changed in order to save it in the store.
public CreateNew ( ) : IWritingSystemDefinition
return IWritingSystemDefinition

Exists() public method

Obsolete method retained because required by interface defn for backwards compatibility
public Exists ( string identifier ) : bool
identifier string
return bool

FilterForTextIds() public method

Added to satisfy IWritingSystemRepository definition...implementation copied from WritingSystemRepositoryBase
public FilterForTextIds ( IEnumerable idsToFilter ) : IEnumerable
idsToFilter IEnumerable
return IEnumerable

Get() public method

Gets the writing system object for the given Store ID
public Get ( string identifier ) : IWritingSystemDefinition
identifier string
return IWritingSystemDefinition

GetNewStoreIDWhenSet() public method

If the given writing system were passed to Set, this function returns the new StoreID that would be assigned.
public GetNewStoreIDWhenSet ( IWritingSystemDefinition ws ) : string
ws IWritingSystemDefinition
return string

GetWsForInputLanguage() public method

Only needed in local store
public GetWsForInputLanguage ( string layoutName, CultureInfo cultureInfo, IWritingSystemDefinition wsCurrent, IWritingSystemDefinition candidates ) : IWritingSystemDefinition
layoutName string
cultureInfo System.Globalization.CultureInfo
wsCurrent IWritingSystemDefinition
candidates IWritingSystemDefinition
return IWritingSystemDefinition

GetWsForInputMethod() public method

Only needed in local store
public GetWsForInputMethod ( IKeyboardDefinition keyboard, IWritingSystemDefinition wsCurrent, IWritingSystemDefinition candidates ) : IWritingSystemDefinition
keyboard IKeyboardDefinition
wsCurrent IWritingSystemDefinition
candidates IWritingSystemDefinition
return IWritingSystemDefinition

GlobalFileWritingSystemStore() public method

Initializes a new instance of the GlobalFileWritingSystemStore class.
public GlobalFileWritingSystemStore ( ) : System
return System

LastChecked() public method

public LastChecked ( string identifier, System.DateTime dateModified ) : void
identifier string The identifier.
dateModified System.DateTime The date modified.
return void

MakeDuplicate() public method

Makes a duplicate of an existing writing system definition. Set will need to be called with this new duplicate once identifying information has been changed in order to place the new definition in the store.
public MakeDuplicate ( IWritingSystemDefinition definition ) : IWritingSystemDefinition
definition IWritingSystemDefinition
return IWritingSystemDefinition

OnWritingSystemIDChange() public method

Added to satisfy definition of IWritingSystemRepository...do we need to do anything?
public OnWritingSystemIDChange ( IWritingSystemDefinition ws, string oldId ) : void
ws IWritingSystemDefinition
oldId string
return void

Remove() public method

Removes the writing system with the specified Store ID from the store.
public Remove ( string identifier ) : void
identifier string
return void

Save() public method

Writes the store to a persistable medium, if applicable.
public Save ( ) : void
return void

Set() public method

Adds the writing system to the store or updates the store information about an already-existing writing system. Set should be called when there is a change that updates the RFC5646 information.
public Set ( IWritingSystemDefinition ws ) : void
ws IWritingSystemDefinition
return void

TryGet() public method

Gets the specified writing system if it exists.
public TryGet ( string identifier, IWritingSystemDefinition &ws ) : bool
identifier string The identifier.
ws IWritingSystemDefinition The writing system.
return bool

WritingSystemIdHasChanged() public method

This is used by the orphan finder, which we don't use (yet). It tells whether, typically in the scope of some current change log, a writing system ID has changed to something else...call WritingSystemIdHasChangedTo to find out what.
public WritingSystemIdHasChanged ( string id ) : bool
id string
return bool

WritingSystemIdHasChangedTo() public method

This is used by the orphan finder, which we don't use (yet). It tells what, typically in the scope of some current change log, a writing system ID has changed to.
public WritingSystemIdHasChangedTo ( string id ) : string
id string
return string

WritingSystemsNewerIn() public method

Returns a list of writing systems from rhs which are newer than ones in the store.
public WritingSystemsNewerIn ( IEnumerable rhs ) : IEnumerable
rhs IEnumerable
return IEnumerable