• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class CBO

The CBO class generates objects.

Inheritance
System.Object
ServiceLocator<ICBO, CBO>
CBO
Implements
ICBO
Inherited Members
ServiceLocator<ICBO, CBO>.Instance
ServiceLocator<ICBO, CBO>.Factory
ServiceLocator<ICBO, CBO>.SetTestableInstance(ICBO)
ServiceLocator<ICBO, CBO>.ClearInstance()
ServiceLocator<ICBO, CBO>.GetFactory()
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public class CBO : ServiceLocator<ICBO, CBO>, ICBO

Methods

| Improve this Doc View Source

CloneObject(Object)

CloneObject clones an object.

Declaration
public static object CloneObject(object objObject)
Parameters
Type Name Description
System.Object objObject

The Object to Clone.

Returns
Type Description
System.Object

A new object.

| Improve this Doc View Source

CloseDataReader(IDataReader, Boolean)

The CBO class generates objects.

Declaration
public static void CloseDataReader(IDataReader dr, bool closeReader)
Parameters
Type Name Description
IDataReader dr
System.Boolean closeReader
| Improve this Doc View Source

CreateObject(Type, Boolean)

The CBO class generates objects.

Declaration
public static object CreateObject(Type objType, bool initialise)
Parameters
Type Name Description
Type objType
System.Boolean initialise
Returns
Type Description
System.Object
| Improve this Doc View Source

CreateObject<TObject>()

The CBO class generates objects.

Declaration
public static TObject CreateObject<TObject>()
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

CreateObject<TObject>(Boolean)

CreateObject creates a new object of Type TObject.

Declaration
public static TObject CreateObject<TObject>(bool initialise)
Parameters
Type Name Description
System.Boolean initialise

A flag that indicates whether to initialise the object (i.e. set all properties to null).

Returns
Type Description
TObject

The created object.

Type Parameters
Name Description
TObject

The type of object to create.

| Improve this Doc View Source

DeserializeObject<TObject>(Stream)

The CBO class generates objects.

Declaration
public static TObject DeserializeObject<TObject>(Stream stream)
Parameters
Type Name Description
Stream stream
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

DeserializeObject<TObject>(String)

The CBO class generates objects.

Declaration
public static TObject DeserializeObject<TObject>(string fileName)
Parameters
Type Name Description
System.String fileName
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

DeserializeObject<TObject>(TextReader)

The CBO class generates objects.

Declaration
public static TObject DeserializeObject<TObject>(TextReader reader)
Parameters
Type Name Description
TextReader reader
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

DeserializeObject<TObject>(XmlDocument)

The CBO class generates objects.

Declaration
public static TObject DeserializeObject<TObject>(XmlDocument document)
Parameters
Type Name Description
XmlDocument document
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

DeserializeObject<TObject>(XmlReader)

The CBO class generates objects.

Declaration
public static TObject DeserializeObject<TObject>(XmlReader reader)
Parameters
Type Name Description
XmlReader reader
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

DeserializeSettings(IDictionary, XmlNode, String)

The CBO class generates objects.

Declaration
public static void DeserializeSettings(IDictionary dictionary, XmlNode rootNode, string elementName)
Parameters
Type Name Description
IDictionary dictionary
XmlNode rootNode
System.String elementName
| Improve this Doc View Source

FillCollection(IDataReader, Type, ref IList)

FillCollection fills a Collection of objects from a DataReader.

Declaration
public static IList FillCollection(IDataReader dr, Type objType, ref IList objToFill)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

Type objType

The type of the Object.

IList objToFill

An IList to fill.

Returns
Type Description
IList

objToFill filled with the values from dr.

| Improve this Doc View Source

FillCollection(IDataReader, Type, Boolean)

FillCollection fills a Collection of objects from a DataReader.

Declaration
public static ArrayList FillCollection(IDataReader dr, Type objType, bool closeReader)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

Type objType

The type of the Object.

System.Boolean closeReader

Flag that indicates whether the Data Reader should be closed.

Returns
Type Description
ArrayList

A new filled with the values from dr.

| Improve this Doc View Source

FillCollection(IDataReader, Type)

FillCollection fills a Collection of objects from a DataReader.

Declaration
public static ArrayList FillCollection(IDataReader dr, Type objType)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

Type objType

The type of the Object.

Returns
Type Description
ArrayList

A new filled with the values from dr.

| Improve this Doc View Source

FillCollection(IDataReader, ref Type, ref Int32)

Generic version of FillCollection fills a List custom business object of a specified type from the supplied DataReader.

