private void OnPausableNodeAdded(PausableNode node)
 {
     if (PausableNodeAdded != null)
     {
         try
         {
             PausableNodeAdded(this, new UmlNodeCreatedEventArgs()
             {
                 Node = node
             });
         }
         catch (Exception e)
         {
             LogService.Log(LogType, LogMessageType.Error, GetType().Name,
                            e.GetType().Name + " while raising PausableNodeAdded event. (" + Name + "): " + e.Message, e);
         }
     }
 }
        public void AddPausableNode(string nodeName, int pauseNumber)
        {
            if (!_isEditable)
            {
                throw new ActivityMachineException("Assembly can only be done while the machine is in an edit mode.");
            }
            SupportsSelfPausing = true;

            // Resulting Continue Guard: (DefaultContinueConstraint)
            // Resulting Quit Guard:     (DefaultQuitConstraint)
            var pauseNode = new PausableNode(nodeName + pauseNumber, Name, this)
            {
                LogType = LogType, Index = pauseNumber
            };

            AddNode(pauseNode);
            OnPausableNodeAdded(pauseNode);
        }