// string errorMessageInTheGatheringCycle = String.Empty;
// bool errorInTheGatheringCycle = false;
// string errorMessageInTheInnerCycle = String.Empty;
// bool errorInTheInnerCycle = false;

        protected override void BeginProcessing()
        {
            if (!NoUI)
            {
                Timeout = 604800000;
                // frmRecorder formRecorder =
                CurrentData.formRecorder =
                    new RecorderForm(this);
                // formRecorder.ShowDialog();
                CurrentData.formRecorder.Show();
                CurrentData.formRecorder.Hide();
                try {
                    Events.SubscribeEvent((object)CurrentData.formRecorder.btnStop,
                                          "BtnStopClick",
                                          "formRecorder",
                                          new PSObject(),
                                          ScriptBlock.Create(""),  // CurrentData.formRecorder.BtnStopClick,
                                          true,
                                          false);
                } catch { }
                CurrentData.formRecorder.ShowDialog();
                return;
            }
            else
            {
                UiaHelper.ProcessingTranscript(this);
            }
            #region old
// Global.GTranscript = true;
// int counter = 0;
//
// if (!this.NoUI) {
// this.Timeout = 604800000;
// }
//
//  // 20120206 System.Windows.Automation.AutomationElement rootElement =
//  // 20120206     System.Windows.Automation.AutomationElement.RootElement;
// rootElement =
// System.Windows.Automation.AutomationElement.RootElement;
//  // 20120206 System.DateTime startDate =
// startDate =
// System.DateTime.Now;
// do
// {
// RunOnSleepScriptBlocks(this);
// System.Threading.Thread.Sleep(Preferences.TranscriptInterval);
// while (Paused) {
// System.Threading.Thread.Sleep(Preferences.TranscriptInterval);
// }
// counter++;
//
// try {
//  // use Windows forms mouse code instead of WPF
// System.Drawing.Point mouse = System.Windows.Forms.Cursor.Position;
// System.Windows.Automation.AutomationElement element =
// System.Windows.Automation.AutomationElement.FromPoint(
// new System.Windows.Point(mouse.X, mouse.Y));
// if (element != null)
// {
// processingElement(element);
// }
// if (errorInTheGatheringCycle) {
// WriteDebug(this, "An error is in the control hierarchy gathering cycle");
// WriteDebug(this, errorMessageInTheGatheringCycle);
// errorInTheGatheringCycle = false;
// }
// } catch (Exception eUnknown) {
// WriteDebug(this, eUnknown.Message);
// }
// System.DateTime nowDate = System.DateTime.Now;
// if ((nowDate - startDate).TotalSeconds > this.Timeout/1000) break;
// } while (Global.GTranscript);
            #endregion old
        }