From fc8a05358a92cc3c77c5f1e30d536807ef0614fd Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 8 Apr 2019 13:49:55 +0300 Subject: were added scripting projects --- .../Rendering/HeightTreeLineNode.cs | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Rendering/HeightTreeLineNode.cs (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Rendering/HeightTreeLineNode.cs') diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Rendering/HeightTreeLineNode.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Rendering/HeightTreeLineNode.cs new file mode 100644 index 000000000..459f2a56a --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Rendering/HeightTreeLineNode.cs @@ -0,0 +1,49 @@ +// 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.Collections.Generic; +using System.Diagnostics; + +namespace Tango.Scripting.Editors.Rendering +{ + struct HeightTreeLineNode + { + internal HeightTreeLineNode(double height) + { + this.collapsedSections = null; + this.height = height; + } + + internal double height; + internal List collapsedSections; + + internal bool IsDirectlyCollapsed { + get { return collapsedSections != null; } + } + + internal void AddDirectlyCollapsed(CollapsedLineSection section) + { + if (collapsedSections == null) + collapsedSections = new List(); + collapsedSections.Add(section); + } + + internal void RemoveDirectlyCollapsed(CollapsedLineSection section) + { + Debug.Assert(collapsedSections.Contains(section)); + collapsedSections.Remove(section); + if (collapsedSections.Count == 0) + collapsedSections = null; + } + + /// + /// Returns 0 if the line is directly collapsed, otherwise, returns . + /// + internal double TotalHeight { + get { + return IsDirectlyCollapsed ? 0 : height; + } + } + } +} -- cgit v1.3.1