public void Dispose() { ApplicationMacros.Clear(); GlobalMacros.Clear(); AutomationSequences.Clear(); ((IDisposable)WebClient).Dispose(); }
private bool ParseGlobalMacros() { Logging.Info(Logfiles.AutomationRunner, LogOptions.MethodName, "Parsing global macros from xml document to class objects"); GlobalMacros.Clear(); XmlElement result = XmlUtils.GetXmlNodeFromXPath(GlobalMacrosDocument, "/GlobalMacros") as XmlElement; XElement globalMacrosXmlHolder = XElement.Parse(result.OuterXml); PropertyInfo listPropertyInfo = this.GetType().GetProperty(nameof(GlobalMacros)); try { if (!CommonUtils.SetListEntries(this, listPropertyInfo, globalMacrosXmlHolder.Elements())) { return(false); } } catch (Exception ex) { Logging.AutomationRunner(ex.ToString(), LogLevel.Exception); return(false); } foreach (AutomationMacro macro in GlobalMacros) { macro.MacroType = MacroType.Global; } return(true); }