public void ToStringTest ()
		{
			SaveFileDialog sfd = new SaveFileDialog ();
			sfd.CheckFileExists = true;
			sfd.CreatePrompt = true;
			sfd.DefaultExt = "txt";
			sfd.DereferenceLinks = false;
			sfd.FileName = "default.build";
			sfd.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
			sfd.FilterIndex = 5;
			sfd.InitialDirectory = Path.GetTempPath ();
			sfd.OverwritePrompt = false;
			sfd.RestoreDirectory = true;
			sfd.ShowHelp = true;
			sfd.Title = "Saving";
			sfd.ValidateNames = false;

			StringBuilder sb = new StringBuilder ();
			sb.Append (typeof (SaveFileDialog).FullName);
			sb.Append (": Title: ");
			sb.Append (sfd.Title);
			sb.Append (", FileName: ");
			sb.Append (sfd.FileName);

			Assert.AreEqual (sb.ToString (), sfd.ToString (), "#1");

			sfd.FileName = null;
			sfd.Title = null;

			sb.Length = 0;
			sb.Append (typeof (SaveFileDialog).FullName);
			sb.Append (": Title: ");
			sb.Append (sfd.Title);
			sb.Append (", FileName: ");
			sb.Append (sfd.FileName);

			Assert.AreEqual (sb.ToString (), sfd.ToString (), "#2");
		}
Esempio n. 2
0
 public override string ToString()
 {
     return(_saveFileDialog.ToString());
 }