Class MetaHelper

Implements operations for the meta helper.

Inheritance
System.Object
MetaHelper
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.Commerce.Storage
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public static class MetaHelper

Methods

ClearMetaClassCache()

Declaration
[Obsolete("This method is no longer used, use MetaClass.ClearCache instead. This method will remain at least until March 2016.")]
public static void ClearMetaClassCache()

Deserialize(Byte[])

Deserializes the specified serialized data.

Declaration
public static MetaObjectSerialized Deserialize(byte[] serializedData)
Parameters
Type Name Description
System.Byte[] serializedData

The serialized data.

Returns
Type Description
MetaObjectSerialized

The deserialized object, or null if the input was null or contained errors.

GetCachedImageUrl(MetaFile, MetaField, String, Boolean, Int32, Int32, Boolean)

Returns the cached image urls. First will be regular image url, second will be thumbnail if thumbnail generation is available.

Declaration
public static string[] GetCachedImageUrl(MetaFile file, MetaField metaField, string fileName, bool createThumbnail, int thumbnailHeight, int thumbnailWidth, bool thumbnailStretch)
Parameters
Type Name Description
MetaFile file

The file.

MetaField metaField

The meta field.

System.String fileName

Name of the file.

System.Boolean createThumbnail

if set to true [create thumbnail].

System.Int32 thumbnailHeight

Height of the thumbnail.

System.Int32 thumbnailWidth

Width of the thumbnail.

System.Boolean thumbnailStretch

if set to true [thumbnail stretch].

Returns
Type Description
System.String[]

GetMetaFieldValue(MetaField, Object)

Gets the meta field value.

Declaration
public static object GetMetaFieldValue(MetaField mf, object value)
Parameters
Type Name Description
MetaField mf

The mf.

System.Object value

The value.

Returns
Type Description
System.Object

InvalidateCachedMetaClass(Int32)

Declaration
[Obsolete("This method is no longer used, use MetaClass.ClearCache instead. This method will remain at least until March 2016.")]
public static void InvalidateCachedMetaClass(int metaClassId)
Parameters
Type Name Description
System.Int32 metaClassId

InvalidateCachedMetaClass(String)

Declaration
[Obsolete("This method is no longer used, use MetaClass.ClearCache instead. This method will remain at least until March 2016.")]
public static void InvalidateCachedMetaClass(string name)
Parameters
Type Name Description
System.String name

LoadMetaClassCached(MetaDataContext, Int32)

Loads the meta class cached.

Declaration
[Obsolete("This method is no longer used, use MetaClass.Load instead. This method will remain at least until March 2016.")]
public static MetaClass LoadMetaClassCached(MetaDataContext context, int metaClassId)
Parameters
Type Name Description
MetaDataContext context

The context.

System.Int32 metaClassId

The meta class id.

Returns
Type Description
MetaClass

LoadMetaClassCached(MetaDataContext, String)

Loads the meta class cached.

Declaration
[Obsolete("This method is no longer used, use MetaClass.Load instead. This method will remain at least until March 2016.")]
public static MetaClass LoadMetaClassCached(MetaDataContext context, string metaClassName)
Parameters
Type Name Description
MetaDataContext context

The context.

System.String metaClassName

Name of the meta class.

Returns
Type Description
MetaClass

SetMetaFieldValue(MetaDataContext, MetaObject, String, Object[])

Sets values for the meta object's meta field. Doesn't set file and image values.

Declaration
public static bool SetMetaFieldValue(MetaDataContext context, MetaObject obj, string fieldName, object[] values)
Parameters
Type Name Description
MetaDataContext context

The context.

MetaObject obj

The obj.

System.String fieldName

Name of the field.

System.Object[] values

The values.

Returns
Type Description
System.Boolean

True, if value was set successfully.

SetMetaFile(MetaDataContext, MetaObject, String, String, String, Byte[])

Sets MetaFile and Image values

Declaration
public static bool SetMetaFile(MetaDataContext context, MetaObject obj, string fieldName, string name, string contentType, byte[] fileContents)
Parameters
Type Name Description
MetaDataContext context

The context.

MetaObject obj

The obj.

System.String fieldName

Name of the field.

System.String name

The name.

System.String contentType

Type of the content.

System.Byte[] fileContents

The file contents.

Returns
Type Description
System.Boolean