public ImportMacroScriptsControl(ImportMacroWindow importMacroWindow, MainWindow window)
 {
     this.InitializeComponent();
     this.mImportMacroWindow = importMacroWindow;
     this.ParentWindow       = window;
     ++ImportMacroScriptsControl.mIdCount;
 }
        private void DeleteMacroScript(MacroRecording mRecording)
        {
            string path = Path.Combine(RegistryStrings.MacroRecordingsFolderPath, mRecording.Name + ".json");

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            if (mRecording.Shortcut != null && MainWindow.sMacroMapping.ContainsKey(mRecording.Shortcut))
            {
                MainWindow.sMacroMapping.Remove(mRecording.Shortcut);
            }
            ImportMacroWindow.DeleteScriptNameFromBookmarkedScriptListIfPresent(mRecording.Name);
            MacroGraph.Instance.RemoveVertex((BiDirectionalVertex <MacroRecording>)MacroGraph.Instance.Vertices.Cast <MacroRecording>().Where <MacroRecording>((Func <MacroRecording, bool>)(macro => string.Equals(macro.Name, mRecording.Name, StringComparison.InvariantCultureIgnoreCase))).FirstOrDefault <MacroRecording>());
            if (this.ParentWindow.mAutoRunMacro != null && this.ParentWindow.mAutoRunMacro.Name.ToLower(CultureInfo.InvariantCulture).Trim() == mRecording.Name.ToLower(CultureInfo.InvariantCulture).Trim())
            {
                this.ParentWindow.mAutoRunMacro = (MacroRecording)null;
            }
            CommonHandlers.OnMacroDeleted(mRecording.Name);
        }