Exemplo n.º 1
0
 /// <summary>
 /// Broadcasts a change of record event.
 /// </summary>
 /// <param name="taxLotsEventArgs">The event argument.</param>
 public static void OnTaxLotChanged(TaxLotEventArgs taxLotsEventArgs)
 {
     // Broadcast the event to any listeners.
     if (TaxLot.Changed != null)
     {
         TaxLot.Changed(typeof(TaxLot), taxLotsEventArgs);
     }
 }
Exemplo n.º 2
0
        private static void BeginMergeHandler(object sender, EventArgs eventArgs)
        {
            if (BeginMerge != null)
            {
                BeginMerge(typeof(MarketData), new EventArgs());
            }

            ProposedOrder.OnBeginMerge();
            TaxLot.OnBeginMerge();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Checks to make sure that a tax lot doesn't violate a list of restricted securities.
        /// </summary>
        /// <param name="sender">The object that originated the event (ignored).</param>
        /// <param name="taxLotEventArgs">A proposed order that is to be checked.</param>
        private static void TaxLotHandler(object sender, TaxLotEventArgs taxLotEventArgs)
        {
            // Extract the event argument.
            TaxLot taxLot = taxLotEventArgs.TaxLot;

            // There is no need to recalculate the market and sector values if the the account is not part of this compliance
            // restriction.  A quick filter should be part of all compliance checks to prevent unnecessary calculations.
            if (TelecomConcentration.betaAccountList.Contains(taxLot.Position.Account))
            {
                TelecomConcentration.updateAccountList.Add(taxLot.Position.Account);
            }
        }
Exemplo n.º 4
0
        private static void EndMergeHandler(object sender, EventArgs eventArgs)
        {
            TaxLot.OnEndMerge();
            ProposedOrder.OnEndMerge();

            if (EndMerge != null)
            {
                EndMerge(typeof(MarketData), new EventArgs());
            }


            CommandBatch.Flush();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Catches the Data Model events and rebroadcasts the event to the Rules Language Handlers.
        /// </summary>
        /// <param name="sender">The object that originated the event.</param>
        /// <param name="taxLotRowChangeEvent">The record change event argument.</param>
        public static void TaxLotHandler(object sender, ClientMarketData.TaxLotRowChangeEvent taxLotRowChangeEvent)
        {
            // Extract the record from the event argument.
            ClientMarketData.TaxLotRow taxLotRow = taxLotRowChangeEvent.Row;

            // Translate the ADO.NET row states into a record state used by the Rules Engine.
            Action action = Action.Nothing;

            switch (taxLotRowChangeEvent.Action)
            {
            case DataRowAction.Add: action = Action.Add; break;

            case DataRowAction.Delete: action = Action.Delete; break;

            case DataRowAction.Change: action = Action.Change; break;
            }

            // Place the event into a list that will be processed when the tables are no longer locked.
            TaxLot.taxLotEventArgList.Add(new TaxLotEventArgs(action, TaxLot.Make(taxLotRow)));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Constructs and argument for passing a proposed order event to a listener.
 /// </summary>
 /// <param name="action">The action taken on the proposed order.</param>
 /// <param name="taxLot">The proposed order record.</param>
 public TaxLotEventArgs(Action action, TaxLot taxLot)
 {
     // Initialize the record.
     this.action = action;
     this.taxLot = taxLot;
 }