コード例 #1
0
        /// <summary>
        /// Adds a check to the tab and returns true if the check causes a restructure
        /// </summary>
        /// <param name="check">The check display to add to the tab</param>
        /// <returns>True if check is new, false if replacing an existing check or filling an existing space</returns>
        public bool AddCheck(ICheckDisplay check)
        {
            bool returnValue = false;

            var indexInTypesArray = _types.IndexOf(check.GetCheckType());
            if (indexInTypesArray == -1)
            {
                indexInTypesArray = _types.Count;
                _types.Add(check.GetCheckType());
                _checks.AddRow();
                returnValue = true;
            }

            var indexInLocsArray = _locations.IndexOf(check.GetLocation());
            if (indexInLocsArray == -1)
            {
                indexInLocsArray = _locations.Count;
                _locations.Add(check.GetLocation());
                _checks.AddColumn();
                returnValue = true;
            }

            _checks.InsertItem(check, indexInTypesArray, indexInLocsArray);

            LastColumn = indexInLocsArray;
            LastRow = indexInTypesArray;

            return returnValue;
        }
コード例 #2
0
 public CheckDisplayDto(ICheckDisplay check)
 {
     IsLoading = check.IsLoading();
     IsPaused = check.IsPaused();
     HasError = check.HasError();
     IsTriggered = check.IsTriggered();
     Result = check.GetResult();
     Status = check.GetStatus();
     Error = check.GetError();
     Location = check.GetLocation();
     CheckType = check.GetCheckType();
     TabName = check.GetTab();
 }