internal void Setup( ServiceCommandExecution serviceCommandExecution )
        {
            Service = serviceCommandExecution.Service ;
            _command = serviceCommandExecution.Command ;

            _xData = ElementUtil.GetData( _command ) ;

            if ( _xData == null )
            {
                _title.Text = Service.Name ;
                _instructions.Visibility = System.Windows.Visibility.Visible ;

                ClearXForm();

                if ( !string.IsNullOrEmpty( _command.Node )
                        && _command.Note != null )
                {
                    _instructions.Text = _command.Note.Value;
                }
                else
                {
                    _instructions.Text = Properties.Resources.Constant_IncompleteData ;
                }
            }
            else
            {
                SetupXData( _xData ) ;
            }
        }
        protected void DisplayQuestionaireInternal(Command command, Service service)
        {
            ServiceCommandExecution serviceCommandExecution = new ServiceCommandExecution(command, service);

            CommandExecute commandExecuteWindow;

            try
            {
                commandExecuteWindow = new CommandExecute(serviceCommandExecution);
                commandExecuteWindow.Show();
            }

            catch (WindowExistsException e)
            {
                commandExecuteWindow = (CommandExecute)e.Control;
                commandExecuteWindow.Redisplay(serviceCommandExecution);
            }

            if (command.Status == Status.canceled)
            {
                EventInfo eventinfo = new EventInfo(string.Format(Resources.Event_CommandCancelled, service.Name));
                Events.Instance.OnEvent(this, eventinfo);

                commandExecuteWindow.Close();
            }
        }
        internal CommandExecute(ServiceCommandExecution serviceCommandExecution)
            : base(_keyBase, serviceCommandExecution.Service.Jid.ToString())
        {
            InitializeComponent();

            DataContext = serviceCommandExecution;

            _execute.Setup(serviceCommandExecution);
            serviceCommandExecution.CommandExec = this;
        }
 internal void Redisplay(ServiceCommandExecution serviceCommandExecution)
 {
     _execute.Setup(serviceCommandExecution);
     serviceCommandExecution.CommandExec = this;
 }