Click here to Skip to main content
15,894,646 members
Articles / Desktop Programming / Windows Forms

Traceract

Rate me:
Please Sign up or sign in to vote.
3.69/5 (9 votes)
3 Sep 20059 min read 99K   1.6K   37  
A prototype debug tracer with an added dimension.
/*
 * Copyright (c) 2004, 2005 MyXaml
 * All Rights Reserved
 * 
 * Licensed under the terms of the GNU General Public License
 * http://www.gnu.org/licenses/licenses.html#GPL
*/

using System;

namespace MyXaml.Core
{
	/// <summary>
	/// This attribute can be applied to a public or non-public field in a class
	/// instantiated by the parser.  Any fields marked with this attribute are
	/// expected to be initialized by an object instantiated during markup processing
	/// and having a "def" prefix.
	/// </summary>
	[AttributeUsage(AttributeTargets.Field, AllowMultiple=false, Inherited=false)]
	public sealed class MyXamlAutoInitializeAttribute : Attribute
	{
		/// <summary>
		/// The alias to use instead of the field name.
		/// </summary>
		private string alias;

		/// <summary>
		/// Instead of using the field name, an optional alias can be used that
		/// matches the name of the object instantiated during markup processing.
		/// </summary>
		public string Alias
		{
			get {return alias;}
			set {alias=value;}
		}

		/// <summary>
		/// Constructor.  The instance assigned to this field must be named using
		/// the "def" prefix with the same name.
		/// </summary>
		public MyXamlAutoInitializeAttribute()
		{
			alias=null;
		}

		/// <summary>
		/// Constructor.  The instances assigned to this field must use the supplied
		/// alias name in the "def:Name=" markup.
		/// </summary>
		/// <param name="alias">The alias to use instead of the field name.</param>
		public MyXamlAutoInitializeAttribute(string alias)
		{
			this.alias=alias;
		}
	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect Interacx
United States United States
Blog: https://marcclifton.wordpress.com/
Home Page: http://www.marcclifton.com
Research: http://www.higherorderprogramming.com/
GitHub: https://github.com/cliftonm

All my life I have been passionate about architecture / software design, as this is the cornerstone to a maintainable and extensible application. As such, I have enjoyed exploring some crazy ideas and discovering that they are not so crazy after all. I also love writing about my ideas and seeing the community response. As a consultant, I've enjoyed working in a wide range of industries such as aerospace, boatyard management, remote sensing, emergency services / data management, and casino operations. I've done a variety of pro-bono work non-profit organizations related to nature conservancy, drug recovery and women's health.

Comments and Discussions