protected override void AnimatedThreadWorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled)
     {
         return;
     }
     _directivesViewer.SetItemsArray(_resultDirectiveArray.ToArray());
     headerControl.PrintButtonEnabled = _directivesViewer.ItemsCount != 0;
     _directivesViewer.Focus();
 }
示例#2
0
 private void TransferedDetailFormShow()
 {
     if (_transferedComponentForm != null)
     {
         _transferedComponentForm.Show();
     }
     else
     {
         if (_removedComponents.Count > 0 || _waitRemoveConfirmComponents.Count > 0 ||
             _installedComponents.Count > 0)
         {
             _transferedComponentForm = new TransferedComponentForm(_removedComponents.ToArray(),
                                                                    _removedTransfers.ToArray(),
                                                                    _waitRemoveConfirmComponents.ToArray(),
                                                                    _waitRemoveConfirmTransfers.ToArray(),
                                                                    _installedComponents.ToArray(),
                                                                    _installedTransfers.ToArray(),
                                                                    SmartCoreType.Supplier);
             _transferedComponentForm.Show();
             _transferedComponentForm.Closed            += TransferedComponentFormClosed;
             _transferedComponentForm.ButtonAddClick    += TransferedComponentFormButtonAddClick;
             _transferedComponentForm.ButtonDeleteClick += TransferedComponentFormButtonDeleteClick;
             _transferedComponentForm.ButtonCancelClick += TransferedComponentFormButtonCancelClick;
         }
     }
 }
示例#3
0
 protected override void AnimatedThreadWorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled)
     {
         return;
     }
     _directivesViewer.SetItemsArray(_initialDirectiveArray.ToArray());
     _directivesViewer.Focus();
 }
        ///<summary>
        ///</summary>
        ///<param name="initialCollection"></param>
        ///<param name="resultCollection"></param>
        private void FilterItems(TransferRecordCollection initialCollection, TransferRecordCollection resultCollection)
        {
            if (_filter == null || _filter.All(i => i.Values.Length == 0))
            {
                resultCollection.Clear();
                resultCollection.AddRange(initialCollection.ToArray());
                return;
            }

            resultCollection.Clear();

            foreach (var pd in initialCollection)
            {
                if (_filter.FilterTypeAnd)
                {
                    bool acceptable = true;
                    foreach (ICommonFilter filter in _filter)
                    {
                        acceptable = filter.Acceptable(pd); if (!acceptable)
                        {
                            break;
                        }
                    }
                    if (acceptable)
                    {
                        resultCollection.Add(pd);
                    }
                }
                else
                {
                    bool acceptable = true;
                    foreach (ICommonFilter filter in _filter)
                    {
                        if (filter.Values == null || filter.Values.Length == 0)
                        {
                            continue;
                        }
                        acceptable = filter.Acceptable(pd); if (acceptable)
                        {
                            break;
                        }
                    }
                    if (acceptable)
                    {
                        resultCollection.Add(pd);
                    }
                }
            }
        }