Exemplo n.º 1
0
        protected override void EstablishContext()
        {
            argumentMap = new ArgumentMap
            {
                { "Foo", new[] { "22" } }
            };

            argumentKey = new SimpleArgumentKey <int>("Foo");
        }
        protected override void EstablishContext()
        {
            argumentMap = new ArgumentMap
            {
                { "Foo", new[] {"22"}}
            };

            argumentKey = new SimpleArgumentKey<int>("Foo");
        }
        protected override void EstablishContext()
        {
            argumentMap = new ArgumentMap
            {
                { "Go", new[] { "1", "2", "3" }}
            };

            argumentKey = new CollectionArgumentKey<int>("Go");
        }
Exemplo n.º 4
0
        protected override void EstablishContext()
        {
            argumentMap = new ArgumentMap
            {
                { "Go", new[] { "1", "2", "3" } }
            };

            argumentKey = new CollectionArgumentKey <int>("Go");
        }
Exemplo n.º 5
0
 private void RaiseDiagnosticsUpdated(
     StateType type, object key, ProviderId providerId, SolutionArgument solution, ImmutableArray <DiagnosticData> diagnostics)
 {
     if (_owner != null)
     {
         var id = new ArgumentKey(providerId, type, key);
         _owner.RaiseDiagnosticsUpdated(this,
                                        new DiagnosticsUpdatedArgs(id, _analyzersAndState.Workspace, solution.Solution, solution.ProjectId, solution.DocumentId, diagnostics));
     }
 }
Exemplo n.º 6
0
        protected override void EstablishContext()
        {
            propertyDictionary = new ArgumentMap
            {
                { "SomeKey", new[] { "SomeValue" } }
            };

            key         = new SimpleArgumentKey <string>("SomeKey");
            propertyBag = new Arguments(propertyDictionary);
        }
Exemplo n.º 7
0
        protected override void EstablishContext()
        {
            argumentMap = new ArgumentMap
            {
                { "Go", new[] { "Go", "Gadgetto", "mat" } },
                { "No", new[] { "more", "heroes" } }
            };

            argumentKey = new CollectionArgumentKey <string>("Go");
        }
