Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var exampleToRun = ExamplesEnumeration.SelectCharactersWithUsing;

            switch (exampleToRun)
            {
            case ExamplesEnumeration.BasicConnection:
                BasicConnectionExample.ShowBasicSyntaxConnection();
                break;

            case ExamplesEnumeration.InsertCharacter:
                BasicConnectionExample.InsertCharacter();
                break;

            case ExamplesEnumeration.SelectCharacters:
                BasicConnectionExample.SelectCharacters();
                break;

            case ExamplesEnumeration.DeleteCharacterWithUsing:
                UsingSyntax.DeleteCharacter();
                break;

            case ExamplesEnumeration.SelectCharactersWithUsing:
                UsingSyntax.SelectCharacters();
                break;

            case ExamplesEnumeration.UpdateCharactersWithPredefinedCS:
                PredefinedConnectionString.UpdateCharacter();
                break;
            }

            Console.Read();
        }
        private IEnumerable <ImportedSymbol> GatherImportedSymbols(UsingSyntax usingDirective, Binder scope)
        {
            var lookup = scope.LookupInGlobalNamespace(usingDirective.Name, package);

            if (!lookup.IsViable)
            {
                diagnostics.AddBindingError(compilationUnit.SourceFile, usingDirective.Name.Position, $"Could not bind using statement for {usingDirective.Name}");
            }

            var symbol     = lookup.Symbols.Single();
            var @namespace = symbol as NamespaceReference;

            if (@namespace != null)
            {
                return(@namespace.GetMembers().Select(m => new ImportedSymbol(m, null)));
            }

            return(new[] { new ImportedSymbol(symbol, null) });
        }
Exemplo n.º 3
0
 public virtual void Visit(UsingSyntax usingSyntax)
 {
 }
Exemplo n.º 4
0
 private BoundUsing BindUsing(UsingSyntax syntax, List<BoundNamespace> availableNamespaces)
 {
     var boundNamespace = availableNamespaces.Single(x => x.Name == syntax.NamespaceName.Value);
     _contextService.Load(boundNamespace);
     var boundUsing = new BoundUsing(syntax.NamespaceName.Value, syntax, boundNamespace);
     return boundUsing;
 }
Exemplo n.º 5
0
 public BoundUsing(string namespaceName, UsingSyntax usingSyntax, BoundNamespace boundNamespace)
     : base(usingSyntax)
 {
     NamespaceName = namespaceName;
     BoundNamespace = boundNamespace;
 }