Declaration
public static ArrayList FillCollection(IDataReader dr, ref Type objType, ref int totalRecords)
Parameters
Type Name Description
IDataReader dr

The IDataReader to use to fill the object.

Type objType

The type of the Object.

System.Int32 totalRecords

The value from a second result in dr with a single TotalRecords column.

Returns
Type Description
ArrayList

A List of custom business objects.

See Also
GetTotalRecords(ref IDataReader)
| Improve this Doc View Source

FillCollection<TItem>(IDataReader, IList<TItem>, Boolean)

FillCollection fills a List of objects from a DataReader.

Declaration
public static IList<TItem> FillCollection<TItem>(IDataReader dr, IList<TItem> objToFill, bool closeReader)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

IList<TItem> objToFill

The List to fill.

System.Boolean closeReader

A flag that indicates whether the DataReader should be closed.

Returns
Type Description
IList<TItem>

objToFill filled with the values from dr.

Type Parameters
Name Description
TItem

The type of the Object.

| Improve this Doc View Source

FillCollection<TItem>(IDataReader, ref IList<TItem>)

FillCollection fills a Collection of objects from a DataReader.

Declaration
public static IList<TItem> FillCollection<TItem>(IDataReader dr, ref IList<TItem> objToFill)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

IList<TItem> objToFill

The List to fill.

Returns
Type Description
IList<TItem>

objToFill filled with the values from dr.

Type Parameters
Name Description
TItem

The type of object.

| Improve this Doc View Source

FillCollection<T>(IDataReader, ref Int32)

Generic version of FillCollection fills a List custom business object of a specified type from the supplied DataReader.

Declaration
public static List<T> FillCollection<T>(IDataReader dr, ref int totalRecords)
Parameters
Type Name Description
IDataReader dr

The IDataReader to use to fill the object.

System.Int32 totalRecords

The value from a second result in dr with a single TotalRecords column.

Returns
Type Description
List<T>

A List of custom business objects.

Type Parameters
Name Description
T

The type of the business object.

See Also
GetTotalRecords(ref IDataReader)
| Improve this Doc View Source

FillCollection<TItem>(IDataReader)

FillCollection fills a Collection of objects from a DataReader.

Declaration
public static List<TItem> FillCollection<TItem>(IDataReader dr)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

Returns
Type Description
List<TItem>

A new filled with the values from dr.

Type Parameters
Name Description
TItem

The type of object.

| Improve this Doc View Source

FillDictionary<TItem>(IDataReader, ref IDictionary<Int32, TItem>)

The CBO class generates objects.

Declaration
public static IDictionary<int, TItem> FillDictionary<TItem>(IDataReader dr, ref IDictionary<int, TItem> objToFill)
    where TItem : IHydratable
Parameters
Type Name Description
IDataReader dr
IDictionary<System.Int32, TItem> objToFill
Returns
Type Description
IDictionary<System.Int32, TItem>
Type Parameters
Name Description
TItem
| Improve this Doc View Source

FillDictionary<TItem>(IDataReader)

The CBO class generates objects.

Declaration
public static IDictionary<int, TItem> FillDictionary<TItem>(IDataReader dr)
    where TItem : IHydratable
Parameters
Type Name Description
IDataReader dr
Returns
Type Description
IDictionary<System.Int32, TItem>
Type Parameters
Name Description
TItem
| Improve this Doc View Source

FillDictionary<TKey, TValue>(String, IDataReader, IDictionary<TKey, TValue>)

FillDictionary fills a Dictionary of objects from a DataReader.

Declaration
public static Dictionary<TKey, TValue> FillDictionary<TKey, TValue>(string keyField, IDataReader dr, IDictionary<TKey, TValue> objDictionary)
Parameters
Type Name Description
System.String keyField

The key field used for the Key.

IDataReader dr

The Data Reader.

IDictionary<TKey, TValue> objDictionary

The Dictionary to fill.

Returns
Type Description
Dictionary<TKey, TValue>

objDictionary filled with the values from dr.

Type Parameters
Name Description
TKey

The key for the Dictionary.

TValue

The value for the Dictionary Item.

| Improve this Doc View Source

FillDictionary<TKey, TValue>(String, IDataReader, Boolean)

FillDictionary fills a Dictionary of objects from a DataReader.

Declaration
public static Dictionary<TKey, TValue> FillDictionary<TKey, TValue>(string keyField, IDataReader dr, bool closeReader)
Parameters
Type Name Description
System.String keyField

The key field used for the Key.

