public WorkingOrderCollectionView(WorkingOrderCollection <TType> workingOrderCollection)
            : base(workingOrderCollection)
        {
            // This will evaluation several filters to see if a workingOrder should be in the view.
            this.Filter = this.ProcessFilterList;

            // This lets us know that a new filter has been added to the collection so we can refresh the view.
            this.filterList.CollectionChanged += this.OnFilterListChanged;
        }
        /// <summary>
        /// Handles generic faults.
        /// </summary>
        /// <param name="workingOrders">The batch of Working Order updates.</param>
        /// <param name="batchFault">The generic FaultException.</param>
        void HandleFaultException(WebService.WorkingOrder[] workingOrders, FaultException faultException)
        {
            // This will try to make the generic faults less generic.  The same thing could have been accomplished with a 'Catch' clause but then we would have
            // needed a separate foreground handler for each kind of fault.  This will test to see if we had an 'InsufficientClaims' fault which will invoke a
            // specific message.
            FaultException <InsufficientClaimsFault> insufficientClaimsFault = faultException as FaultException <InsufficientClaimsFault>;

            if (insufficientClaimsFault != null)
            {
                // The user doesn't have the required permission to execute this method.
                MessageBox.Show(
                    Properties.Resources.InsufficientClaimsExceptionError,
                    Settings.Default.ApplicationName,
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
            }
            else
            {
                // Check to see if the record is busy.
                FaultException <OptimisticConcurrencyFault> optimisticConcurrencyFault = faultException as FaultException <OptimisticConcurrencyFault>;
                if (optimisticConcurrencyFault != null)
                {
                    // This record is busy - please try again later.
                    MessageBox.Show(
                        Properties.Resources.OptimisticConcurrencyExceptionError,
                        Settings.Default.ApplicationName,
                        MessageBoxButton.OK,
                        MessageBoxImage.Error);
                }
                else
                {
                    // If we haven't recognized what kind of fault was generated, then we'll just emit to the user whatever message came with this fault.
                    MessageBox.Show(faultException.Message, Settings.Default.ApplicationName, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }

            // When the entire batch fails, we'll restore the entire Model View back to it's original state (the one it had before generating the batch).
            WorkingOrderCollection <EquityWorkingOrder> workingOrderCollection = this.equityWorkingOrderView.WorkingOrders;

            foreach (WebService.WorkingOrder workingOrder in workingOrders)
            {
                DataModel.WorkingOrderRow workingOrderRow = DataModel.WorkingOrder.WorkingOrderKey.Find(workingOrder.WorkingOrderId);
                Int32 index = workingOrderCollection.Find(workingOrderRow.WorkingOrderId);
                if (index >= 0)
                {
                    EquityWorkingOrder equityWorkingOrder = workingOrderCollection[index];
                    workingOrderCollection.View.EditItem(equityWorkingOrder);
                    equityWorkingOrder.IsBrokerMatch      = workingOrderRow.IsBrokerMatch;
                    equityWorkingOrder.IsHedgeMatch       = workingOrderRow.IsHedgeMatch;
                    equityWorkingOrder.IsInstitutionMatch = workingOrderRow.IsInstitutionMatch;
                    workingOrderCollection.View.CommitEdit();
                }
            }
        }