Exemplo n.º 1
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();

/*            List<AbstractDetail> containedDetails = new List<AbstractDetail>();
 *          if (currentAircraft != null)
 *          {
 *              containedDetails.AddRange(currentAircraft.Engines);
 *              if (currentAircraft.Apu != null)
 *                  containedDetails.Add(currentAircraft.Apu);
 *              containedDetails.AddRange(currentAircraft.LandingGears);
 *              containedDetails.AddRange(currentAircraft.AircraftFrame.ContainedDetails);
 *          }
 *          else
 *          {
 *              for (int i = 0; i < currentOperator.Stores.Count; i++)
 *                  containedDetails.AddRange(currentOperator.Stores[i].Engines);
 *              for (int i = 0; i < currentOperator.Stores.Count; i++)
 *                  if (currentOperator.Stores[i].Apu != null)
 *                      containedDetails.Add(currentOperator.Stores[i].Apu);
 *              for (int i = 0; i < currentOperator.Stores.Count; i++)
 *                  containedDetails.AddRange(currentOperator.Stores[i].LandingGears);
 *              for (int i = 0; i < currentOperator.Stores.Count; i++)
 *                  containedDetails.AddRange(currentOperator.Stores[i].AircraftFrame.ContainedDetails);
 *          }*/
            //   AddItems(containedDetails.ToArray());
            SetTotalText();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Обновляет элементы ListView
 /// </summary>
 public override void UpdateItems()
 {
     ItemsHash.Clear();
     ListViewItemList.Clear();
     ItemsListView.Items.Clear();
     selectedItemsList.Clear();
     AddItems(Flights.ToArray());
     SetTotalText();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Событие возникающее при изменении массива выбранных элементов в списке элементов, которые отображаются в списке, вот!
        /// </summary>
        //public event EventHandler<SelectedItemsChangeEventArgs> SelectedItemsChanged;
        #endregion

        #endregion

        #region Methods

        #region private void SetResource()

        private void SetResource()
        {
            ItemsListView.Items.Clear();
            ItemsListView.Groups.Clear();
            ItemsListView.Columns.Clear();
            ColumnHeaderList.Clear();
            ListViewItemList.Clear();
            SetHeaders();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Событие возникающее при изменении массива выбранных элементов в списке элементов, которые отображаются в списке, вот!
        /// </summary>
        //public event EventHandler<SelectedItemsChangeEventArgs> SelectedItemsChanged;
        #endregion

        #endregion

        #region Methods

        #region public override void UpdateItems()

        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();
            AddItems(parentAircraft.WorkPackages);
            SetTotalText();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();

            AddItems(currentAircraft.ATLBs);
            SetTotalText();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Событие возникающее при изменении массива выбранных элементов в списке элементов, которые отображаются в списке, вот!
        /// </summary>
        //public event EventHandler<SelectedItemsChangeEventArgs> SelectedItemsChanged;
        #endregion

        #endregion

        #region Methods

        #region public override void UpdateItems()

        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();

            AddItems(currentWorkPackage.Items.ToArray());
            SetTotalText();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();


            AddItems(currentATLB.Flights);
            SetTotalText();
            //ItemsListView.EndUpdate(); // Если не вызвать этот метод список не появится после обновления
        }
Exemplo n.º 8
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();
            List <AbstractRecord> records = new List <AbstractRecord>();

            records.AddRange(currentDetail.GetActualSettingRecords());
            records.AddRange(currentDetail.GetTransferRecords());
            records.AddRange(currentDetail.GetDetailDirectivesPerformances());

            AddItems(records.ToArray());
            SetTotalText();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();
            List <DirectiveRecord> records       = new List <DirectiveRecord>(currentDirective.GetPerformances());
            DirectiveRecord        closingRecord = currentDirective.GetClosingRecord();

            if (closingRecord != null)
            {
                records.Add(closingRecord);
            }
            AddItems(records.ToArray());
            SetTotalText();
        }
Exemplo n.º 10
0
        /// <summary>
        /// Заполняет listview элементами
        /// </summary>
        /// <param name="itemsArray">Массив элементов</param>
        public virtual void SetItemsArray(T[] itemsArray)
        {
            if (itemsArray == null)
            {
                throw new ArgumentNullException("itemsArray", "itemsArray can't be null");
            }
            itemsListView.Clear();
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ColumnHeaderList.Clear();
            ItemsListView.Items.Clear();
            //ItemsListView.Groups.Clear();
            selectedItemsList = new List <T>();
            SetHeaders();

            AddItems(itemsArray);
            SetTotalText();
        }