IDataReader dr

The Data Reader.

System.Boolean closeReader

A flag indicating whether to close the reader.

Returns
Type Description
Dictionary<TKey, TValue>

A new filled with values from dr.

Type Parameters
Name Description
TKey

The key for the Dictionary.

TValue

The value for the Dictionary Item.

| Improve this Doc View Source

FillDictionary<TKey, TValue>(String, IDataReader)

FillDictionary fills a Dictionary of objects from a DataReader.

Declaration
public static Dictionary<TKey, TValue> FillDictionary<TKey, TValue>(string keyField, IDataReader dr)
Parameters
Type Name Description
System.String keyField

The key field used for the Key.

IDataReader dr

The Data Reader.

Returns
Type Description
Dictionary<TKey, TValue>

A new filled with values from dr.

Type Parameters
Name Description
TKey

The key for the Dictionary.

TValue

The value for the Dictionary Item.

| Improve this Doc View Source

FillObject(IDataReader, Type, Boolean)

The CBO class generates objects.

Declaration
public static object FillObject(IDataReader dr, Type objType, bool closeReader)
Parameters
Type Name Description
IDataReader dr
Type objType
System.Boolean closeReader
Returns
Type Description
System.Object
| Improve this Doc View Source

FillObject(IDataReader, Type)

The CBO class generates objects.

Declaration
public static object FillObject(IDataReader dr, Type objType)
Parameters
Type Name Description
IDataReader dr
Type objType
Returns
Type Description
System.Object
| Improve this Doc View Source

FillObject<TObject>(IDataReader, Boolean)

FillObject fills an object from a DataReader.

Declaration
public static TObject FillObject<TObject>(IDataReader dr, bool closeReader)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

System.Boolean closeReader

A flag that indicates the reader should be closed.

Returns
Type Description
TObject

The filled object or null.

Type Parameters
Name Description
TObject

The type of the object.

| Improve this Doc View Source

FillObject<TObject>(IDataReader)

FillObject fills an object from a DataReader.

Declaration
public static TObject FillObject<TObject>(IDataReader dr)
Parameters
Type Name Description
IDataReader dr

The Data Reader.

Returns
Type Description
TObject

The filled object or null.

Type Parameters
Name Description
TObject

The type of the object.

| Improve this Doc View Source

FillQueryable<TItem>(IDataReader)

The CBO class generates objects.

Declaration
public static IQueryable<TItem> FillQueryable<TItem>(IDataReader dr)
Parameters
Type Name Description
IDataReader dr
Returns
Type Description
IQueryable<TItem>
Type Parameters
Name Description
TItem
| Improve this Doc View Source

FillSortedList<TKey, TValue>(String, IDataReader)

FillSortedList fills a SortedList of objects from a DataReader.

Declaration
public static SortedList<TKey, TValue> FillSortedList<TKey, TValue>(string keyField, IDataReader dr)
Parameters
Type Name Description
System.String keyField

The key field used for the Key.

IDataReader dr

The Data Reader.

Returns
Type Description
SortedList<TKey, TValue>

The filled .

Type Parameters
Name Description
TKey

The key for the SortedList.

TValue

The value for the SortedList Item.

| Improve this Doc View Source

GetCachedObject<TObject>(CacheItemArgs, CacheItemExpiredCallback, Boolean)

The CBO class generates objects.

Declaration
public static TObject GetCachedObject<TObject>(CacheItemArgs cacheItemArgs, CacheItemExpiredCallback cacheItemExpired, bool saveInDictionary)
Parameters
Type Name Description
CacheItemArgs cacheItemArgs
CacheItemExpiredCallback cacheItemExpired
System.Boolean saveInDictionary
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

GetCachedObject<TObject>(CacheItemArgs, CacheItemExpiredCallback)

GetCachedObject gets an object from the Cache.

Declaration
public static TObject GetCachedObject<TObject>(CacheItemArgs cacheItemArgs, CacheItemExpiredCallback cacheItemExpired)
Parameters
Type Name Description
CacheItemArgs cacheItemArgs

A CacheItemArgs object that provides parameters to manage the cache AND to fetch the item if the cache has expired.

CacheItemExpiredCallback cacheItemExpired

A CacheItemExpiredCallback delegate that is used to repopulate the cache if the item has expired.

Returns
Type Description
TObject

The cached object.

Type Parameters
Name Description
TObject

The type of the object to fetch.

| Improve this Doc View Source

GetFactory()

Gets the service locator factory.

