internal void ExecuteInitialAction(InitialActionType type) { if (Tracing && m_OnTrace != null) { m_OnTrace(this, new TraceEventArgs(TraceTypes.Info, type.ToString() + Resources.Started, null)); } //Wait until transaction is ended. if (!System.Threading.Monitor.TryEnter(m_transactionsync, this.WaitTime)) { throw new Exception(Resources.TransactionIsAlreadyInProgress); } try { if (this.PacketHandler != null) { foreach (GXInitialActionMessage it in GetInitialCommunicationMessageAttributes(this, type)) { TransactionObject = null; Execute(this, null, this.GXClient, it, true, true); //If transaction is cancelled. if (IsCancelled) { break; } } } } finally { System.Threading.Monitor.Exit(m_transactionsync); if (Tracing && m_OnTrace != null) { m_OnTrace(this, new TraceEventArgs(TraceTypes.Info, type.ToString() + Resources.Ended, null)); } } }