当前位置: 首页>>代码示例>>C#>>正文


C# Transaction.Execute方法代码示例

本文整理汇总了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();
        }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:18,代码来源:DetermineIfInstalled.cs

示例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();
        }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:20,代码来源:AuthenticateUser.cs

示例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();
        }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:18,代码来源:CreateGroup.cs

示例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();
        }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:19,代码来源:ModifyResourceUsageRightsTemplate.cs

示例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();
            }
        }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:69,代码来源:Initialize.cs


注:本文中的System.Transactions.Transaction.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。