Show / Hide Table of Contents

Class UdefHelper

This class contains helper functions for handling user-defined fields.

Inheritance
object
UdefHelper
Implements
IUdefHelper
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Data
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class UdefHelper : IUdefHelper

Constructors

UdefHelper()

This class contains helper functions for handling user-defined fields.

Declaration
public UdefHelper()

Fields

AdminPage1LineNo

This class contains helper functions for handling user-defined fields.

Declaration
public const int AdminPage1LineNo = 10000
Field Value
Type Description
int

Methods

CheckRevisionAsync()

This class contains helper functions for handling user-defined fields.

Declaration
public Task CheckRevisionAsync()
Returns
Type Description
Task

CheckRevisionAsync(UDefType)

This class contains helper functions for handling user-defined fields.

Declaration
public Task CheckRevisionAsync(UDefType type)
Parameters
Type Name Description
UDefType type
Returns
Type Description
Task

CompareUdefRows(UDefFieldRow, UDefFieldRow)

This class contains helper functions for handling user-defined fields.

Declaration
public bool CompareUdefRows(UDefFieldRow leftRow, UDefFieldRow rightRow)
Parameters
Type Name Description
UDefFieldRow leftRow
UDefFieldRow rightRow
Returns
Type Description
bool

ConvertFromAdminLineNo(int)

This class contains helper functions for handling user-defined fields.

Declaration
public short ConvertFromAdminLineNo(int lineNo)
Parameters
Type Name Description
int lineNo
Returns
Type Description
short

ConvertToAdminLineNo(int)

This class contains helper functions for handling user-defined fields.

Declaration
public short ConvertToAdminLineNo(int lineNo)
Parameters
Type Name Description
int lineNo
Returns
Type Description
short

FindAvailableFieldAsync(UDefType, UDefFieldType)

This class contains helper functions for handling user-defined fields.

Declaration
public Task<FieldInfo> FindAvailableFieldAsync(UDefType type, UDefFieldType fieldType)
Parameters
Type Name Description
UDefType type
UDefFieldType fieldType
Returns
Type Description
Task<FieldInfo>

FindAvailableFieldAsync(UDefType, UDefFieldType, bool)

Find available field of given type

Declaration
public Task<FieldInfo> FindAvailableFieldAsync(UDefType type, UDefFieldType fieldType, bool isIndexed)
Parameters
Type Name Description
UDefType type
UDefFieldType fieldType
bool isIndexed

Dummy parameter for backwards compatibility. Indexin no longer influences field allocation

Returns
Type Description
Task<FieldInfo>

GetAdminVersionAsync(UDefType)

Get the current version number for the given udef type

Declaration
public Task<int> GetAdminVersionAsync(UDefType type)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

Returns
Type Description
Task<int>

Current version number for the given udef type

GetAdminVersionsAsync()

Return an array of pairs indicating the UDefTypes present in the system, and the current version for each of them

Declaration
public Task<Dictionary<UDefType, int>> GetAdminVersionsAsync()
Returns
Type Description
Task<Dictionary<UDefType, int>>

GetAdminVersionsAsync(params UDefType[])

This class contains helper functions for handling user-defined fields.

Declaration
public Task<Dictionary<UDefType, int>> GetAdminVersionsAsync(params UDefType[] types)
Parameters
Type Name Description
UDefType[] types
Returns
Type Description
Task<Dictionary<UDefType, int>>

GetAllFields(UDefType, UDefFieldType)

This class contains helper functions for handling user-defined fields.

Declaration
public IEnumerable<FieldInfo> GetAllFields(UDefType type, UDefFieldType fieldType)
Parameters
Type Name Description
UDefType type
UDefFieldType fieldType
Returns
Type Description
IEnumerable<FieldInfo>

GetCurrentVersionAsync(UDefType)

Get the current version number for the given udef type

Declaration
public Task<int> GetCurrentVersionAsync(UDefType type)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

Returns
Type Description
Task<int>

Current version number for the given udef type

