BondInEtwLinqpadDriver.BondDynamicDriver.GetNamespacesToAdd C# (CSharp) Method

GetNamespacesToAdd() public method

Returns a list of additional namespaces that should be imported automatically into all queries that use this driver.
public GetNamespacesToAdd ( IConnectionInfo cxInfo ) : IEnumerable
cxInfo IConnectionInfo Connection information, as entered by the user.
return IEnumerable
        public override IEnumerable<string> GetNamespacesToAdd(IConnectionInfo cxInfo)
        {
            var bondInEtwProperties = new BondInEtwProperties(cxInfo);

            IEnumerable<string> result = null;

            try
            {
                var driverDirectory = Path.GetDirectoryName(Assembly.GetAssembly(this.GetType()).Location);

                result = GetAssemblyTypes(driverDirectory)
                    .Concat(TypeCache.GetTypes(bondInEtwProperties.ContextName))
                    .Select(type => type.Namespace)
                    .Where(@namespace => @namespace != null)
                    .Concat(namespaces)
                    .Distinct();
            }
            catch
            {
                // Ignore
            }

            return result;
        }