Пример #1
0
        private void InternalRegisterInstantDataTarget <TTarget>(InstantDataTarget target)
        {
            // Get the instant stream reader with the required cursor epsilon
            EpsilonInstantStreamReader <T> instantStreamReader = this.GetInstantStreamReader(target.CursorEpsilon, true);

            // Register the instant visualization object with the instant stream reader
            instantStreamReader.RegisterInstantDataTarget <TTarget>(target);
        }
Пример #2
0
        private EpsilonInstantStreamReader <T> GetInstantStreamReader(RelativeTimeInterval cursorEpsilon, bool createIfNecessary)
        {
            // Check if we have a registration for this instant stream reader
            lock (this.instantStreamReaders)
            {
                EpsilonInstantStreamReader <T> instantStreamReader = this.instantStreamReaders.FirstOrDefault(isr => isr.CursorEpsilon.Equals(cursorEpsilon));
                if (instantStreamReader == default)
                {
                    if (createIfNecessary)
                    {
                        // Create the instant stream reader
                        instantStreamReader = new EpsilonInstantStreamReader <T>(cursorEpsilon);
                        this.instantStreamReaders.Add(instantStreamReader);
                    }
                    else
                    {
                        throw new ArgumentException("The instant stream reader is not registered.");
                    }
                }

                return(instantStreamReader);
            }
        }