/// <summary> /// Осуществляет заполнение пользовательских элементов управления на основе данных бизнес коллекции /// </summary> public override void FillUIElementsFromCollection() { //Collection = TemplateAircraftCollection.Instance; Collection.Clear(); for (int i = 0; i < TemplateAircraftCollection.Instance.Count; i++) { Collection.Add(TemplateAircraftCollection.Instance[i]); } aircraftsListStatistics.Amount = Collection.Count; items.Clear(); flowLayoutPanelAircrafts.Controls.Clear(); Collection.Sort(new TemplateAircraftModelComparer()); for (int i = 0; i < Collection.Count; i++) { AircraftReferenceStatusImageLinkLabel tempLabel = new AircraftReferenceStatusImageLinkLabel(Collection[i]); //tempButton.SecondaryTextPosition = 60; tempLabel.Text = Collection[i].Model; tempLabel.Width = 300; tempLabel.Enabled = true; // tempButton.Icon = icons.GreenArrow; // tempButton.SecondText = ""; tempLabel.DisplayerText = Collection[i].Model; tempLabel.DisplayerRequested += tempButton_DisplayerRequested; tempLabel.ReflectionType = ReflectionTypes.DisplayInNew; items.Add(tempLabel); } aircraftsListStatistics.Amount = items.Count; Array.Sort(items.ToArray(), new AircraftReferenceStatusImageLinkLabelComparer()); flowLayoutPanelAircrafts.Controls.AddRange(items.ToArray()); }
private void animatedThreadWorker_WorkFinished(object sender, EventArgs e) { item.DisplayRequested(); animatedThreadWorker.StopThread(); animatedThreadWorker = null; item = null; if (TaskEnd != null) { TaskEnd(this, new EventArgs()); } }
private void tempButton_DisplayerRequested(object sender, ReferenceEventArgs e) { tempStore = (AircraftProxy)((Store)(((AircraftReferenceStatusImageLinkLabel)sender).Aircraft)).GetProxy(); if (animatedThreadWorker == null) { if (TaskStart != null) { TaskStart(this, new EventArgs()); } item = (AircraftReferenceStatusImageLinkLabel)sender; e.Cancel = true; animatedThreadWorker = new AnimatedThreadWorker(BackgroundAircraftLoad, sender, this); animatedThreadWorker.State = "Loading " + tempStore.RegistrationNumber; animatedThreadWorker.StartThread(); animatedThreadWorker.WorkFinished += animatedThreadWorker_WorkFinished; } else { e.RequestedEntity = new DispatcheredStoreScreen(tempStore); } }
/// <summary> /// Обновляет отображаемую информацию /// </summary> public override void FillUIElementsFromCollection() { int count = Collection.Count; items = new List <AircraftReferenceStatusImageLinkLabel>(); flowLayoutPanelAircrafts.Controls.Clear(); for (int i = 0; i < count; i++) { AircraftReferenceStatusImageLinkLabel tempItem = new AircraftReferenceStatusImageLinkLabel(Collection[i]); tempItem.Text = Collection[i].Name; tempItem.Enabled = true; tempItem.DisplayerText = Collection[i].Operator.Name + ". " + Collection[i].Name; tempItem.DisplayerRequested += tempButton_DisplayerRequested; tempItem.ReflectionType = ReflectionTypes.DisplayInNew; items.Add(tempItem); storeCollection[i].Saved -= StoreCollectionControl_Saved; storeCollection[i].Saved += StoreCollectionControl_Saved; } aircraftsListStatistics.Amount = items.Count; items.Sort(new AircraftReferenceStatusImageLinkLabelComparer()); flowLayoutPanelAircrafts.Controls.AddRange(items.ToArray()); }