Class CBO
The CBO class generates objects.
Implements
Inherited Members
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public class CBO : ServiceLocator<ICBO, CBO>, ICBO
Methods
| Improve this Doc View SourceCloneObject(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. |
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 |
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 |
CreateObject<TObject>()
The CBO class generates objects.
Declaration
public static TObject CreateObject<TObject>()
Returns
Type | Description |
---|---|
TObject |
Type Parameters
Name | Description |
---|---|
TObject |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
|
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 |
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 |
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 |
Returns
Type | Description |
---|---|
ArrayList | A List of custom business objects. |
See Also
| Improve this Doc View SourceFillCollection<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> |
|
Type Parameters
Name | Description |
---|---|
TItem | The type of the Object. |
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> |
|
Type Parameters
Name | Description |
---|---|
TItem | The type of object. |
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 |
Returns
Type | Description |
---|---|
List<T> | A List of custom business objects. |
Type Parameters
Name | Description |
---|---|
T | The type of the business object. |
See Also
| Improve this Doc View SourceFillCollection<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 |
Type Parameters
Name | Description |
---|---|
TItem | The type of object. |
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 |
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 |
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> |
|
Type Parameters
Name | Description |
---|---|
TKey | The key for the Dictionary. |
TValue | The value for the Dictionary Item. |
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 |
Type Parameters
Name | Description |
---|---|
TKey | The key for the Dictionary. |
TValue | The value for the Dictionary Item. |
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 |
Type Parameters
Name | Description |
---|---|
TKey | The key for the Dictionary. |
TValue | The value for the Dictionary Item. |
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 |
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 |
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. |
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. |
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 |
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. |
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 |
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. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<ICBO> GetFactory()
Returns
Type | Description |
---|---|
Func<ICBO> | A factory function. |
Overrides
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 |
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 |
Type Parameters
Name | Description |
---|---|
TObject | The type of the object. |
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 |
|
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. |
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. |
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. |
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. |
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. |
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. |
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 SourceICBO.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 |
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 |
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 |