Skip to content

localizationsharedmodels LString

Denis Akopyan edited this page Jul 10, 2025 · 1 revision

LString Public class

Description

Localized string

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph Localization.Shared.Models
  Localization.Shared.Models.LString[[LString]]
  end
  subgraph System.ComponentModel
System.ComponentModel.INotifyPropertyChanged[[INotifyPropertyChanged]]
  end
  subgraph System
System.IEquatable_1[[IEquatable]]
System.IComparable_1[[IComparable]]
System.IDisposable[[IDisposable]]
  end
System.ComponentModel.INotifyPropertyChanged --> Localization.Shared.Models.LString
System.IEquatable_1 --> Localization.Shared.Models.LString
System.IComparable_1 --> Localization.Shared.Models.LString
System.IDisposable --> Localization.Shared.Models.LString
Loading

Members

Properties

Public properties

Type Name Methods
string Identifier
Localization unique identifier
get
bool IsEmpty
Determines whether the string is empty
get
string Key
Localization key
get, init
string Namespace
Localization namespace
get, init
string String
Localized string
get, private set

Methods

Public Static methods

Returns Name
LString CreateConstant(string value)
Create a constant localized string
LString CreateFormatted(LString format, LString[] args)
Creates a formatted localized string
(string namespace, string key) SplitIdentifier(string identifier)
Splits a localized string identifier into its namespace and key components
string implicit operator string(LString localized)

Public methods

Returns Name
int CompareTo(LString other)
void Dispose()
bool Equals(...)
string Format(...)
Formats the localized string with supplied args
int GetHashCode()
string ToString()

Details

Summary

Localized string

Remarks

The provided string is localized based on the current culture, which is managed by the CultureManager .

Constant LString instances are not affected by culture changes and will always return the same value (see LString.CreateConstant(System.String) )

Inheritance

  • INotifyPropertyChanged
  • IEquatable<LString>
  • IComparable<LString>
  • IDisposable

Constructors

LString

public LString()
Summary

Default constructor

Methods

SplitIdentifier

public static (string namespace, string key) SplitIdentifier(string identifier)
Arguments
Type Name Description
string identifier Identifier in the format "Namespace:Key"
Summary

Splits a localized string identifier into its namespace and key components

Returns

Tuple containing the namespace and key

CreateConstant

public static LString CreateConstant(string value)
Arguments
Type Name Description
string value Constant value
Summary

Create a constant localized string

Returns

Created string

CreateFormatted

public static LString CreateFormatted(LString format, LString[] args)
Arguments
Type Name Description
LString format Format source
LString[] args Formatting arguments
Summary

Creates a formatted localized string

Returns

Format [1/2]

public string Format(object[] args)
Arguments
Type Name Description
object``[] args Formatting arguments
Summary

Formats the localized string with supplied args

Returns

Formatted string

Format [2/2]

public string Format(object arg)
Arguments
Type Name Description
object arg Formatting argument
Summary

Formats the localized string with supplied arg

Returns

Formatted string

Equals [1/2]

public virtual bool Equals(LString other)
Arguments
Type Name Description
LString other

Equals [2/2]

public override bool Equals(object obj)
Arguments
Type Name Description
object obj

GetHashCode

public override int GetHashCode()

CompareTo

public virtual int CompareTo(LString other)
Arguments
Type Name Description
LString other

ToString

public override string ToString()

Operator string

public static implicit operator string(LString localized)
Arguments
Type Name Description
LString localized

Dispose

public virtual void Dispose()

Properties

Namespace

public string Namespace { get; init; }
Summary

Localization namespace

Key

public string Key { get; init; }
Summary

Localization key

Identifier

public string Identifier { get; }
Summary

Localization unique identifier

IsEmpty

public bool IsEmpty { get; }
Summary

Determines whether the string is empty

String

public string String { get; private set; }
Summary

Localized string

Events

PropertyChanged

public event PropertyChangedEventHandler PropertyChanged

Generated with ModularDoc

Clone this wiki locally