aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Models/HardwareComponent.cs
blob: c0610dd5f989b0c52b7fddfe2eefd35a3acb8d45 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;

namespace Tango.MachineStudio.MachineDesigner.Models
{
    public class HardwareComponent : ExtendedObject, IHasDifference
    {
        public String ComponentName { get; set; }
        public String Description { get; set; }
        public SynchronizedObservableCollection<HardwareParameter> Properties { get; set; }
        public bool HasDifferences
        {
            get
            {
                return Properties.Any(item => item.HasDifferences);
            }
        }

        public HardwareComponent()
        {
            Properties = new SynchronizedObservableCollection<HardwareParameter>();
        }
        
    }
}
span> start, DocumentLine end) { this.heightTree = heightTree; this.start = start; this.end = end; #if DEBUG unchecked { this.ID = " #" + (nextId++); } #endif } /// <summary> /// Gets if the document line is collapsed. /// This property initially is true and turns to false when uncollapsing the section. /// </summary> public bool IsCollapsed { get { return start != null; } } /// <summary> /// Gets the start line of the section. /// When the section is uncollapsed or the text containing it is deleted, /// this property returns null. /// </summary> public DocumentLine Start { get { return start; } internal set { start = value; } } /// <summary> /// Gets the end line of the section. /// When the section is uncollapsed or the text containing it is deleted, /// this property returns null. /// </summary> public DocumentLine End { get { return end; } internal set { end = value; } } /// <summary> /// Uncollapses the section. /// This causes the Start and End properties to be set to null! /// Does nothing if the section is already uncollapsed. /// </summary> public void Uncollapse() { if (start == null) return; heightTree.Uncollapse(this); #if DEBUG heightTree.CheckProperties(); #endif start = null; end = null; } /// <summary> /// Gets a string representation of the collapsed section. /// </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.ToString")] public override string ToString() { return "[CollapsedSection" + ID + " Start=" + (start != null ? start.LineNumber.ToString() : "null") + " End=" + (end != null ? end.LineNumber.ToString() : "null") + "]"; } } }