ipad apps live sex cams ipad case sex cams free porn videos

Projects

Solution Clone v1.1

Posted on Thursday, April 09 2009 by The Admin

A quick update to Solution Clone was posted today to handle some new file types created in the BizTalk Deployment Framework v5.0.  You can find it here.

Unit Testing in BizTalk – TestFile v2.0

Posted on Wednesday, April 08 2009 by The Admin

Some time ago I made a post about using external file dependencies with NUnit. That post was about using a class called TestFile, which implemented IDisposable, to temporarily store files to disk, and then clean them up afterwards. While learning my way around the BizTalk unit testing capabilities in BizTalk 2009, I realized that this class could use some minor initial modifications to make life easier. To that end, I present to you that updated class. The most important new feature is the ability to support having it generate the file name as a temp file, and the ability to load resources from any Assembly in the AppDomain.
public class TestFile : IDisposable
{
    private bool _disposedValue = false;
    private string _resourceName;
    private string _fileName;

    public TestFile(string resourceName) : this(null, resourceName) { }

    public TestFile(string fileName, string resourceName)
    {
        if (fileName == null)
        {
            this.FileName = Path.GetTempFileName();
            File.Delete(this.FileName);
        }
        else 
            this.FileName = fileName;

        using (Stream s = LoadResourceFromAppDomain(resourceName))
        using (StreamReader sr = new StreamReader(s))
        using (StreamWriter sw = File.CreateText(this.FileName))
        {
            sw.Write(sr.ReadToEnd());
            sw.Flush();
        }
    }

    private Stream LoadResourceFromAppDomain(string resourceName)
    {
        Assembly[] appDomainAssemblies = AppDomain.CurrentDomain.GetAssemblies();
        Stream outStream = null;

        foreach (var lAssem in appDomainAssemblies)
        {
            outStream = lAssem.GetManifestResourceStream(resourceName);
            if (outStream != null) return outStream;
        }

        throw new Exception(string.Format("Unable to find resource stream {0}",resourceName));
    }

    public string FileName
    {
        get { return _fileName; }
        set
        {
            _fileName = value;
        }
    }
    

    protected virtual void Dispose(bool disposing)
    {
        if (!this._disposedValue)
        {
            if (disposing)
            {
                if (File.Exists(_fileName))
                {
                    File.Delete(_fileName);
                }
            }
        }
        this._disposedValue = true;
    }

    #region IDisposable Members

    public void Dispose()
    {
        // Do not change this code.Put cleanup code in Dispose(bool disposing) above.
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    #endregion
}

Solution Clone v1.0

Posted on Sunday, February 15 2009 by Tim

I’ve had a little utility I’ve used on my consulting gigs from time to time that I wrote a while back, and I’ve finally decided it needed a home of its own.  As you can read below, it allows me to keep fairly complex pre-built project structures, and then duplicate them with a click of a button, renaming them to whatever I need.  You can download the latest release, or you can check out the project on CodePlex.

Project Description
A utility to allow you to clone an existing solution, renaming it as you do so, and updating references inside the various files.

The Problem

Do you have a favorite project structure you setup every single time you start a new project? I surely did, and I got tired of having to re-create that structure every time. Especially since my structure was a complex many levels deep set of build files and other support files and projects I used when implementing the BizTalk Deployment Framework.

The Solution

Tired of that work, because I'm a lazy programmer, I created this project that would duplicate an existing solution directory. I setup an archive project called SolutionNameHere, which contained projects like SolutionNameHere.Orchestrations, and then let this program translate every reference to "SolutionNameHere" in either a path or a filename (or even some file contents) to whatever new name I wanted.

File Types

At the current time, Solution Clone is aware of the following types of files within your projects that it does more than simply rename and move. These files will be modified to update any references to the old solution name as they are moved. These file types currently include:

  • .sln - Visual Studio Solution Files
  • .vbproj - Visual Basic Project Files
  • .csproj - C# Project Files
  • .build - Build files used by NAnt and other build mechanisms
  • .nant - NAnt scripts

This list will almost certainly be updated in future versions to include other types of files.