Exemplo n.º 8
0
        private void RaiseDiagnosticsUpdated(
            StateType type, object key, DiagnosticAnalyzer analyzer, SolutionArgument solution, ImmutableArray <DiagnosticData> diagnostics)
        {
            if (Owner == null)
            {
                return;
            }

            var id = new ArgumentKey(analyzer, type, key);

            Owner.RaiseDiagnosticsUpdated(this,
                                          new DiagnosticsUpdatedArgs(id, Workspace, solution.Solution, solution.ProjectId, solution.DocumentId, diagnostics));
        }
            private async Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(object documentOrProject, ArgumentKey key, CancellationToken cancellationToken)
            {
                var driver = await GetDiagnosticAnalyzerDriverAsync(documentOrProject, key.StateType, cancellationToken).ConfigureAwait(false);
                var versions = await GetVersionsAsync(documentOrProject, key.StateType, cancellationToken).ConfigureAwait(false);

                var project = GetProject(documentOrProject);
                var stateSet = this.StateManager.GetOrCreateStateSet(project, key.Analyzer);
                if (stateSet == null)
                {
                    return ImmutableArray<DiagnosticData>.Empty;
                }

                var analysisData = await GetDiagnosticAnalysisDataAsync(project.Solution, driver, stateSet, key.StateType, versions).ConfigureAwait(false);
                if (key.StateType != StateType.Project)
                {
                    return analysisData.Items;
                }

                return analysisData.Items.Where(d =>
                {
                    if (key.Key is DocumentId)
                    {
                        return object.Equals(d.DocumentId, key.Key);
                    }

                    if (key.Key is ProjectId)
                    {
                        return object.Equals(d.ProjectId, key.Key);
                    }

                    return false;
                }).ToImmutableArray();
            }
            private async Task <ImmutableArray <DiagnosticData> > GetDiagnosticsAsync(object documentOrProject, ArgumentKey key, CancellationToken cancellationToken)
            {
                var driver = await GetDiagnosticAnalyzerDriverAsync(documentOrProject, key.StateType, cancellationToken).ConfigureAwait(false);

                var versions = await GetVersionsAsync(documentOrProject, key.StateType, cancellationToken).ConfigureAwait(false);

                var project  = GetProject(documentOrProject);
                var stateSet = this.StateManager.GetOrCreateStateSet(project, key.Analyzer);

                if (stateSet == null)
                {
                    return(ImmutableArray <DiagnosticData> .Empty);
                }

                var analysisData = await GetDiagnosticAnalysisDataAsync(project.Solution, driver, stateSet, key.StateType, versions).ConfigureAwait(false);

                if (key.StateType != StateType.Project)
                {
                    return(analysisData.Items);
                }

                return(analysisData.Items.Where(d =>
                {
                    if (key.Key is DocumentId)
                    {
                        return object.Equals(d.DocumentId, key.Key);
                    }

                    if (key.Key is ProjectId)
                    {
                        return object.Equals(d.ProjectId, key.Key);
                    }

                    return false;
                }).ToImmutableArray());
            }
 private void RaiseDiagnosticsUpdated(
     StateType type, object key, ProviderId providerId, SolutionArgument solution, ImmutableArray<DiagnosticData> diagnostics)
 {
     if (_owner != null)
     {
         var id = new ArgumentKey(providerId, type, key);
         _owner.RaiseDiagnosticsUpdated(this,
             new DiagnosticsUpdatedArgs(id, _analyzersAndState.Workspace, solution.Solution, solution.ProjectId, solution.DocumentId, diagnostics));
     }
 }
        protected override void EstablishContext()
        {
            argumentMap = new ArgumentMap
            {
                { "Go", new[] { "Go", "Gadgetto", "mat" }},
                { "No", new[] { "more", "heroes" }}
            };

            argumentKey = new CollectionArgumentKey<string>("Go");
        }
 protected override void EstablishContext()
 {
     argumentMap = new ArgumentMap();
     argumentKey = new CollectionArgumentKey<string>("Go");
 }
        private string Write177_ArgumentKey(ArgumentKey v)
        {
            switch (v)
            {
                case ArgumentKey.None:
                    return "None";

                case ArgumentKey.Help:
                    return "Help";

                case ArgumentKey.Init:
                    return "Init";

                case ArgumentKey.Safe:
                    return "Safe";

                case ArgumentKey.NewInstance:
                    return "NewInstance";

                case ArgumentKey.OldInstance:
                    return "OldInstance";

                case ArgumentKey.Tab:
                    return "Tab";

                case ArgumentKey.LeftFolder:
                    return "LeftFolder";

                case ArgumentKey.RightFolder:
                    return "RightFolder";

                case ArgumentKey.CurrentFolder:
                    return "CurrentFolder";

                case ArgumentKey.FarFolder:
                    return "FarFolder";

                case ArgumentKey.Culture:
                    return "Culture";

                case ArgumentKey.FormLocalizer:
                    return "FormLocalizer";

                case ArgumentKey.RecoveryFolder:
                    return "RecoveryFolder";

                case ArgumentKey.Debug:
                    return "Debug";

                case ArgumentKey.Dump:
                    return "Dump";

                case ArgumentKey.Restart:
                    return "Restart";
            }
            long num = (long) v;
            throw base.CreateInvalidEnumValueException(num.ToString(CultureInfo.InvariantCulture), "Nomad.ArgumentKey");
        }
Exemplo n.º 15
0
 protected override void EstablishContext()
 {
     argumentMap = new ArgumentMap();
     argumentKey = new CollectionArgumentKey <string>("Go");
 }