|
//===========================================
// MVC# Framework | www.MVCSharp.org |
// ------------------------------------------
// Copyright (C) 2008 www.MVCSharp.org |
// All rights reserved. |
//===========================================
using System;
using System.Text;
namespace MVCSharp.Core.Configuration.Tasks
{
#region Documentation
/// <summary>
/// Attribute to describe a task structure with XML string.
/// Should be used with <see cref="MVCConfiguration.TaskInfoProviderType"/>
/// property pointing to <see cref="TaskInfoByXmlAttributeProvider"/> or
/// <see cref="DefaultTaskInfoProvider"/> types.
/// </summary>
/// <example>
/// This is how a task structure is described with XML string inside the
/// [Task] attribute:
/// <code>
/// [Task(@"
/// <interactionPoints>
/// <interactionPoint view = ""View1"" controllerType = ""MyApp.MyController1"">
/// <navTarget trigger = ""To View2"" view = ""View2""/>
/// <navTarget view = ""View3""/>
/// </interactionPoint>
/// <iPoint view = ""View2"" controllerType = ""MyApp.MyController2"">
/// </iPoint>
/// <interactionPoint view = ""View3"" controllerType = ""MyApp.MyController3"">
/// <navTarget trigger = ""To View2"" view = ""View2""/>
/// </interactionPoint>
/// </interactionPoints>
/// ")]
/// class MyTask1 { }
/// </code>
/// Note that it is possible to use either interactionPoint tag or its short
/// analog iPoint. Next example shows how to define adjacent interaction points
/// with transitions possible between each two of them.
/// <code>
/// [Task(@"
/// <interactionPoints>
/// <interactionPoint view = ""View1"" controllerType = ""MyApp.MyController1"">
/// <navTarget trigger = ""View2"" view = ""View3""/>
/// </interactionPoint>
/// <iPoint view = ""View2"" controllerType = ""MyApp.MyController2""/>
/// <iPoint view = ""View3"" controllerType = ""MyApp.MyController3""/>
/// <interactionPoint view = ""View4"" controllerType = ""MyApp.MyController3""/>
/// </interactionPoints>
/// <adjacentPoints>
/// <iPointRef view = ""View1""/>
/// <interactionPointRef view = ""View2""/>
/// <iPointRef view = ""View3""/>
/// </adjacentPoints>
/// <adjacentPoints>
/// <iPointRef view = ""View2""/>
/// <interactionPointRef view = ""View3""/>
/// </adjacentPoints>
/// <adjacentPoints>
/// <iPointRef view = ""View3""/>
/// <iPointRef view = ""View4""/>
/// </adjacentPoints>
/// ")]
/// class MyTask2 { }
/// </code>
/// </example>
#endregion
[AttributeUsage(AttributeTargets.Class)]
public class TaskAttribute : Attribute
{
private string xml;
#region Documentation
/// <summary>
/// Xml string describing the task.
/// </summary>
#endregion
public string Xml
{
get { return xml; }
}
#region Documentation
/// <summary>
/// Constructor taking the task XML description as a parameter.
/// </summary>
#endregion
public TaskAttribute(string xml)
{
this.xml = xml;
}
}
}
|
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.
Oleg Zhukov, born and living in Russia is Lead Engineer and Project Manager in a company which provides business software solutions. He has graduated from Moscow Institute of Physics and Technology (MIPT) (department of system programming) and has got a M.S. degree in applied physics and mathematics. His research and development work concerns architectural patterns, domain-driven development and systems analysis. Being the adherent of agile methods he applies them extensively in the projects managed by him.