Nexus.Client.Games.Settings.RequiredDirectoriesControlVM.ValidateDirectory C# (CSharp) Method

ValidateDirectory() protected method

Validates the specified directory.
protected ValidateDirectory ( string p_strPath, string p_strPathName, string p_strProperty ) : bool
p_strPath string
p_strPathName string
p_strProperty string
return bool
		protected bool ValidateDirectory(string p_strPath, string p_strPathName, string p_strProperty)
		{
			Errors.Clear(p_strProperty);
			if (String.IsNullOrEmpty(p_strPath))
			{
				Errors.SetError(p_strProperty, String.Format("You must select a {0}.", p_strPathName));
				return false;
			}
			else if (
				(String.Equals(EnvironmentInfo.Settings.InstallationPaths[GameModeDescriptor.ModeId], p_strPath)) ||
				(p_strPath.Length <= 4)
				)
			{
				Errors.SetError(p_strProperty, string.Format("You can't set the {0} equal to the following:" + Environment.NewLine +
					"HD root - {2}" + Environment.NewLine +
					"Game root folder - {1}" + Environment.NewLine,
					p_strPathName, EnvironmentInfo.Settings.InstallationPaths[GameModeDescriptor.ModeId],
					Path.GetPathRoot(p_strPath)));
				return false;
			}
			else
			{
				try
				{
					if (String.Equals(GameModeDescriptor.PluginDirectory, p_strPath))
					{
						Errors.SetError(p_strProperty, string.Format("You can't set the {0} equal to the plugin folder.", p_strPathName));
						return false;
					}
				}
				catch (ArgumentNullException)
				{
					// If the game doesn't supports plugins no need to check for it.
				}
			}

			return true;
		}

Same methods

RequiredDirectoriesControlVM::ValidateDirectory ( string p_strModPath, string p_strModPathName, string p_strModProperty, string p_strInstallPath, string p_strInstallPathName, string p_strInstallProperty, string p_strToolPath, string p_strToolPathName, string p_strToolProperty ) : bool