|
using System;
using System.Collections.Generic;
using System.Text;
namespace AsyncGen
{
/// <summary>
/// Defines the progress event which is raised on the client in response to a callback from the server.
/// </summary>
/// <remarks>This attribute should be applied to the methods of the callback interface.</remarks>
[AttributeUsage(AttributeTargets.Method)]
public sealed class GenerateProgressEventAttribute : Attribute
{
#region Construction
/// <summary>
/// Constructs a new instance of the <see cref="GenerateProgressEventAttribute"/> class.
/// </summary>
/// <param name="eventName">Same as the <see cref="EventName"/> property.</param>
public GenerateProgressEventAttribute(string eventName)
{
this.eventName = eventName;
}
#endregion
#region Public Properties
/// <summary>
/// The name of the event to generate.
/// </summary>
public string EventName
{
get { return eventName; }
}
/// <summary>
/// The name of the value type that will be generated to hold the incremental results of the operation.
/// </summary>
/// <remarks>The type is generated only if the callback has more than one parameter,
/// not including the progress percentage and the task ID, if present.</remarks>
public string ResultsTypeName
{
get { return resultsTypeName; }
set { resultsTypeName = value; }
}
/// <summary>
/// Gets or sets a <see cref="Boolean"/> value that determines whether the progress event should be raised synchronously or asynchronously.
/// </summary>
/// <value><c>true</c> (the default) to raise the event asynchronously (i.e. the server does not wait for the event handler to return), <c>false</c> to raise it synchronously.s</value>
/// <remarks>If the method returns a cancellation indication (designated by the <see cref="CancelFlagAttribute"/>), the event must be raised synchronously.</remarks>
public bool Async
{
get { return async; }
set { async = value; }
}
#endregion
#region Private Fields
private readonly string eventName;
private string resultsTypeName;
private bool async = true;
#endregion
}
}
|
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.
I got my B.Sc. in Mathematics and Computer Science from Tel Aviv University in 1997. Since then I have developed software in UNIX, Win32 and .NET. I currently live in Haifa.