示例#1
0
 public void EndLongOperation()
 {
     LongOperationsIndicator.EndLongOperation(this);
 }
示例#2
0
        protected virtual void DrawAllMarkers(bool reuseExisting, bool continueAfterDataPrepaired)
        {
            if (!IsReadyToDrawMarkers())
            {
                return;
            }

            var dataSource = DataSource;

            dataSource.Environment = new DataSourceEnvironment {
                Plotter = this.Plotter, FirstDraw = true
            };

            if (!continueAfterDataPrepaired)
            {
                dataSource.PrepairData(getDataAsyncronously);
                if (getDataAsyncronously)
                {
                    LongOperationsIndicator.BeginLongOperation(this);
                    return;
                }
            }

            CurrentItemsPanel.Children.Clear();

            BuildCommonBindings();

            startIndex = 0;
            lastIndex  = startIndex;

            IndividualArrangePanel panel = CurrentItemsPanel as IndividualArrangePanel;

            if (panel != null)
            {
                panel.BeginBatchAdd();
            }

            ViewportHostPanel viewportPanel = CurrentItemsPanel as ViewportHostPanel;

            if (viewportPanel != null)
            {
                viewportPanel.OverallViewportBounds = DataRect.Empty;
            }

            foreach (var dataItem in dataSource.GetData())
            {
                CreateAndAddMarker(dataItem, lastIndex);
                lastIndex++;

                if (showMarkersConsequently && lastIndex % 100 == 0)
                {
                    // make dispatcher execute all operations in its queue;
                    // so that markers will appear on the screen step-by-step,
                    // making application more responsive.

                    // This line is dangerous, it causes WI 1677
                    // Dispatcher.Invoke(() => { }, DispatcherPriority.Background);
                }
            }
            if (panel != null)
            {
                panel.EndBatchAdd();
            }

            int len = CurrentItemsPanel.Children.Count;

            if (lastIndex < len)
            {
                for (int i = lastIndex; i < len; i++)
                {
                    UIElement element = CurrentItemsPanel.Children[i];
                    element.Visibility = Visibility.Collapsed;
                }
            }

            LongOperationsIndicator.EndLongOperation(this);
        }
示例#3
0
 public void BeginLongOperation()
 {
     LongOperationsIndicator.BeginLongOperation(this);
 }