Exemplo n.º 11
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();

            List <AbstractDetail> containedDetails = new List <AbstractDetail>();

            if (currentStore != null)
            {
                containedDetails.AddRange(currentStore.Engines);
                if (currentStore.Apu != null)
                {
                    containedDetails.Add(currentStore.Apu);
                }
                containedDetails.AddRange(currentStore.LandingGears);
                containedDetails.AddRange(currentStore.AircraftFrame.ContainedDetails);
            }
            else
            {
                for (int i = 0; i < currentOperator.Stores.Count; i++)
                {
                    containedDetails.AddRange(currentOperator.Stores[i].Engines);
                }
                for (int i = 0; i < currentOperator.Stores.Count; i++)
                {
                    if (currentOperator.Stores[i].Apu != null)
                    {
                        containedDetails.Add(currentOperator.Stores[i].Apu);
                    }
                }
                for (int i = 0; i < currentOperator.Stores.Count; i++)
                {
                    containedDetails.AddRange(currentOperator.Stores[i].LandingGears);
                }
                for (int i = 0; i < currentOperator.Stores.Count; i++)
                {
                    containedDetails.AddRange(currentOperator.Stores[i].AircraftFrame.ContainedDetails);
                }
            }
            AddItems(containedDetails.ToArray());
            SetTotalText();
        }
Exemplo n.º 12
0
 /// <summary>
 /// Обновляет элементы ListView
 /// </summary>
 public override void UpdateItems()
 {
     ItemsHash.Clear();
     ListViewItemList.Clear();
     ItemsListView.Items.Clear();
     selectedItemsList.Clear();
     if (currentStore != null)
     {
         AddItems(currentStore.StockDetailInfos);
     }
     else
     {
         List <StockDetailInfo> items = new List <StockDetailInfo>();
         for (int i = 0; i < currentOperator.Stores.Count; i++)
         {
             items.AddRange(currentOperator.Stores[i].StockDetailInfos);
         }
         AddItems(items.ToArray());
     }
     SetTotalText();
 }
Exemplo n.º 13
0
        private void SortListView(int columnIndex)
        {
            if (oldColumnIndex != columnIndex)
            {
                sortMultiplier = -1;
            }
            if (sortMultiplier == 1)
            {
                sortMultiplier = -1;
            }
            else
            {
                sortMultiplier = 1;
            }
            if (columnIndexQueue.Count >= SORT_MEMORY_COUNT)
            {
                columnIndexQueue.Dequeue();
                columnIndexQueue.Enqueue(columnIndex);
            }
            else
            {
                columnIndexQueue.Enqueue(columnIndex);
            }

            ItemsListView.Items.Clear();
            List <ListViewItem> commonList = new List <ListViewItem>();

            if (currentAircraft != null)
            {
                foreach (
                    KeyValuePair <BaseDetail, Dictionary <string, List <ListViewItem> > > dictionaryBaseDetailPair in
                    dictionaryBaseDetail)
                {
                    foreach (KeyValuePair <string, List <ListViewItem> > group in dictionaryBaseDetailPair.Value)
                    {
                        group.Value.Sort(new DiscrepanciesListViewComparer(columnIndexQueue, sortMultiplier));
                        commonList.AddRange(group.Value);
                    }
                }
                SetGroup(currentAircraft);
            }
            if (currentBaseDetail != null)
            {
                foreach (KeyValuePair <string, List <ListViewItem> > group in dictionaryGroupOrder)
                {
                    group.Value.Sort(new DiscrepanciesListViewComparer(columnIndexQueue, sortMultiplier));
                    commonList.AddRange(group.Value);
                }
                SetGroup();
            }
            ListViewItemList.Clear();
            ListViewItemList = commonList;
            ItemsListView.Items.AddRange(commonList.ToArray());
            if (currentAircraft != null)
            {
                if (currentAircraft.MaintenanceDirectiveCondition != DirectiveConditionState.Satisfactory)
                {
                    AddMaintenanceStatusDirective();
                }
            }
            ShowGroups     = true;
            oldColumnIndex = columnIndex;
        }