GetCurrentVersionsAsync()

Return an array of pairs indicating the UDefTypes present in the system, and the current version for each of them

Declaration
public Task<Dictionary<UDefType, int>> GetCurrentVersionsAsync()
Returns
Type Description
Task<Dictionary<UDefType, int>>

GetCurrentVersionsAsync(params UDefType[])

This class contains helper functions for handling user-defined fields.

Declaration
public Task<Dictionary<UDefType, int>> GetCurrentVersionsAsync(params UDefType[] types)
Parameters
Type Name Description
UDefType[] types
Returns
Type Description
Task<Dictionary<UDefType, int>>

GetDefaultValue(UDefFieldRow)

Get a field's default value as a typed (parsed) object: an int, a date, or whatever. There are no parsing exceptions thrown by this method. Multi-language parsing is performed for all kinds of values prior to other parsing, as in the windows client.

Declaration
public object GetDefaultValue(UDefFieldRow definition)
Parameters
Type Name Description
UDefFieldRow definition

Udef field definition

Returns
Type Description
object

An object of the correct type for the database type of the udef field (so a dropdown list field will get an int, which is the list item id). If the stored default is not parseable as the target type, an 'empty' object of the correct type is returned (0 for ints, etc.)

GetListName(UDefFieldRow)

Get the name of the MDO list associate with the given udef field. An empty string is returned if the field is not a list field.

Declaration
public string GetListName(UDefFieldRow definition)
Parameters
Type Name Description
UDefFieldRow definition

User-defined field to get list name for

Returns
Type Description
string
Remarks

The list associated with a udef field is generally given by the ListTableId property of the definition. However, there is some special treatment:

GetTableInfo(UDefType)

This class contains helper functions for handling user-defined fields.

Declaration
public TableInfo GetTableInfo(UDefType type)
Parameters
Type Name Description
UDefType type
Returns
Type Description
TableInfo

GetTableInfoLarge(UDefType)

This class contains helper functions for handling user-defined fields.

Declaration
public TableInfo GetTableInfoLarge(UDefType type)
Parameters
Type Name Description
UDefType type
Returns
Type Description
TableInfo

GetTableInfoLargeOrSmall(UDefType, UDefFieldType)

This class contains helper functions for handling user-defined fields.

Declaration
public TableInfo GetTableInfoLargeOrSmall(UDefType type, UDefFieldType fieldType)
Parameters
Type Name Description
UDefType type
UDefFieldType fieldType
Returns
Type Description
TableInfo

GetTableInfoSmall(UDefType)

This class contains helper functions for handling user-defined fields.

Declaration
public TableInfo GetTableInfoSmall(UDefType type)
Parameters
Type Name Description
UDefType type
Returns
Type Description
TableInfo

GetTemplateVariableName(UDefType, UDefFieldType, int)

This class contains helper functions for handling user-defined fields.

Declaration
public string GetTemplateVariableName(UDefType udefType, UDefFieldType udefFieldType, int columnId)
Parameters
Type Name Description
UDefType udefType
UDefFieldType udefFieldType
int columnId
Returns
Type Description
string

GetUdefType(TableInfo)

Get the udef type of the given table

Declaration
public UDefType GetUdefType(TableInfo tableInfo)
Parameters
Type Name Description
TableInfo tableInfo

Table info object

Returns
Type Description
UDefType

udef type of table

GetUdefType(int)

Get the udef type of the given table

Declaration
public UDefType GetUdefType(int tableNumber)
Parameters
Type Name Description
int tableNumber

0-based table index

Returns
Type Description
UDefType

udef type of table

GetUserPreferenceMDOListString(UDefType)

This class contains helper functions for handling user-defined fields.

Declaration
public string GetUserPreferenceMDOListString(UDefType type)
Parameters
Type Name Description
UDefType type
Returns
Type Description
string

GetUserPreferenceMDOListStringAdmin(UDefType)

This class contains helper functions for handling user-defined fields.

