Exemplo n.º 1
0
        public void ActionOccurs(IBilgeActionEvent evt, ConfigSettings configSettings)
        {
            var mmd = new MessageMetadata();

            mmd.CommandType    = TraceCommandTypes.Custom;
            mmd.ClassName      = "Bilge-Action";
            mmd.FileName       = "Bilge-Action";
            mmd.Body           = $"[BilgeAction]-]{evt.Name}[--]{evt.GetData??"null"}[--]{evt.CallCount}";
            mmd.FurtherDetails = evt.GetValue;
            mmd.Context        = "Bilge-Action";
            mmd.LineNumber     = "0";

            PrepareMetaData(mmd, configSettings.metaContexts);
            QueueMessage(mmd);

            foreach (var f in ActionHandlers)
            {
                try {
                    if (!actionCallCountRecord.ContainsKey(evt.Name))
                    {
                        actionCallCountRecord.Add(evt.Name, 1);
                    }
                    else
                    {
                        actionCallCountRecord[evt.Name] += 1;
                    }
                    evt.SetCallCount(actionCallCountRecord[evt.Name]);
                    f.Item2(evt);
                } catch (NullReferenceException) {
                    // Swallow at least this exception.
                }
            }
        }
Exemplo n.º 2
0
 public void Failed(IBilgeActionEvent evt)
 {
     BilgeRouter.Router.ActionOccurs(evt, cfg);
 }