Click here to Skip to main content
15,891,248 members
Articles / Programming Languages / C#

Building .NET Coverage Tool

Rate me:
Please Sign up or sign in to vote.
4.94/5 (34 votes)
25 Aug 2009MIT8 min read 85.3K   2.3K   109  
This article is a walkthrough for building a .NET coverage tool
//-----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation.  All Rights Reserved.
//
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Cci;
using Microsoft.Cci.Pdb;
using System.Text;
using System.Diagnostics.SymbolStore;

namespace Microsoft.Cci {

  internal sealed class UsedNamespace : IUsedNamespace {

    internal UsedNamespace(IName alias, IName namespaceName) {
      this.alias = alias;
      this.namespaceName = namespaceName;
    }

    public IName Alias {
      get { return this.alias; }
    }
    readonly IName alias;

    public IName NamespaceName {
      get { return this.namespaceName; }
    }
    readonly IName namespaceName;

  }

  internal class NamespaceScope : INamespaceScope {

    internal NamespaceScope(IEnumerable<IUsedNamespace> usedNamespaces) {
      this.usedNamespaces = usedNamespaces;
    }

    public IEnumerable<IUsedNamespace> UsedNamespaces {
      get { return this.usedNamespaces; }
    }
    readonly IEnumerable<IUsedNamespace> usedNamespaces;

  }

  internal sealed class PdbIteratorScope : ILocalScope {

    internal PdbIteratorScope(uint offset, uint length) {
      this.offset = offset;
      this.length = length;
    }

    public uint Offset {
      get { return this.offset; }
    }
    uint offset;

    public uint Length {
      get { return this.length; }
    }
    uint length;

  }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer (Senior)
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions