CCNet.Build.Reconfigure.CloudServiceProjectPage.ParseTitle C# (CSharp) Method

ParseTitle() private method

private ParseTitle ( string>.Dictionary properties ) : string
properties string>.Dictionary
return string
		private string ParseTitle(Dictionary<string, string> properties)
		{
			var title = FindByKey(properties, key => key.Contains("titl"));

			if (title == null)
				throw new InvalidOperationException("Cannot find project title.");

			var norm = title.AsciiOnly(' ', '-').CleanWhitespaces();
			if (norm.Length < 10)
				throw new InvalidOperationException("Something is wrong with project title.");

			if (title != norm)
				throw new ArgumentException($"Project title '{title}' does not look well-formed.");

			return title;
		}