Exemplo n.º 1
0
        // constructor
        public CodeGenerationContext(Document queryDoc)
        {
            tiny          = TinyIoCContainer.Current;
            queryHasRun   = false;
            this.queryDoc = queryDoc;
            dte           = queryDoc.DTE;
            query         = new Query(this);
            provider      = tiny.Resolve <IProvider>(DesignTimeConnectionString.v.ProviderName);
            provider.Initialize(DesignTimeConnectionString.v);
            // resolving the target project item for code generation. We know the file name, we loop through child items of the query til we find it.
            _putCodeHere = new PutCodeHere(Conductor.GetItemByFilename(queryDoc.ProjectItem.ProjectItems, GeneratedClassFullFilename));


            string currDir = Path.GetDirectoryName(queryDoc.FullName);

            hlpr = new AdoSchemaFetcher();
        }
        // constructor
        public CodeGenerationContext(Document queryDoc)
        {
            tiny          = TinyIoCContainer.Current;
            queryHasRun   = false;
            this.queryDoc = queryDoc;
            dte           = queryDoc.DTE;
            query         = new Query(this);
            provider      = tiny.Resolve <IProvider>(DesignTimeConnectionString.ProviderName);
            provider.Initialize(DesignTimeConnectionString);
            // resolving the target project item for code generation. We know the file name, we loop through child items of the query til we find it.
            _putCodeHere = new PutCodeHere(Conductor.GetItemByFilename(queryDoc.ProjectItem.ProjectItems, GeneratedClassFullFilename));


            string currDir = Path.GetDirectoryName(queryDoc.FullName);

            //WriteToOutput("\nprocessing " + queryDoc.FullName );
            // class name and namespace read from user's half of partial class.
            //QfClassName = Regex.Match(query, "(?im)^--QfClassName\\s*=\\s*(\\S+)").Groups[1].Value;
            //QfNamespace = Regex.Match(query, "(?im)^--QfNamespace\\s*=\\s*(\\S+)").Groups[1].Value;
            // doc.fullname started being lowercase ??
            //namespaceAndClassNames = GetNamespaceAndClassNames(resultsClass);

            hlpr = new AdoSchemaFetcher();
        }