Declaration
public string GetUserPreferenceMDOListStringAdmin(UDefType type)
Parameters
Type Name Description
UDefType type
Returns
Type Description
string

GetVersionPreferenceAdmin(UDefType)

Get the version preference string for the given udef type

Declaration
public string GetVersionPreferenceAdmin(UDefType type)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

Returns
Type Description
string

Preference key for the current version

GetVersionPreferenceCurrent(UDefType)

Get the version preference string for the given udef type

Declaration
public string GetVersionPreferenceCurrent(UDefType type)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

Returns
Type Description
string

Preference key for the current version

IncrementAdminVersionAsync(UDefType)

Set the admin version number for the given udef type

Declaration
public Task<int> IncrementAdminVersionAsync(UDefType type)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

Returns
Type Description
Task<int>

Current version number for the given udef type

IncrementCurrentVersionAsync(UDefType)

Set the current version number for the given udef type to the adminversion.

Declaration
public Task<int> IncrementCurrentVersionAsync(UDefType type)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

Returns
Type Description
Task<int>

Current version number for the given udef type

IsLargeTableColumn(int)

This class contains helper functions for handling user-defined fields.

Declaration
public bool IsLargeTableColumn(int columnId)
Parameters
Type Name Description
int columnId
Returns
Type Description
bool

IsPageOneMDOAsync(UDefType, CancellationToken)

This class contains helper functions for handling user-defined fields.

Declaration
public Task<bool> IsPageOneMDOAsync(UDefType type, CancellationToken cancellationToken = default)
Parameters
Type Name Description
UDefType type
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

IsSmallTableColumn(int)

This class contains helper functions for handling user-defined fields.

Declaration
public bool IsSmallTableColumn(int columnId)
Parameters
Type Name Description
int columnId
Returns
Type Description
bool

IsUnpublishedPageOneMDOAsync(UDefType, CancellationToken)

This class contains helper functions for handling user-defined fields.

Declaration
public Task<bool> IsUnpublishedPageOneMDOAsync(UDefType type, CancellationToken cancellationToken = default)
Parameters
Type Name Description
UDefType type
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

SetAdminVersionAsync(UDefType, int, CancellationToken)

Set the admin version number for the given udef type

Declaration
public Task SetAdminVersionAsync(UDefType type, int version, CancellationToken cancellationToken = default)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

int version
CancellationToken cancellationToken
Returns
Type Description
Task

Current version number for the given udef type

SetCurrentVersionAsync(UDefType, int, CancellationToken)

Set the current version number for the given udef type

Declaration
public Task SetCurrentVersionAsync(UDefType type, int version, CancellationToken cancellationToken = default)
Parameters
Type Name Description
UDefType type

Udef type, should be one of the "valid" ones

int version
CancellationToken cancellationToken
Returns
Type Description
Task

Current version number for the given udef type

SetRankOnFieldsAsync(UDefType, int[])

This class contains helper functions for handling user-defined fields.

Declaration
public Task SetRankOnFieldsAsync(UDefType ownerType, int[] rankedFieldsIds)
Parameters
Type Name Description
UDefType ownerType
int[] rankedFieldsIds
Returns
Type Description
Task

SuggestLocation(UDefType, out int, out int, int, int, out int, out int)

This class contains helper functions for handling user-defined fields.

Declaration
public void SuggestLocation(UDefType type, out int labelLeft, out int labelTop, int labelWidth, int labelHeight, out int fieldLeft, out int fieldTop)
Parameters
Type Name Description
UDefType type
int labelLeft
int labelTop
int labelWidth
int labelHeight
int fieldLeft
int fieldTop

TranslateFieldTypeToDatabaseType(UDefFieldType)

This class contains helper functions for handling user-defined fields.

Declaration
public UDefFieldDatabaseType TranslateFieldTypeToDatabaseType(UDefFieldType fieldType)
Parameters
Type Name Description
UDefFieldType fieldType
Returns
Type Description
UDefFieldDatabaseType

Implements

IUdefHelper

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top