public int Close()
 {
     this.hostProject = null;
     if (null != FoxProProvider)
     {
         FoxProProvider.Dispose();
         FoxProProvider = null;
     }
     return(VSConstants.S_OK);
 }
        public int RemoveAssemblyReference(string bstrAbsPath)
        {
            string path = bstrAbsPath.ToUpper(CultureInfo.CurrentCulture);

            if (references.Contains(path))
            {
                references.Remove(path);
                FoxProProvider = null;
            }
            return(VSConstants.S_OK);
        }
Exemple #3
0
        public void Compile()
        {
            FoxProProvider     provider = new FoxProProvider();
            CompilerParameters options  = new CompilerParameters(referencedAssemblies.ToArray(), OutputAssembly, IncludeDebugInformation);

            options.MainClass = MainFile;
            foreach (FoxPro.Hosting.ResourceFile resourceInfo in resourceFiles)
            {
                // NOTE: with this approach we lack a way to control the name of the generated resource or if it is public
                string resource = resourceInfo.File;
                options.EmbeddedResources.Add(resource);
            }

            CompilerResults results = provider.CompileAssemblyFromFile(options, sourceFiles.ToArray());

            foreach (CompilerError error in results.Errors)
            {
                int errorNumber = 0;
                int.TryParse(error.ErrorNumber, out errorNumber);
                this.errorSink.AddError(error.FileName, error.ErrorText, String.Empty, new FoxPro.Hosting.CodeSpan(error.Line, error.Column, error.Line, error.Column + 1), errorNumber, error.IsWarning ? FoxPro.Hosting.Severity.Warning : FoxPro.Hosting.Severity.Error);
            }
        }