Exemplo n.º 1
0
        private void StartUpdateChart(List <LogMessage> messages)
        {
            if (messages != null && messages.Count > 0)
            {
                UpdateChartDelegate worker            = UpdateChartWorker;
                AsyncCallback       completedCallback = UpdateChartCallback;

                lock (mSyncRoot)
                {
                    if (mInUpdate)
                    {
                        return;
                    }

                    // Create the asynchronous operation.
                    AsyncOperation async = AsyncOperationManager.CreateOperation(null);

                    // And start it.
                    worker.BeginInvoke(
                        messages
                        , completedCallback
                        , async);

                    mInUpdate = true;
                }
            }
        }
Exemplo n.º 2
0
        private void UpdateChartCallback(IAsyncResult ar)
        {
            UpdateChartDelegate worker = (UpdateChartDelegate)((AsyncResult)ar).AsyncDelegate;

            // Finish the asynchronous operation
            worker.EndInvoke(ar);

            BeginInvoke(new Action(EndUpdateChart));
        }