aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Rendering/VisualLinesInvalidException.cs
blob: bfbae27b0eae041f453eeb59d0bd6600069e9cbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;
using System.Runtime.Serialization;

namespace Tango.Scripting.Editors.Rendering
{
	/// <summary>
	/// A VisualLinesInvalidException indicates that you accessed the <see cref="TextView.VisualLines"/> property
	/// of the <see cref="TextView"/> while the visual lines were invalid.
	/// </summary>
	[Serializable]
	public class VisualLinesInvalidException  : Exception
	{
		/// <summary>
		/// Creates a new VisualLinesInvalidException instance.
		/// </summary>
		public VisualLinesInvalidException() : base()
		{
		}
		
		/// <summary>
		/// Creates a new VisualLinesInvalidException instance.
		/// </summary>
		public VisualLinesInvalidException(string message) : base(message)
		{
		}
		
		/// <summary>
		/// Creates a new VisualLinesInvalidException instance.
		/// </summary>
		public VisualLinesInvalidException(string message, Exception innerException) : base(message, innerException)
		{
		}
		
		/// <summary>
		/// Creates a new VisualLinesInvalidException instance.
		/// </summary>
		protected VisualLinesInvalidException(SerializationInfo info, StreamingContext context) : base(info, context)
		{
		}
	}
}
">String fileName) { return Path.GetFullPath(@"..\..\..\Resources\" + fileName); } /// <summary> /// Gets the absolute path to the 'Resources' folder. /// </summary> /// <returns></returns> public static String GetResourcePath() { return Path.GetFullPath(@"..\..\..\Resources\"); } /// <summary> /// Gets the PMR (Protobuf Messages Repository) path. /// </summary> /// <returns></returns> public static String GetPMRPath() { return Path.GetFullPath(@"..\..\..\PMR\Messages\"); } /// <summary> /// Gets the machine studio exe path. /// </summary> /// <returns></returns> public static String GetMachineStudioPath() { return Path.GetFullPath(@"..\..\Build\Debug\Tango.MachineStudio.UI.exe"); } /// <summary> /// Gets the tango build path. /// </summary> /// <returns></returns> public static String GetBuildPath() { return Path.GetFullPath(@"..\..\Build\Debug"); } /// <summary> /// Gets the SQLite database file path in DB folder. /// </summary> /// <returns></returns> public static String GetSQLiteFilePath() { return Path.GetFullPath(@"..\..\..\DB\Tango.db"); } /// <summary> /// Initializes the logging manager. /// </summary> public static ConsoleLogger InitializeLogging(bool useConsole = false, [CallerMemberName] string testName = null) { LogManager.Default.RegisterLogger(new FileLogger(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs", "Unit Testing"), "Unit_Testing")); if (useConsole) { var consoleLogger = new ConsoleLogger(testName); LogManager.Default.RegisterLogger(consoleLogger); return consoleLogger; } return null; } /// <summary> /// Creates a temporary folder and returns it's path. /// </summary> /// <returns></returns> public static String GetTempFolderPathAppend(String customFolder, [CallerMemberName] string testName = null) { String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", "Unit Testing", testName, customFolder); Directory.CreateDirectory(tempDirectory); return tempDirectory; } /// <summary> /// Creates a temporary folder and returns it's path. /// </summary> /// <returns></returns> public static String GetTempFolderPath([CallerMemberName] string testName = null) { String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", "Unit Testing", testName, Path.GetRandomFileName()); Directory.CreateDirectory(tempDirectory); return tempDirectory; } /// <summary> /// Tries to delete folder. /// </summary> /// <param name="path">The path.</param> /// <returns></returns> public static bool TryDeleteFolder(String path) { try { Directory.Delete(path, true); return true; } catch { return false; } } /// <summary> /// Shows the file in explorer. /// </summary> /// <param name="path">Name of the file/folder.</param> public static void ShowInExplorer(String path) { Process.Start("explorer.exe", string.Format("/select,\"{0}\"", path)); } /// <summary> /// Returns true if the two objects are equal by using deep equal. /// </summary> /// <param name="obj1">First object.</param> /// <param name="obj2">Second object.</param> /// <returns></returns> public static bool IsDeepEqual(Object obj1, Object obj2) { return obj1.IsDeepEqual(obj2); } } }