PHP.Core.ApplicationConfiguration.PathsSection.CheckedPath C# (CSharp) Method

CheckedPath() private method

private CheckedPath ( string value, XmlNode node ) : FullPath
value string
node System.Xml.XmlNode
return FullPath
			private FullPath CheckedPath(string value, XmlNode/*!*/node)
			{
                Debug.Assert(node != null);

				FullPath result;

				// checks path correctness:
				try
				{
                    string root = ConfigUtils.GetConfigXmlPath(node.OwnerDocument);
                    if (root != null) value = Path.Combine(Path.GetDirectoryName(root), value);

					result = new FullPath(value);
				}
				catch (ArgumentException e)
				{
					throw new ConfigurationErrorsException(e.Message, node);
				}

				// checks directory existance:
				if (!result.IsEmpty && !Directory.Exists(result))
					throw new ConfigurationErrorsException(CoreResources.GetString("directory_not_exists", result), node);

				return result;
			}
ApplicationConfiguration.PathsSection