Beispiel #1
0
        /// <summary>
        /// Добавляет элемент с указанием группы в которой он находится
        /// </summary>
        /// <param name="item">Добавляемый элемент</param>
        protected override ListViewItem AddItem(Detail item)
        {
            string[]     itemsString  = GetItemsString(item);
            ListViewItem listViewItem = new ListViewItem(itemsString);

            listViewItem.SubItems.Add(item.AtaChapter.FullName);
            if (landingGearsFilter.Acceptable(item))
            {
                listViewItem.SubItems.Add(TermsProvider.GetLandingGearPositionFullName(((GearAssembly)item.Parent).LandingGearMark.ToString()));
            }
            listViewItem.BackColor = item.Highlight.Color;

            if (item.ConditionState == DirectiveConditionState.Notify)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotifyColor;
            }
            else if (item.ConditionState == DirectiveConditionState.NotSatisfactory)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotSatisfactoryColor;
            }

            listViewItem.Tag = item;
            ItemsHash.Add(item, listViewItem);
            ListViewItemList.Add(listViewItem);
            return(listViewItem);
        }
Beispiel #2
0
        private void SetGroupToItemLandingGear()
        {
            ItemsListView.Groups.Clear();
            int count = ListViewItemList.Count;

            if (count == 0)
            {
                return;
            }
            AddGroup(TermsProvider.GetLandingGearPositionFullName("NLG"));
            AddGroup(TermsProvider.GetLandingGearPositionFullName("LH"));
            AddGroup(TermsProvider.GetLandingGearPositionFullName("RH"));

            for (int i = 0; i < count; i++)
            {
                int landingGearGroupIndex = ListViewItemList[i].SubItems.Count - 1;
                ListViewItemList[i].Group = ItemsListView.Groups[ListViewItemList[i].SubItems[landingGearGroupIndex].Text];
            }
        }
Beispiel #3
0
        public override void EditItem(Detail oldItem, Detail modifiedItem)
        {
            string[] itemsString         = GetItemsString(modifiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            Detail detail = GetDetailReferenceByDetailID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            //ListViewItem listViewItem = new ListViewItem(modifiedItem.AtaChapter.ShortName);
            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.AtaChapter.ShortName;
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.SubItems.Add(modifiedItem.AtaChapter.FullName);
            if (landingGearsFilter.Acceptable(modifiedItem))
            {
                listViewItem.SubItems.Add(TermsProvider.GetLandingGearPositionFullName(modifiedItem.PositionNumber));
            }
            listViewItem.BackColor = modifiedItem.Highlight.Color;

            if (modifiedItem.ConditionState == DirectiveConditionState.Notify)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotifyColor;
            }
            else if (modifiedItem.ConditionState == DirectiveConditionState.NotSatisfactory)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotSatisfactoryColor;
            }

            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            //SortItems(oldColumnIndex);
            ItemsListView.Refresh();
            SetTotalText();
        }