Try our conversational search powered by Generative AI!

Class MetaField

Inheritance
System.Object
MetaField
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.MetaDataPlus.Configurator
Assembly: Mediachase.MetaDataPlus.dll
Version: 10.8.0
Syntax
public class MetaField

Constructors

MetaField(MetaDataContext)

Declaration
[Obsolete("This constructor exists for backwards compatibility only. Will remain at least until November 2016.")]
protected MetaField(MetaDataContext context)
Parameters
Type Name Description
MetaDataContext context

Properties

AllowNulls

If true, the field may store null values.

Declaration
public bool AllowNulls { get; }
Property Value
Type Description
System.Boolean

AllowSearch

If true, search providers will attempt to index values of this meta field.

Declaration
[Obsolete("Use SafeAllowSearch or SetAllowSearch. Will remain at least until November 2016.")]
public bool AllowSearch { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Modifying the value of the AllowSearch property may immediately attempt to modify the configuration of SQL fulltext indexes, which will fail when called in an explicit transaction. Use SetAllowSearch to modify the field and explicitly control whether or not the fulltext indexes are modified. SafeAllowSearch is also provided, since the set property cannot be obsoleted without also obsoleting the get.

Attributes

A collection of attributes describing additional properties of the meta field.

Declaration
public MetaAttributeCollection Attributes { get; }
Property Value
Type Description
MetaAttributeCollection

Context

The meta data context used to load or create this field.

Declaration
public MetaDataContext Context { get; }
Property Value
Type Description
MetaDataContext

DataType

The type of data stored in the meta field.

Declaration
public MetaDataType DataType { get; }
Property Value
Type Description
MetaDataType

Description

The long description of the meta field.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String

Dictionary

Declaration
public MetaDictionary Dictionary { get; }
Property Value
Type Description
MetaDictionary

Enabled

True if this meta field is enabled in OwnerMetaClass, otherwise false.

Declaration
[Obsolete("Depends on faulty OwnerMetaClass implementation. Use GetFieldEnabled or SetFieldEnabled on the target meta class instead. Will remain at least until November 2016.")]
public bool Enabled { get; set; }
Property Value
Type Description
System.Boolean

FriendlyName

The friendly name of the meta field.

Declaration
public string FriendlyName { get; set; }
Property Value
Type Description
System.String

Id

The unique ID of the meta field.

Declaration
public int Id { get; }
Property Value
Type Description
System.Int32

IsEncrypted

If true, the values of this meta field will be encrypted.

Declaration
public bool IsEncrypted { get; set; }
Property Value
Type Description
System.Boolean

IsSystem

If true, the field is defined in a system table and cannot be modifed.

Declaration
public bool IsSystem { get; }
Property Value
Type Description
System.Boolean

IsUser

If true, the field is defined by the meta data system.

Declaration
public bool IsUser { get; }
Property Value
Type Description
System.Boolean
Remarks

Will always be the opposite of IsSystem.

Length

The length (in bytes, not characters) of the database storage used for the field.

Declaration
public int Length { get; }
Property Value
Type Description
System.Int32

MultiLanguageValue

If true, this meta field stores different values for different languages.

Declaration
public bool MultiLanguageValue { get; set; }
Property Value
Type Description
System.Boolean

Name

The unique name of the meta field.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Namespace

The namespace of the meta field.

Declaration
public string Namespace { get; set; }
Property Value
Type Description
System.String

OwnerMetaClass

Declaration
[Obsolete("OwnerMetaClass may vary depending on how the field was loaded and/or cached.  Use OwnerMetaClassIdList. Will remain at least until November 2016.")]
public MetaClass OwnerMetaClass { get; }
Property Value
Type Description
MetaClass

OwnerMetaClassIdList

A collection of the meta classes that include this meta field.

Declaration
public MetaClassIdCollection OwnerMetaClassIdList { get; }
Property Value
Type Description
MetaClassIdCollection

SafeAllowSearch

Declaration
public bool SafeAllowSearch { get; }
Property Value
Type Description
System.Boolean

SaveHistory

If true, a history of changes to value in this meta field will be saved.

Declaration
[Obsolete("SaveHistory is no longer supported. Will remain at least until November 2016.")]
public bool SaveHistory { get; set; }
Property Value
Type Description
System.Boolean

Tag

A binary value attached to the meta field.

Declaration
public object Tag { get; set; }
Property Value
Type Description
System.Object
Remarks

The usage of this data is unclear. The data for this property may only be a byte array.

Weight

The ordering weight of this meta field in OwnerMetaClass.

Declaration
[Obsolete("Depends on faulty OwnerMetaClass implementation. Use GetFieldWeight or SetFieldWeight on the target meta class instead. Will remain at least until November 2016.")]
public int Weight { get; set; }
Property Value
Type Description
System.Int32

Methods

CheckOwnerMetaClass()

Declaration
[Obsolete("This method exists for backwards compatibility only. Will remain at least until November 2016.")]
protected void CheckOwnerMetaClass()

ClearCache()

Clear meta classes in the cache.

Declaration
public static void ClearCache()

Create(MetaDataContext, String, String, String, String, MetaDataType, Int32, Boolean, Boolean, Boolean, Boolean)

Creates a new meta field with the specified properties.

Declaration
public static MetaField Create(MetaDataContext context, string metaNamespace, string name, string friendlyName, string description, MetaDataType dataType, int length, bool allowNulls, bool multiLanguageValue, bool allowSearch, bool isEncrypted)
Parameters
Type Name Description
MetaDataContext context
System.String metaNamespace
System.String name
System.String friendlyName
System.String description
MetaDataType dataType
System.Int32 length
System.Boolean allowNulls
System.Boolean multiLanguageValue
System.Boolean allowSearch
System.Boolean isEncrypted
Returns
Type Description
MetaField

The newly created meta field.

Create(MetaDataContext, String, String, String, String, MetaDataType, Int32, Boolean, Boolean, Boolean, Boolean, Boolean)

Creates a new meta field with the specified properties.

Declaration
[Obsolete("The save history feature did not function and has been removed.  Use the Create call without the saveHistory parameter. Will remain at least until November 2016.")]
public static MetaField Create(MetaDataContext context, string metaNamespace, string name, string friendlyName, string description, MetaDataType dataType, int length, bool allowNulls, bool saveHistory, bool multiLanguageValue, bool allowSearch, bool isEncrypted)
Parameters
Type Name Description
MetaDataContext context
System.String metaNamespace
System.String name
System.String friendlyName
System.String description
MetaDataType dataType
System.Int32 length
System.Boolean allowNulls
System.Boolean saveHistory
System.Boolean multiLanguageValue
System.Boolean allowSearch
System.Boolean isEncrypted
Returns
Type Description
MetaField

The newly created meta field.

CreateVirtual(MetaDataContext, String, String, String, String, MetaDataType, Int32, Boolean, Boolean, Boolean, Boolean, Boolean)

Creates a mock-up of a meta field with the specified parameters, but does not save the field to any backing store.

Declaration
public static MetaField CreateVirtual(MetaDataContext context, string metaNamespace, string name, string friendlyName, string description, MetaDataType dataType, int length, bool allowNulls, bool saveHistory, bool multiLanguageValue, bool allowSearch, bool isEncrypted)
Parameters
Type Name Description
MetaDataContext context
System.String metaNamespace
System.String name
System.String friendlyName
System.String description
MetaDataType dataType
System.Int32 length
System.Boolean allowNulls
System.Boolean saveHistory
System.Boolean multiLanguageValue
System.Boolean allowSearch
System.Boolean isEncrypted
Returns
Type Description
MetaField

The mock meta field.

Delete(MetaDataContext, Int32)

Declaration
public static void Delete(MetaDataContext context, int metaFieldId)
Parameters
Type Name Description
MetaDataContext context
System.Int32 metaFieldId

GetDataReader(MetaDataContext)

Declaration
[Obsolete("Use methods to load fully created fields, instead of handling the IDataReader directly. Will remain at least until November 2016.")]
public static IDataReader GetDataReader(MetaDataContext context)
Parameters
Type Name Description
MetaDataContext context
Returns
Type Description
System.Data.IDataReader

GetDataReader(MetaDataContext, MetaClass)

Declaration
[Obsolete("Use methods to load fully created fields, instead of handling the IDataReader directly. Will remain at least until November 2016.")]
public static IDataReader GetDataReader(MetaDataContext context, MetaClass metaClass)
Parameters
Type Name Description
MetaDataContext context
MetaClass metaClass
Returns
Type Description
System.Data.IDataReader

GetDataReader(MetaDataContext, Int32)

Declaration
[Obsolete("Use methods to load fully created fields, instead of handling the IDataReader directly. Will remain at least until November 2016.")]
public static IDataReader GetDataReader(MetaDataContext context, int metaClassId)
Parameters
Type Name Description
MetaDataContext context
System.Int32 metaClassId
Returns
Type Description
System.Data.IDataReader

GetList(MetaDataContext)

Declaration
public static MetaFieldCollection GetList(MetaDataContext context)
Parameters
Type Name Description
MetaDataContext context
Returns
Type Description
MetaFieldCollection

GetList(MetaDataContext, Int32)

Declaration
public static MetaFieldCollection GetList(MetaDataContext context, int metaClassId)
Parameters
Type Name Description
MetaDataContext context
System.Int32 metaClassId
Returns
Type Description
MetaFieldCollection

GetList(MetaDataContext, String, Boolean)

Declaration
public static MetaFieldCollection GetList(MetaDataContext context, string metaNamespace, bool deep)
Parameters
Type Name Description
MetaDataContext context
System.String metaNamespace
System.Boolean deep
Returns
Type Description
MetaFieldCollection

GetList(MetaDataContext, String[])

Declaration
public static MetaFieldCollection GetList(MetaDataContext context, params string[] namespaceItems)
Parameters
Type Name Description
MetaDataContext context
System.String[] namespaceItems
Returns
Type Description
MetaFieldCollection

GetUniqueName(MetaDataContext, String)

Declaration
public static string GetUniqueName(MetaDataContext context, string name)
Parameters
Type Name Description
MetaDataContext context
System.String name
Returns
Type Description
System.String

InvalidateCache(Int32)

Clear a specific meta class in the cache.

Declaration
public static void InvalidateCache(int metaFieldId)
Parameters
Type Name Description
System.Int32 metaFieldId

The meta field id.

Load(MetaDataContext, IDataReader)

Declaration
[Obsolete("This method exists for backwards compatibility only. Will remain at least until November 2016.")]
protected static MetaField Load(MetaDataContext context, IDataReader reader)
Parameters
Type Name Description
MetaDataContext context
System.Data.IDataReader reader
Returns
Type Description
MetaField

Load(MetaDataContext, Int32)

Declaration
public static MetaField Load(MetaDataContext context, int metaFieldId)
Parameters
Type Name Description
MetaDataContext context
System.Int32 metaFieldId
Returns
Type Description
MetaField

Load(MetaDataContext, String)

Declaration
public static MetaField Load(MetaDataContext context, string name)
Parameters
Type Name Description
MetaDataContext context
System.String name
Returns
Type Description
MetaField

OnUpdated()

Raises Meta field updated event.

Declaration
public void OnUpdated()

RegularExpressionValidatorIsValidName(String)

Validate Name using regular expresions

Declaration
public static bool RegularExpressionValidatorIsValidName(string name)
Parameters
Type Name Description
System.String name

The name.

Returns
Type Description
System.Boolean

SetAllowNulls(Boolean)

Declaration
public void SetAllowNulls(bool value)
Parameters
Type Name Description
System.Boolean value

SetAllowSearch(Boolean)

Declaration
public void SetAllowSearch(bool value)
Parameters
Type Name Description
System.Boolean value

UseStandardEditControl(IRequiredMetaFieldCollection)

Declaration
public bool UseStandardEditControl(IRequiredMetaFieldCollection requiredFieldCollection)
Parameters
Type Name Description
IRequiredMetaFieldCollection requiredFieldCollection
Returns
Type Description
System.Boolean

Extension Methods