Esempio n. 1
0
        /// <summary>
        /// Create a new messenger class with callbacks.
        /// </summary>
        /// <param name="connectedSocketCall">For when a client connects</param>
        /// <param name="disconnectedSocketCall">For when a client disconnects</param>
        /// <param name="messageReceivedCall">For when a message is recieved</param>
        public Messenger(
            DeferredInvokeDelegate connectedSocketCall,
            DeferredInvokeDelegate disconnectedSocketCall,
            DeferredInvokeMessageDelegate messageReceivedCall)
        {
            // set initial connection values
            this.ConnectedSocketCall    = connectedSocketCall;
            this.DisconnectedSocketCall = disconnectedSocketCall;
            this.MessageReceivedCall    = messageReceivedCall;
            this.allConnections         = new LinkedList <Connection>();

            // create a listening connection
            InitConAPI();
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the <see cref="chart_filters"/> and <see cref="NumberInputs"/>
        /// to reflect the current state of the filters.
        /// </summary>
        /// <param name="sender">N/A</param>
        /// <seealso cref="UpdateAll"/>
        private void UpdateEqualizer(object sender)
        {
            if (chart_filters.InvokeRequired)
            {
                // thread-safe method
                DeferredInvokeDelegate d = new DeferredInvokeDelegate(UpdateEqualizer);
                this.Invoke(d, new object[] { sender });
            }
            else
            {
                // update series and change the graph visually
                UpdateEqualizerGraph();

                // update the filter text inputs
                UpdateEqualizerTextInputs();

                // force the chart to update to the new values
                chart_filters.DataBind();
            }
        }