Archive for the Category development

 
 

VS 2005 addins: NAntAddin and NUnitAddin

The first addin allows you manipulate Nant targets and tasks  within VS 2005

nantaddin

NAntAddin Features:

  • Read .nant and .build files
  • Build visual tree from NAnt files
  • Filter public/private targets
  • Display target/task properties
  • Locate selected node into build file
  • Start/Stop selected target
  • At solution startup reload default build file
  • Full integration with VisualStudio
  • Sources provided

Download NAntAddin

The second addin allows you run NUnit tests without leaving VS IDE

nunitaddin

Download NUnitAddin

[Via Nauman Leghari's Blog]

The Logging Framework for JS

I like log4net .The library is very easy for using and configuration and has an amazing set of features. I found an interesting project that allow to ASP.NET(AJAX) developers to add logging abilities to JavaScript .The project called log4js .It’s free and can be downloaded at this link.The main aim of framework is to be very similar to the Net logging framework Log4net.So if you used log4net before you may try log4js.

The log4js contains following appenders:

  • WindowAppender: open a new window in the browser and insert log messages in real time.
  • WindowsEventAppender: send log messages in the MS Windows event manager.
  • FileAppender: write log messages in a local file on the client.
  • AjaxAppender: allow to send log messages to the server with asynchronous HTTP request. There you can process the logging events like you want on server side (ASP.NET).
  • MetatagAppender: add log messages as meta data.

The configuration is done by inserting :

<script src="log4js.js" type="text/javascript"></script> 
<script type="text/javascript"> 
<!-- // 
//initialize the logger  with your category 
var logger = Log4js.getLogger("ajaxTest"); 
//set the level of logging 
logger.setLevel(Log4js.Level.ALL); 
//set the AJAX Appender to write the log to 
logger.addAppender(new AjaxAppender("./log4j.jsp")); 
// --> </script> 

Log4js is compatible with almost all current browsers (IE,Firefox,Safari,Opera…)

Technorati Tags: ,,

Sending the LINQ To SQL log to log4net

DataContext Log Property can be used to print generated SQL query or command in the console window as shown below:

db.Log = Console.Out;

If you want to print the SQL query in DebugView or VS Output window you may use DebugWriter class(by Kris Vandermotten) .The usage of the class is pretty simple …

db.Log = new DebugWriter();

I wrote a small class that help you redirect DataContext messages to log4net .I’ve changed the DebugWriter and call it Log4NetWriter . The usage is still simple

db.Log = new Log4NetWriter(this.GetType());

As result you get formatted log4net messages that can be send to any log4net appender .

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using log4net;
using log4net.Core;
using log4net.Repository.Hierarchy;
 
namespace Devintelligence.Data
{
 
 
    public class Log4NetWriter : TextWriter
    {
 
        /// <summary>
        /// Initializes a new instance of the <see cref="Log4NetWriter"/> class.
        /// </summary>
        /// <param name="type">The type.</param>
        public Log4NetWriter(Type type):this(type,Level.Debug)
        {
        }
 
 
        /// <summary>
        /// Initializes a new instance of the <see cref="Log4NetWriter"/> class.
        /// </summary>
        /// <param name="type">The logger source type.</param>
        /// <param name="level">The log4net log level.</param>
        public Log4NetWriter(Type type, Level level)
        {
            logSrcType = type;
            this.level = level;
            open = true;
        }
 
        /// <summary>
        /// Releases the unmanaged resources used by the <see cref="T:System.IO.TextWriter"/> and optionally releases the managed resources.
        /// </summary>
        /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
        protected override void Dispose(bool disposing)
        {
            open = false;
            base.Dispose(disposing);
        }
 
        /// <summary>
        /// Writes a character to the text stream.
        /// </summary>
        /// <param name="value">The character to write to the text stream.</param>
        /// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.IO.TextWriter"/> is closed. </exception>
        /// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
        public override void Write(char value)
        {
            if (!open)
            {
                throw new ObjectDisposedException(null);
            }
            Log(value.ToString());
        }
 
        /// <summary>
        /// Writes a string to the text stream.
        /// </summary>
        /// <param name="value">The string to write.</param>
        /// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.IO.TextWriter"/> is closed. </exception>
        /// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
        public override void Write(string value)
        {
            if (!open)
            {
                throw new ObjectDisposedException(null);
            }
            if (value != null)
            {
                Log(value);
            }
        }
 
        /// <summary>
        /// Writes a subarray of characters to the text stream.
        /// </summary>
        /// <param name="buffer">The character array to write data from.</param>
        /// <param name="index">Starting index in the buffer.</param>
        /// <param name="count">The number of characters to write.</param>
        /// <exception cref="T:System.ArgumentException">The buffer length minus <paramref name="index"/> is less than <paramref name="count"/>. </exception>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="buffer"/> parameter is null. </exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        ///     <paramref name="index"/> or <paramref name="count"/> is negative. </exception>
        /// <exception cref="T:System.ObjectDisposedException">The <see cref="T:System.IO.TextWriter"/> is closed. </exception>
        /// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
        public override void Write(char[] buffer, int index, int count)
        {
            if (!open)
            {
                throw new ObjectDisposedException(null);
            }
            if (buffer == null || index < 0 || count < 0 || buffer.Length - index < count)
            {
                base.Write(buffer, index, count); // delegate throw exception to base class
            }
            Log( new string(buffer, index, count));
        }
 
        /// <summary>
        /// When overridden in a derived class, returns the <see cref="T:System.Text.Encoding"/> in which the output is written.
        /// </summary>
        /// <value></value>
        /// <returns>The Encoding in which the output is written.</returns>
        public override Encoding Encoding
        {
            get
            {
                if (encoding == null)
                {
                    encoding = new UnicodeEncoding(false, false);
                }
                return encoding;
            }
        }
 
 
        /// <summary>
        /// Writes a message to log4net 
        /// </summary>
        /// <param name="message"></param>
        private void Log( string message )
        {
            Hierarchy hierarchy = ((Hierarchy)LogManager.GetRepository());
            ILoggerFactory loggerFactory = ((Hierarchy)LogManager.GetRepository()).LoggerFactory;
            Logger logger = hierarchy.GetLogger(logSrcType.FullName, loggerFactory);
            logger.Log(level, message, null);
        }
 
 
        private bool open;
        private static UnicodeEncoding encoding;
        private readonly Level level;
        private Type logSrcType;
    }
}

 

Technorati Tags: ,,,

The Syndicated Client Experiences Starter Kit and Reader Software Development Kit

SCE(Syndicated Client Experiences) applications are .Net applications that are deployed by web, occasionally connected, and fully exploitive of the desktop providing the optimal user experience for your content. The SC Reader application is a feature rich application that utilizes WPF’s layout capabilities and advanced text to present the best possible reading experience on any screen.

  • Readability and Rich document presentation
  • Personalization and Accessibility
  • Intuitive and Effortless Navigation
  • Commenting and Sharing
  • Mobility and Robustness
  • Premier Desktop Positioning
  • High Fidelity Printing
  • Support for numerous languages including Indic and East Asian languages.

 

Included in SDK(available for download here):

  • Visual Studio and Expression projects
    • Sample Generic Reader (complete end to end sample, full source code)
    • MSDN Reader (application, feed and full sample source code)
    • Reader Quick Start wizard
    • Photos: a simple sample demonstrating a syndicated photo experience (full sample source code)
  • An integrated branded boostrapper for .Net 3.0 deployment and app installation via Click-Once
  • Content Sync Extensions for RSS 2.0 for rich, nested, authenticated feeds
  • SCE sync service and desktop UI redistributable components

You can download the msdn reader(built using SCE SDK) here

Check out the resources below for training videos to help you customize your Starter Kit application.

Technorati Tags: ,,

UMLet – Free UML Tool for Fast UML Diagrams

UMLet is an open-source UML tool with a simple user interface.UMLet is a UML tool provide a fast way of creating UML diagrams. UML elements are modified using text input instead of pop-up dialogs. UMLet runs stand-alone or as Eclipse plug-in on Windows, OS X and Linux.

Features:

  • Draw UML diagrams fast
  • Export diagrams to EPS, PDF JPG, SVG and clipboard
  • Share diagrams using Eclipse
  • Create new, custom UML elements.

Download UMLet
Sample diagrams

 

Technorati Tags: ,,

[Via Larkware.com]


Page 4 of 37« First...23456...102030...Last »