📄 mixtransactionattribute.cs
字号:
#region Copyright & License
//
// $Copyright:$
//
#endregion
#region Document Information
// $Author: Bai.shijun $
// $Rev: $
// $Date: 05-10-08 16:13 $
#endregion
using System;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Activation;
namespace Eai.Data.Transaction
{
/// <summary>
/// 使用Mix Transaction。
/// </summary>
/// <remarks>
/// 此属性定义的类必须派生自System.ContextBoundObject, 否则MixTransaction将不会有效。
/// </remarks>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class MixTransactionAttribute : ContextAttribute
{
/// <summary>
/// 构造一个实例。
/// </summary>
/// <param name="option">事务管理方式类型选项。</param>
public MixTransactionAttribute(MixTransactionOption option) : base("MixTransactionAttribute")
{
this.transactionOption = option;
}
private MixTransactionOption transactionOption;
/// <summary>
/// 组件定义的事务管理方式类型选项。
/// </summary>
public MixTransactionOption TransactionOption
{
get { return transactionOption; }
}
/// <summary>
/// Add a new property to the new context
/// </summary>
public override void GetPropertiesForNewContext(IConstructionCallMessage ctor)
{
IContextProperty prop = new MixTransactionProperty(ctor.ActivationType, TransactionOption);
ctor.ContextProperties.Add(prop);
}
/// <summary>
/// Called by the runtime in the creating client's context
/// </summary>
public override bool IsContextOK(Context ctx, IConstructionCallMessage ctorMsg)
{
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -