The Enhancements project extends the .Net Framework with multi-purposed and fully-functional modules which enables you to add functionality to your own applications without effort.
Also the modules are built with extensibility in mind, enabling you to extend the framework easily.

At the moment, the following modules were already built and tested:
  • Enhancements.Basic.Expressions;
  • Enhancements.Basic.Primitives;
  • Enhancements.Core.Logging.

Enhancements.Basic.Expressions
The newest baby. It's an Excel-like formula compiler and solver. It supports the following features:
  • white-space handling;
  • unlimited leveling with parentesis;
  • function calls with zero or more parameters. Included out-of-the-box are 25 functions, but you can create your own via class inheritance;
  • operator-to-function conversion just as in .Net (1+2 = Add(1,2)), supporting unary and binary operations;
  • 15 operators supported. When creating your own functions, you can specify which operator to use, or none;
  • boolean, date time, integer, decimal and string support;
  • full support for variables. Variables are caught at compile time, requesting you to fill in the type of the variable. Filling in of the value is done just at solve time.

Enhancements.Basic.Primitives
It adds various features missing from the .Net primitive types, and that most of the time, we have to write ourselves:
  • writing numbers, including decimal numbers, to a Portuguese string;
  • finding, replacing, removing, appending and inserting data in byte, short, integer and long arrays;
  • formatting of dates in a consistent manner;
  • finding, replacing, removing and splitting strings.

Enhancements.Core.Logging
It implements a logging system, that is very complete and easily extensible. It's development was based on the following principles:
  • total support for static configuration and dynamic configuration. You can specify the configuration by using an XML file (the XML Schema for it can be downloaded from this website) but you can also define and alter everything at run-time, without forcing the system to stop at any time in order to apply the new settings;
  • the 'when to log' is based on reflection. That is, when the user wants to log something, it indicates what to log but not where in the code he is. As the logging system configuration is based on assemblies, data types, and even object instances, the system decides based on where the logging order came from, if it's something to log or just to ignore. Also various configurations can coexist so that you can log everything from one site to a place, and nothing from the same site to a different place;
  • the 'where to log' is implemented by writers. Out-of-the-box comes ConsoleWriter and FileSystemWriter, but you can easily create new ones by class inheritance;
  • the 'how to log' is implemented by formatters. Out-of-the-box comes XmlFormatter that writes data in soap-style and SingleLineFormatter and writes in simple-line-style, but you can easily create new ones by class inheritance;
  • multiple severity levels are supported in order for the user to specify if it just wants to log errors or also warnings or also detailed events.
The system is fully functional but is not very performant, as the .Net reflection sub-system is quite slow in some situations. Still, the system was never intended to be quick. If you want you can bypass it.

Last edited Aug 10, 2009 at 12:32 PM by madcoder, version 5