Share |

Common.Core

From Matrix Platform

Jump to: navigation, search

Documentation Common.Core

Contents

Intro

The Common assembly assist the operation of the remaining elements in a solution and serves them with basic infrastructure functionality, common to all other parts of the platform.



Collections

BiDictionary

Offers a simple bi-directional dictionary (or a bi-map). Allows to search by key or by value. Implementation is done by 2 internal dictionaries that are synchronized to work together.

CircularList

A list with no start and no ending (Copyright (c) 2005, Marc Clifton)

HotSwapDictionary & HotSwapList

Dictionary and list implementing the hot swap model - a completely thread safe collection with lock-less read and very slow write operations. List needs to be iterated using iterators and not indexing, since indexing is not guaranteed to be thread safe. For details, see {CodeProject article}.

ListUnique

Extends the bahaviour of the List class to provide single entry mode, etc. No duplication of item is allowed in the class by default.

SortedListEx

Extends the sorted list class to add commonly used features (like RemoveFirstValue method).



Comparers

ReverseDateTimeComparer

Compare date time items in reverse order. Useful for sorting reverse with date time.



File Operations

FileWriterHelper

Assists with providing commonly used functionality in writing data to files.



Identification

ComponentId

Serves as a basis for multiple types of identificantion classes. The concept is to provide a unified way of identifying elements/instances etc.



Results

Result & ResultGeneric

Class provides common extended result information, for an operation. Useful to return additional information from a method like this:

Result MyMethod()
{
   return Result.Succeed("OK");
}

Generic version allows to carry an arbitrary internal result object.



Serialization

ISerializer

Base interface for all serializers. Used when an object needs to be converted to byte[] or stream so that it can be transported, by default is a binary serialization model.

SerializerBase

Base class for message serializers.

BinarySerializer

Serialize messages using the .NET framework binary formatter, provides a full serializer implementation.

SerializationHelper

Helps in persisting objects. Provides surrogate selectors for serializing non serializables like Pen, Brush, etc.

SerializationInfoEx

Helper class to contain and make easier access to serialization data of all serializable types. Extended version of the System SerializationInfo class.



Settings

AssemblySettings

Helps with the operation of assembly settings. XmlSerialization is used, so that settings can be easily modifiable.



Statistics

MultipleItemStatisticsSet

A set of item statistics. Stores automatically generated statistics data on a given property over time.

PropertyStatisticsData

Statistics data of array that is related to the values of a given property of an object.



Watchdogs

SeppukuWatchdog

The watchdog will follow the lifespan of the application; and if activated and the application starts the closing procedure, but fails to close in the given time frame, the watchdog will kill its own application. Useful if application contains some external COM references that can not be instructed to stop operation when required.



Helpers

ApplicationLifetimeHelper

Helps with the control and events of lifetime events of the application. In console applications make sure to call "SetApplicationClosing" upon close. In ApplicationDomains mode - tested under nunit and handled. In Service mode - not tested.

CommonHelper

Contains common core helper items. A general helper class, contains all kinds of routines that help the general operation of an application.

CompilationHelper

Helper class, helps with the runtime compilation operations. Superseded by .NET 4.0 scripting capabilities.

CoreSystemMonitor

Serves to receive and process system monitoring operation on runtime. A simplified version of the System monitor, allows the core components to have some primitive access to this type of functionality as well.

DateTimeHelper

Miscellaneous and parsing thread-safe methods for DateTime, class helps with parsing multiple date time formats.

DynamicHelper

Assists with dynamic invocation. Allows fully dynamic operations in the runtime, much like the "dynamic" keyword in .NET 4.0 but only requires .NET 2.0 to operate.

FastInvokeHelper

This class uses runtime code generation, to overcome the problem of slow runtime invocation. A new method is generated on runtime and calls are passed trough it. As seen here: http://www.codeproject.com/KB/cs/FastMethodInvoker.aspx

ReflectionHelper

Helper static class handling widely used reflection operations. Make sure to use it extensively, since it contains some dynamic runtime reflection references as well.

StringHelper

Helper operations related to string operations.

WebHelper

Contains a couple of methods that replace the System.Web methods with the same names, thus making us free of referencing System.Web.

modified on 8 June 2010 at 15:47 ••• 9,928 views