Example #1
0
        /// <summary>
        /// Entry point for progression. Gets called every time when progression
        ///  - Needs to know if a node has children
        ///  - Wants to get children for a node
        ///  - During solution explorer search
        /// </summary>
        public void BeginGetGraphData(IGraphContext context)
        {
            JoinableFactory.RunAsync(async() =>
            {
                try
                {
                    await InitializeAsync();

                    foreach (Lazy <IDependenciesGraphActionHandler, IOrderPrecedenceMetadataView> handler in _graphActionHandlers)
                    {
                        if (handler.Value.TryHandleRequest(context))
                        {
                            _changeTracker.RegisterGraphContext(context);

                            // Only one handler should succeed
                            return;
                        }
                    }
                }
                catch (Exception ex)
                {
                    context.ReportError(ex);
                }
                finally
                {
                    // OnCompleted must be called to display changes
                    context.OnCompleted();
                }
            });
        }