public override void Process() { Remoting.SaveSingle rem; try { Transitions.GlobalUsageRights txGur = new Transitions.GlobalUsageRights(); rem = new Remoting.SaveSingle(_db, txGur.Transition(_gur), _sendTimeout, _receiveTimeout, _sendBufferSize, _receiveBufferSize); } catch (Exception e) { Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.SaveSingle object.", e); throw; } rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply) { if (!((Commands.PutDocumentReply)reply).Ok) { GlobalUsageRights = null; } else { GlobalUsageRights = new CouchDB.GlobalUsageRights(((Commands.PutDocumentReply)reply).Rev, _gur.UsageRights); } TriggerOnComplete(reply); }; rem.OnError += delegate(Remoting.Base sender, string message, Exception exception) { TriggerOnError(message, exception); }; rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete) { TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete); }; rem.OnTimeout += delegate(Remoting.Base sender) { TriggerOnTimeout(); }; rem.Process(); }
public override void Process() { Remoting.SaveSingle rem; try { Transitions.GlobalUsageRights txGur = new Transitions.GlobalUsageRights(); rem = new Remoting.SaveSingle(_db, txGur.Transition(_gur), _sendTimeout, _receiveTimeout, _sendBufferSize, _receiveBufferSize); } catch (Exception e) { Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.SaveSingle object.", e); throw; } rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply) { if (!((Commands.PutDocumentReply)reply).Ok) GlobalUsageRights = null; else { GlobalUsageRights = new CouchDB.GlobalUsageRights(((Commands.PutDocumentReply)reply).Rev, _gur.UsageRights); } TriggerOnComplete(reply); }; rem.OnError += delegate(Remoting.Base sender, string message, Exception exception) { TriggerOnError(message, exception); }; rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete) { TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete); }; rem.OnTimeout += delegate(Remoting.Base sender) { TriggerOnTimeout(); }; rem.Process(); }
public override void Process() { Remoting.Get rem; TriggerOnActionChanged(EngineActionType.GettingGlobalUsageRights, true); try { rem = new Remoting.Get(_db, new GlobalUsageRights(null, null).Id, _sendTimeout, _receiveTimeout, _sendBufferSize, _receiveBufferSize); } catch (Exception e) { Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.Get object.", e); throw; } rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply) { Transitions.GlobalUsageRights txGur = new Transitions.GlobalUsageRights(); GlobalUsageRights = (GlobalUsageRights)txGur.Transition(((Remoting.Get)sender).Document); TriggerOnComplete(reply); }; rem.OnError += delegate(Remoting.Base sender, string message, Exception exception) { TriggerOnError(message, exception); }; rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete) { TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete); }; rem.OnTimeout += delegate(Remoting.Base sender) { TriggerOnTimeout(); }; rem.Process(); }