Declaration
protected override Func<ICBO> GetFactory()
Returns
Type Description
Func<ICBO>

A factory function.

Overrides
DotNetNuke.Framework.ServiceLocator<DotNetNuke.Common.Utilities.ICBO, DotNetNuke.Common.Utilities.CBO>.GetFactory()
| Improve this Doc View Source

GetProperties(Type)

GetProperties gets a Dictionary of the Properties for an object.

Declaration
public static Dictionary<string, PropertyInfo> GetProperties(Type objType)
Parameters
Type Name Description
Type objType

The type of the object.

Returns
Type Description
Dictionary<System.String, PropertyInfo>

A mapping property names to instances.

| Improve this Doc View Source

GetProperties<TObject>()

GetProperties gets a Dictionary of the Properties for an object.

Declaration
public static Dictionary<string, PropertyInfo> GetProperties<TObject>()
Returns
Type Description
Dictionary<System.String, PropertyInfo>

A mapping property names to instances.

Type Parameters
Name Description
TObject

The type of the object.

| Improve this Doc View Source

InitializeObject(Object, Type)

InitializeObject initialises all the properties of an object to their null Values.

Declaration
public static object InitializeObject(object objObject, Type objType)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

Type objType

The type of the object.

Returns
Type Description
System.Object

objObject.

| Improve this Doc View Source

InitializeObject(Object)

InitializeObject initialises all the properties of an object to their null Values.

Declaration
public static void InitializeObject(object objObject)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

| Improve this Doc View Source

SerializeObject(Object, Stream)

SerializeObject serializes an Object.

Declaration
public static void SerializeObject(object objObject, Stream stream)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

Stream stream

A Stream to serialize to.

| Improve this Doc View Source

SerializeObject(Object, String)

SerializeObject serializes an Object.

Declaration
public static void SerializeObject(object objObject, string fileName)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

System.String fileName

A filename for the resulting serialized xml.

| Improve this Doc View Source

SerializeObject(Object, TextWriter)

SerializeObject serializes an Object.

Declaration
public static void SerializeObject(object objObject, TextWriter textWriter)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

TextWriter textWriter

A TextWriter to serialize to.

| Improve this Doc View Source

SerializeObject(Object, XmlDocument)

SerializeObject serializes an Object.

Declaration
public static void SerializeObject(object objObject, XmlDocument document)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

XmlDocument document

An XmlDocument to serialize to.

| Improve this Doc View Source

SerializeObject(Object, XmlWriter)

SerializeObject serializes an Object.

Declaration
public static void SerializeObject(object objObject, XmlWriter writer)
Parameters
Type Name Description
System.Object objObject

The object to Initialise.

XmlWriter writer

An XmlWriter to serialize to.

| Improve this Doc View Source

SerializeSettings(IDictionary, XmlDocument, String, String)

Iterates items in a IDictionary object and generates XML nodes.

Declaration
public static void SerializeSettings(IDictionary dictionary, XmlDocument document, string targetPath, string elementName)
Parameters
Type Name Description
IDictionary dictionary

The IDictionary to iterate.

XmlDocument document

The XML document the node should be added to.

System.String targetPath

Path at which to serialize settings.

System.String elementName

The name of the new element created.

Explicit Interface Implementations

| Improve this Doc View Source

ICBO.FillCollection<TObject>(IDataReader)

The CBO class generates objects.

Declaration
List<TItem> ICBO.FillCollection<TItem>(IDataReader dr)
    where TItem : new()
Parameters
Type Name Description
IDataReader dr
Returns
Type Description
List<TItem>
Type Parameters
Name Description
TItem
| Improve this Doc View Source

ICBO.FillObject<TObject>(IDataReader)

The CBO class generates objects.

Declaration
TObject ICBO.FillObject<TObject>(IDataReader dr)
    where TObject : new()
Parameters
Type Name Description
IDataReader dr
Returns
Type Description
TObject
Type Parameters
Name Description
TObject
| Improve this Doc View Source

ICBO.GetCachedObject<TObject>(CacheItemArgs, CacheItemExpiredCallback, Boolean)

The CBO class generates objects.

Declaration
TObject ICBO.GetCachedObject<TObject>(CacheItemArgs cacheItemArgs, CacheItemExpiredCallback cacheItemExpired, bool saveInDictionary)
Parameters
Type Name Description
CacheItemArgs cacheItemArgs
CacheItemExpiredCallback cacheItemExpired
System.Boolean saveInDictionary
Returns
Type Description
TObject
Type Parameters
Name Description
TObject

Implements

ICBO

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS