本文整理汇总了C#中System.Transactions.Transaction.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.Execute方法的具体用法?C# Transaction.Execute怎么用?C# Transaction.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Transactions.Transaction
的用法示例。
在下文中一共展示了Transaction.Execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute()
{
Transactions.Transaction t;
Transactions.Processes.DetermineIfInstalled process;
process = new Transactions.Processes.DetermineIfInstalled(_request.Database, _request.Database.Server.Timeout,
_request.Database.Server.Timeout, _request.Database.Server.BufferSize, _request.Database.Server.BufferSize);
t = new Transactions.Transaction(process);
AttachSubscriber(process, _request.OnActionChanged);
AttachSubscriber(process, _request.OnAuthorizationDenied);
AttachSubscriber(process, _request.OnComplete);
AttachSubscriber(process, _request.OnError);
AttachSubscriber(process, _request.OnProgress);
AttachSubscriber(process, _request.OnTimeout);
t.Execute();
}
示例2: Execute
// Public Methods (1)
public override void Execute()
{
Transactions.Transaction t;
Transactions.Processes.AuthenticateUser process;
process = new Transactions.Processes.AuthenticateUser(_db, _sessionMgr, _username, _password, _request.Database.Server.Timeout,
_request.Database.Server.Timeout, _request.Database.Server.BufferSize, _request.Database.Server.BufferSize);
t = new Transactions.Transaction(process);
AttachSubscriber(process, _request.OnActionChanged);
AttachSubscriber(process, _request.OnAuthorizationDenied);
AttachSubscriber(process, _request.OnComplete);
AttachSubscriber(process, _request.OnError);
AttachSubscriber(process, _request.OnProgress);
AttachSubscriber(process, _request.OnTimeout);
t.Execute();
}
示例3: Execute
public override void Execute()
{
Transactions.Transaction t;
Transactions.Processes.CreateGroup process;
process = new Transactions.Processes.CreateGroup(_request.Database, _group, _request.RequestingPartyType, _request.Session, _request.Database.Server.Timeout,
_request.Database.Server.Timeout, _request.Database.Server.BufferSize, _request.Database.Server.BufferSize);
t = new Transactions.Transaction(process);
AttachSubscriber(process, _request.OnActionChanged);
AttachSubscriber(process, _request.OnAuthorizationDenied);
AttachSubscriber(process, _request.OnComplete);
AttachSubscriber(process, _request.OnError);
AttachSubscriber(process, _request.OnProgress);
AttachSubscriber(process, _request.OnTimeout);
t.Execute();
}
示例4: Execute
public override void Execute()
{
Transactions.Transaction t;
Transactions.Processes.ModifyResourceUsageRightsTemplate process;
process = new Transactions.Processes.ModifyResourceUsageRightsTemplate(_request.Database, _usageRights,
_request.RequestingPartyType, _request.Session, _request.Database.Server.Timeout,
_request.Database.Server.Timeout, _request.Database.Server.BufferSize, _request.Database.Server.BufferSize);
t = new Transactions.Transaction(process);
AttachSubscriber(process, _request.OnActionChanged);
AttachSubscriber(process, _request.OnAuthorizationDenied);
AttachSubscriber(process, _request.OnComplete);
AttachSubscriber(process, _request.OnError);
AttachSubscriber(process, _request.OnProgress);
AttachSubscriber(process, _request.OnTimeout);
t.Execute();
}
示例5: Execute
public override void Execute()
{
Logger.Storage.Debug("Initializing engine...");
((Providers.EngineBase)_request.Engine).RegisterOnInitialized(_onInitialized);
_ignoringInitializationComplete = false;
_request.Engine.SetState(true, false);
_dsms = new Dictionary<IDatabase, Security.DatabaseSessionManager>();
for (int i = 0; i < _databases.Count; i++)
{
Transactions.Transaction t;
Transactions.Processes.GetAllGroups process;
process = new Transactions.Processes.GetAllGroups(_databases[i],
_request.RequestingPartyType, Security.Session.MakeSecurityOverride(), 15000,
15000, 8194, 8194);
t = new Transactions.Transaction(process);
AttachSubscriber(process, _request.OnActionChanged);
AttachSubscriber(process, _request.OnAuthorizationDenied);
AttachSubscriber(process, _request.OnComplete);
AttachSubscriber(process, _request.OnError);
AttachSubscriber(process, _request.OnProgress);
AttachSubscriber(process, _request.OnTimeout);
//process.OnActionChanged += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task, EngineActionType actionType, bool willSendProgress)
//{
//};
process.OnAuthorizationDenied += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task)
{
Logger.Storage.Error("Authorization failed while running GetAllGroups on Database '" + sender.Database.Name + "'.");
((Providers.EngineBase)_request.Engine).TriggerOnInitialized(false, "Authorization failed.", null);
};
process.OnComplete += delegate(Transactions.Processes.Base sender, ICommandReply reply, object result)
{
lock (_dsms)
{
_dsms.Add(sender.Database, new Security.DatabaseSessionManager(_request.Engine,
sender.Database, ((Transactions.Processes.GetAllGroups)sender).Groups));
if (_dsms.Count == _databases.Count)
{
_request.Engine.SetState(false, true);
Logger.Storage.Debug("Engine initialized.");
_sessionMgr.Initialize(_request.Engine, _dsms);
((Providers.EngineBase)_request.Engine).TriggerOnInitialized(true, "Initialization successful.", null);
}
}
Logger.Storage.Debug("All groups for the database named " + sender.Database.Name + " have been loaded.");
};
process.OnError += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task, string message, Exception exception)
{
Logger.Storage.Error("An error occurred while running GetAllGroups on Database '" + sender.Database.Name + "', message: " + message, exception);
((Providers.EngineBase)_request.Engine).TriggerOnInitialized(false, message, exception);
};
//process.OnProgress += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task, OpenDMS.Networking.Http.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete)
//{
//};
//process.OnTaskComplete += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task)
//{
//};
process.OnTimeout += delegate(Transactions.Processes.Base sender, Transactions.Tasks.Base task)
{
Logger.Storage.Error("A timeout occurred while running GetAllGroups on Database '" + sender.Database.Name + "'.");
((Providers.EngineBase)_request.Engine).TriggerOnInitialized(false, "Timeout", null);
};
t.Execute();
}
}