Exemple #1
0
 /// <summary>
 /// <inheritDoc/>
 ///
 /// </summary>
 public override IList <Redwood.Record> SignalStartTrack(Redwood.Record signal)
 {
     //(queue track)
     this.queuedTracks.AddLast(signal);
     //(push info)
     if (info != null)
     {
         this.trackStack.Push(info);
     }
     info = new OutputHandler.TrackInfo(signal.content.ToString(), signal.timesstamp);
     //(force print)
     if (signal.Force())
     {
         UpdateTracks(signal.depth + 1);
     }
     //(return)
     return(Empty);
 }
        /// <summary>
        /// <inheritDoc/>
        ///
        /// </summary>
        public override IList <Redwood.Record> Handle(Redwood.Record record)
        {
            bool isPrinting = false;

            if (record.Force())
            {
                //--Case: Force Printing
                isPrinting = true;
            }
            else
            {
                switch (this.defaultState)
                {
                case VisibilityHandler.State.HideAll:
                {
                    //--Case: Filter
                    //--Default False
                    foreach (object tag in record.Channels())
                    {
                        if (this.deltaPool.Contains(tag))
                        {
                            isPrinting = true;
                            break;
                        }
                    }
                    break;
                }

                case VisibilityHandler.State.ShowAll:
                {
                    //--Default True
                    if (!this.deltaPool.IsEmpty())
                    {
                        // Short-circuit for efficiency
                        bool somethingSeen = false;
                        foreach (object tag_1 in record.Channels())
                        {
                            if (this.deltaPool.Contains(tag_1))
                            {
                                somethingSeen = true;
                                break;
                            }
                        }
                        isPrinting = !somethingSeen;
                    }
                    else
                    {
                        isPrinting = true;
                    }
                    break;
                }

                default:
                {
                    throw new InvalidOperationException("Unknown default state setting: " + this.defaultState);
                }
                }
            }
            //--Return
            if (isPrinting)
            {
                return(Java.Util.Collections.SingletonList(record));
            }
            else
            {
                return(Empty);
            }
        }