Class LocalizableImage
Provides methods of working with localized image.
Implements
Inherited Members
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public class LocalizableImage : LocalizableValue<TerrasoftImage>, ICloneable
Constructors
LocalizableImage()
Initializes a new instance of the class. LocalizableImage
Declaration
public LocalizableImage()
LocalizableImage(Byte[])
Declaration
[Obsolete("7.15.0 | Method is not in use and will be removed in upcoming releases")]
public LocalizableImage(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data |
LocalizableImage(String, String)
Initializes a new instance of the LocalizableImage class using the specified resource manager and specified resource element.
Declaration
public LocalizableImage(string resourceManagerName, string resourceItemName)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceManagerName | Resource manager name. |
System.String | resourceItemName | Name of the resource item. |
LocalizableImage(IResourceStorage, String, String)
Initializes a new instance of the LocalizableImage class using the specified resource storage, resource manager and resource item.
Declaration
public LocalizableImage(IResourceStorage storage, string resourceManagerName, string resourceItemName)
Parameters
Type | Name | Description |
---|---|---|
IResourceStorage | storage | Resource repository - a class that implements the IResourceStorage interface. |
System.String | resourceManagerName | Resource manager name. |
System.String | resourceItemName | Name of the resource item. |
LocalizableImage(LocalizableImage)
Initializes a new instance of the LocalizableImage class using the specified localized image.
Declaration
public LocalizableImage(LocalizableImage source)
Parameters
Type | Name | Description |
---|---|---|
LocalizableImage | source | Localized image. |
Remarks
The constructor creates a new object, which is a copy of source
.
LocalizableImage(TerrasoftImage)
Initializes a new instance of the LocalizableImage class using the specified image.
Declaration
public LocalizableImage(TerrasoftImage value)
Parameters
Type | Name | Description |
---|---|---|
TerrasoftImage | value | Image for initialization of the LocalizableImage instance. |
Properties
Empty
Gets an empty localized image.
Declaration
public static LocalizableImage Empty { get; }
Property Value
Type | Description |
---|---|
LocalizableImage |
Methods
Clone()
Creates the clone of the current LocalizableImage instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new LocalizableImage instance that represents the copy of the current instance. |
Overrides
Equals(Object)
Determines whether the given LocalizableImage instance and the specified System.Object instance have the same values.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object instance for comparing with the current instance LocalizableImage. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Remarks
Overloaded method.
GetCultureValue(CultureInfo)
Gets a value of the System.Drawing.Image type that corresponds to the current LocalizableImage instance in the specified culture or generates exception if the image does not exist.
Declaration
public TerrasoftImage GetCultureValue(CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | Culture. |
Returns
Type | Description |
---|---|
TerrasoftImage | Image, localized according to the culture specified in the |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an image is not available for the |
GetFromResourceManager(CultureInfo, String)
Declaration
protected override TerrasoftImage GetFromResourceManager(CultureInfo culture, string itemName)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | |
System.String | itemName |
Returns
Type | Description |
---|---|
TerrasoftImage |
Overrides
GetFromResourceManagerWithCultureFallback(CultureInfo, String)
Declaration
protected override TerrasoftImage GetFromResourceManagerWithCultureFallback(CultureInfo culture, string itemName)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | culture | |
System.String | itemName |
Returns
Type | Description |
---|---|
TerrasoftImage |
Overrides
GetHashCode()
Gets hash code for the current localized image.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code for current instance LocalizableImage in the form of 32-bit signed integer. |
Overrides
Merge(LocalizableImage, LocalizableImage)
Combines the specified localized values.
Declaration
public static LocalizableImage Merge(LocalizableImage target, LocalizableImage source)
Parameters
Type | Name | Description |
---|---|---|
LocalizableImage | target | Localized image to combine with. |
LocalizableImage | source | Localized image, which is combined with |
Returns
Type | Description |
---|---|
LocalizableImage | The LocalizableImage instance that represents the result of merging two localized images |
ToString()
Performs implicit conversion of the current LocalizableImage instance to string type.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Operators
Implicit(String to LocalizableImage)
Performs an implicit conversion of the System.String type to the LocalizableImage type.
Declaration
public static implicit operator LocalizableImage(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The System.String instance for conversion. |
Returns
Type | Description |
---|---|
LocalizableImage |
Implicit(LocalizableImage to String)
Performs an implicit conversion of the LocalizableImage type to the System.String type.
Declaration
public static implicit operator string (LocalizableImage localizableImage)
Parameters
Type | Name | Description |
---|---|---|
LocalizableImage | localizableImage | The LocalizableImage instance for conversion. |
Returns
Type | Description |
---|---|
System.String |
Implicit(LocalizableImage to TerrasoftImage)
Performs an implicit conversion of the LocalizableImage type to the System.Drawing.Image type.
Declaration
public static implicit operator TerrasoftImage(LocalizableImage localizableImage)
Parameters
Type | Name | Description |
---|---|---|
LocalizableImage | localizableImage | The LocalizableImage instance for conversion. |
Returns
Type | Description |
---|---|
TerrasoftImage | The System.Drawing.Image instance, equivalent to the localized |
Implicit(TerrasoftImage to LocalizableImage)
Performs an implicit conversion of the System.Drawing.Image type to the LocalizableImage type.
Declaration
public static implicit operator LocalizableImage(TerrasoftImage value)
Parameters
Type | Name | Description |
---|---|---|
TerrasoftImage | value | The System.Drawing.Image instance for conversion. |
Returns
Type | Description |
---|---|
LocalizableImage | The LocalizableImage instance, equivalent to the |