C# Class SIL.FieldWorks.FDO.Infrastructure.Impl.CmObjectId

A CmObjectId is basically a GUID. However, GUID is a struct, and hence, every Guid variable takes 16 bytes. CmObjectIds can be shared. Also, being our own class, we can implement some common methods with CmObject. CmObjectId also implements (secretly and very incompletely) ICmObjectOrSurrogate. This allows them to occur in the main dictionary of the IdentityMap.
Inheritance: ICmObjectId, ICmObjectOrIdInternal, ICmObjectOrSurrogate
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
Create ICmObjectId
FromGuid ICmObjectId
ICmObjectOrIdInternal int

Public Methods

Method Description
Equals ( CmObjectId id ) : bool

object ids are equal if their guids are.

Equals ( object obj ) : bool

object ids are equal if their guids are.

GetHashCode ( ) : int

consistent with equality.

GetObject ( ICmObjectRepository repo ) : ICmObject
ToXMLString ( bool owning, System writer ) : void

Add to the writer the standard XML representation of a reference to this object, marked to indicate whether it is an owned or referenced object.

Protected Methods

Method Description
CmObjectId ( System.Guid guid ) : System

The goal is a private constructor which ensures the only way to get one is something that ensures we get the canonical one. Has to be protected to allow CmObjectIdWithHvo. Do NOT subclass this as some sort of trick to be able to create one.

GetHvoUsing ( IdentityMap map ) : int

Private Methods

Method Description
Create ( System.Guid guid ) : ICmObjectId
FromGuid ( System.Guid guid, IdentityMap map ) : ICmObjectId
ICmObjectOrIdInternal ( IdentityMap map ) : int

Method Details

CmObjectId() protected method

The goal is a private constructor which ensures the only way to get one is something that ensures we get the canonical one. Has to be protected to allow CmObjectIdWithHvo. Do NOT subclass this as some sort of trick to be able to create one.
protected CmObjectId ( System.Guid guid ) : System
guid System.Guid
return System

Equals() public method

object ids are equal if their guids are.
public Equals ( CmObjectId id ) : bool
id CmObjectId
return bool

Equals() public method

object ids are equal if their guids are.
public Equals ( object obj ) : bool
obj object
return bool

GetHashCode() public method

consistent with equality.
public GetHashCode ( ) : int
return int

GetHvoUsing() protected method

protected GetHvoUsing ( IdentityMap map ) : int
map IdentityMap
return int

GetObject() public method

public GetObject ( ICmObjectRepository repo ) : ICmObject
repo ICmObjectRepository
return ICmObject

ToXMLString() public method

Add to the writer the standard XML representation of a reference to this object, marked to indicate whether it is an owned or referenced object.
public ToXMLString ( bool owning, System writer ) : void
owning bool
writer System
return void