XAmpleManagedWrapper.XAmpleDLLWrapper.ThrowIfError C# (CSharp) Méthode

ThrowIfError() protected méthode

protected ThrowIfError ( string result ) : void
result string
Résultat void
		protected void ThrowIfError (string result, params string[] filenames)
		{
			// REVIEW JohnH(RandyR):
			// Isn't the none in the XML supposed to have quote marks around it
			// in order to be valid XML?
			// Answer: much of the ample stuff is actually SGML. I don't have the code to check, but
			//chances are I wrote this right to first-time and it's just not good XML.
			//if there is an error tag
			// but doesn't say "none"
			if ((result.Contains("<error")) && (!result.Contains("<error code=none>")))
			{
				string t = Path.GetTempFileName ();
				using (var stream = new StreamWriter(t))
				{
					stream.Write (result);
					stream.Close ();
					string message = filenames.Length == 0 ? result : string.Format("{0}; Files: {1}", result, string.Join(",", filenames));
					throw new ApplicationException (message);
				}
			}
		}