Exemplo n.º 1
0
 private void FillAircraftsLogBookList(AircraftCollection aircraftCollection)
 {
     for (int i = 0; i < aircraftCollection.Count; i++)
     {
         listAircraftsLogBookItem.Add(new AircraftsLogBookItem(aircraftCollection[i]));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Метод осуществляет отображение LogBook All Aircraft
        /// </summary>
        /// <param name="aircraftCollection">Коллекция LogBook</param>
        public void DisplayAircraftCollection(AircraftCollection aircraftCollection)
        {
            aircrafts = aircraftCollection;
            Clear();
            listAircraftsLogBookItem.Clear();
            FillAircraftsLogBookList(aircrafts);
            listAircraftsLogBookItem.Sort(new DefaultLogComparer());


            DisplayAircraftsLogBookList(listAircraftsLogBookItem);
            AdjustSize();
        }
Exemplo n.º 3
0
        private void ArgumentsCreation(object sender, EventArgs e)
        {
            OperatorCollection operators = OperatorCollection.Instance;
            int count = operators.Count;
            DirectiveConditionState condition = DirectiveConditionState.Notify;

            for (int i = 0; i < count; i++)
            {
                Operator           operator_ = operators[i];
                AircraftCollection aircrafts = operator_.AircraftCollection;
                int aircraftCount            = aircrafts.Count;

                for (int j = 0; j < aircraftCount; j++)
                {
                    condition = aircrafts[j].ConditionState;
                }
            }
        }
Exemplo n.º 4
0
        public void InitAsync(BackgroundWorker backgroundWorker, LoadingState loadingState)
        {
            if (backgroundWorker == null)
            {
                return;
            }

            if (loadingState == null)
            {
                loadingState = new LoadingState();
            }
            loadingState.MaxPersentage = 10;

            //Загрузка всех пользователей
            loadingState.CurrentPersentage            = 0;
            loadingState.CurrentPersentageDescription = "Loading Users";
            backgroundWorker.ReportProgress(1, loadingState);

            var users = ApiProvider.GetAllUsersAsync();

            Users = new Dictionary <int, string>();
            foreach (var user in users)
            {
                Users.Add(user.ItemId, user.ToString());
            }

            if (backgroundWorker.CancellationPending)
            {
                return;
            }

            loadingState.CurrentPersentage            = 1;
            loadingState.CurrentPersentageDescription = "Loading Operators";
            backgroundWorker.ReportProgress(1, loadingState);

            Operators = new OperatorCollection(_newLoader.GetObjectList <OperatorDTO, Operator>().ToArray());

            AllOperators = new List <AllOperators>(_newLoader.GetObjectList <AllOperatorsDTO, AllOperators>().ToArray());

            if (backgroundWorker.CancellationPending)
            {
                return;
            }

            loadingState.CurrentPersentage            = 2;
            loadingState.CurrentPersentageDescription = "Loading Aircrafts";
            backgroundWorker.ReportProgress(1, loadingState);

            Aircraft = new AircraftCollection(_newLoader.GetObjectList <CAAAircraftDTO, Aircraft>().ToArray());

            if (backgroundWorker.CancellationPending)
            {
                return;
            }

            //Загрузка всех словарей
            loadingState.CurrentPersentage            = 3;
            loadingState.CurrentPersentageDescription = "Loading Dictionaries";
            backgroundWorker.ReportProgress(1, loadingState);

            GetDictionaries();

            if (backgroundWorker.CancellationPending)
            {
                return;
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Конструктор создающий список Логов
 /// </summary>
 /// <param name="aircraftCollection"></param>
 public AircraftsLogBookList(AircraftCollection aircraftCollection)
     : this()
 {
     InitializeComponent();
     DisplayAircraftCollection(aircraftCollection);
 }