Opc.Ua.Configuration.ManagedApplication.GetConfigFileFromAppConfig C# (CSharp) Method

GetConfigFileFromAppConfig() private method

Gets the config file location from app config.
private GetConfigFileFromAppConfig ( FileInfo appConfigFile ) : string
appConfigFile System.IO.FileInfo
return string
        private string GetConfigFileFromAppConfig(FileInfo appConfigFile)
        {
            try
            {
                XmlTextReader reader = new XmlTextReader(appConfigFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite));

                try
                {
                    reader.MoveToContent();

                    if (reader.ReadToDescendant("ConfigurationLocation", Namespaces.OpcUaConfig))
                    {
                        if (reader.ReadToDescendant("FilePath", Namespaces.OpcUaConfig))
                        {
                            reader.MoveToContent();
                            return reader.ReadInnerXml();
                        }
                    }

                    return null;
                }
                finally
                {
                    reader.Close();
                }
            }
            catch (Exception)
            {
                return null;
            }
        }