Class CategoryNameItem
Pair of two strings used as a single entry in Category Name databases
Inherited Members
Namespace: Doozy.Runtime.Common
Assembly: cs.temp.dll.dll
Syntax
public class CategoryNameItem
Constructors
CategoryNameItem()
Construct a new CategoryNameItem with default values
Declaration
public CategoryNameItem()
CategoryNameItem(String)
Construct a new CategoryNameItem with the given category value and the default name value
Declaration
public CategoryNameItem(string category)
Parameters
Type | Name | Description |
---|---|---|
String | category | Category value |
CategoryNameItem(String, String, Boolean, Boolean)
Construct a new CategoryNameItem with the given category and name values
Declaration
public CategoryNameItem(string category, string name, bool removeWhitespaces = true, bool removeSpecialCharacters = true)
Parameters
Type | Name | Description |
---|---|---|
String | category | Category value |
String | name | Name value |
Boolean | removeWhitespaces | Remove whitespaces from values |
Boolean | removeSpecialCharacters | Remove special characters from values |
Fields
k_DefaultCategory
Default string value for Category
Declaration
public const string k_DefaultCategory = "None"
Field Value
Type | Description |
---|---|
String |
k_DefaultName
Default string value for Name
Declaration
public const string k_DefaultName = "None"
Field Value
Type | Description |
---|---|
String |
Properties
category
Category string value
Declaration
public string category { get; }
Property Value
Type | Description |
---|---|
String |
name
Name string value
Declaration
public string name { get; }
Property Value
Type | Description |
---|---|
String |
Methods
CleanString(String, Boolean, Boolean)
Cleans the string by removing any empty spaces (at the start of the string and/or the end of the string)
Declaration
public static string CleanString(string value, bool removeWhitespaces = true, bool removeSpecialCharacters = true)
Parameters
Type | Name | Description |
---|---|---|
String | value | Target value |
Boolean | removeWhitespaces | Remove all whitespaces from the target string |
Boolean | removeSpecialCharacters | Remove all special characters from the target string |
Returns
Type | Description |
---|---|
String | The cleaned string |
SetCategory(String, Boolean, Boolean)
Set a new Category value
Declaration
public (bool, string) SetCategory(string newCategory, bool removeWhitespaces = true, bool removeSpecialCharacters = true)
Parameters
Type | Name | Description |
---|---|---|
String | newCategory | Target value |
Boolean | removeWhitespaces | Remove all whitespaces from the target string |
Boolean | removeSpecialCharacters | Remove all special characters from the target string |
Returns
Type | Description |
---|---|
(T1, T2)<Boolean, String> | Operation result (True or False) and a success or failure reason message |
SetName(String, Boolean, Boolean)
Set a new Name value
Declaration
public (bool, string) SetName(string newName, bool removeWhitespaces = true, bool removeSpecialCharacters = true)
Parameters
Type | Name | Description |
---|---|---|
String | newName | Target value |
Boolean | removeWhitespaces | Remove all whitespaces from the target string |
Boolean | removeSpecialCharacters | Remove all special characters from the target string |
Returns
Type | Description |
---|---|
(T1, T2)<Boolean, String> | Operation result (True or False) and a success or failure reason message |