/// <summary>
        /// Record the measurement by notifying all <see cref="MeterListener" /> objects which listening to this instrument.
        /// </summary>
        /// <param name="measurement">The measurement value.</param>
        /// <param name="tags">A span of key-value pair tags associated with the measurement.</param>
        protected void RecordMeasurement(T measurement, ReadOnlySpan <KeyValuePair <string, object?> > tags)
        {
            DiagNode <ListenerSubscription>?current = _subscriptions.First;

            while (current is not null)
            {
                current.Value.Listener.NotifyMeasurement(this, measurement, tags, current.Value.State);
                current = current.Next;
            }
        }
Beispiel #2
0
        // NotifyForUnpublishedInstrument is called from Meter.Dispose()
        internal void NotifyForUnpublishedInstrument()
        {
            DiagNode <ListenerSubscription>?current = _subscriptions.First;

            while (current is not null)
            {
                current.Value.Listener.DisableMeasurementEvents(this);
                current = current.Next;
            }

            _subscriptions.Clear();
        }
Beispiel #3
0
        public bool MoveNext()
        {
            if (_nextNode == null)
            {
                _currentItem = default;
                return(false);
            }

            _currentItem = _nextNode.Value;
            _nextNode    = _nextNode.Next;
            return(true);
        }
Beispiel #4
0
        internal object?GetSubscriptionState(MeterListener listener)
        {
            DiagNode <ListenerSubscription>?current = _subscriptions.First;

            while (current is not null)
            {
                if (object.ReferenceEquals(listener, current.Value.Listener))
                {
                    return(current.Value.State);
                }
                current = current.Next;
            }

            return(null);
        }
Beispiel #5
0
        public LinkEditor(DialogueEditorWPF owner, DiagNode node)
        {
            ParentWindow = owner;
            if (ParentWindow.SelectedDialogueNode == null)
            {
                Close();
                throw new Exception("ListEd couldn't find node.");
            }
            LoadCommands();
            InitializeComponent();

            Dnode   = node;
            IsReply = Dnode.Node.IsReply;
            if (IsReply)
            {
                this.Width = 700;
            }

            string s  = "E";
            int    id = Dnode.NodeID;

            if (IsReply)
            {
                //outType_TB.Text = "E";
                s   = "R";
                id -= 1000;
            }

            Title = $"Link Editor - {s}{id} : {Dnode.Node.LineStrRef}";
            LineString_TextBlock.Text = Dnode.Node.Line;

            int n = 0;

            foreach (var link in Dnode.Links)
            {
                link.Order = n;
                ParseLink(link);
                linkTable.Add(link);
                n++;
            }
            GenerateTable();
        }
Beispiel #6
0
 public Enumerator(DiagNode <T>?head)
 {
     _nextNode    = head;
     _currentItem = default;
 }