Exemplo n.º 1
0
 protected virtual void OnProjectCompiledSuccessfully(object sender, CompilerEventArgs args)
 {
     if (ProjectCompiledSuccessfully != null)
     {
         ProjectCompiledSuccessfully(sender, args);
     }
 }
Exemplo n.º 2
0
        protected override void OnProjectCompiledSuccessfully(CompilerEventArgs args)
        {
            // Retrieve new assembly location
            AssemblyLocation = args.CompilerResults.PathToAssembly;

            // Copy local references to the output folder
            var results     = args.CompilerResults;
            var assemblyDir = Path.GetDirectoryName(results.PathToAssembly);

            foreach (var reference in References.Where((r) => !r.IsGlobal))
            {
                try
                {
                    var srcFileInfo = new FileInfo(reference.AssemblyLocation);
                    var dstFileName = assemblyDir.ConcatPath(Path.GetFileName(srcFileInfo.Name));
                    var dstFileInfo = srcFileInfo.CopyTo(dstFileName, true);
                    dstFileInfo.IsReadOnly = false;
                }
                catch (IOException)
                {
                    // Ignore as file is probably in use (because we loaded it)
                }
            }

            base.OnProjectCompiledSuccessfully(args);
        }
Exemplo n.º 3
0
 protected virtual void OnProjectCompiledSuccessfully(CompilerEventArgs args)
 {
     try
     {
         if (ProjectCompiledSuccessfully != null)
         {
             ProjectCompiledSuccessfully(this, args);
         }
     }
     catch (Exception e)
     {
         Shell.Instance.Logger.Log(e);
     }
 }
Exemplo n.º 4
0
        private void RunWorkerCompletedCB(object sender, RunWorkerCompletedEventArgs args)
        {
            CompilerResults = args.Result as CompilerResults;

            var compilerArgs = new CompilerEventArgs(CompilerResults);

            if (!CompilerResults.Errors.HasErrors)
            {
                AssemblyLocation = CompilerResults.PathToAssembly;
                OnProjectCompiledSuccessfully(compilerArgs);
            }

            OnCompileCompleted(compilerArgs);
        }
Exemplo n.º 5
0
 protected virtual void OnCompileCompleted(CompilerEventArgs args)
 {
     try
     {
         if (CompileCompleted != null)
         {
             CompileCompleted(this, args);
         }
     }
     catch (Exception e)
     {
         Shell.Instance.Logger.Log(e);
     }
 }
Exemplo n.º 6
0
        public void Compile()
        {
            CompilerResults = DoCompile();

            var args = new CompilerEventArgs(CompilerResults);

            if (!CompilerResults.Errors.HasErrors)
            {
                AssemblyLocation = CompilerResults.PathToAssembly;
                OnProjectCompiledSuccessfully(args);
            }

            OnCompileCompleted(args);
        }
Exemplo n.º 7
0
        void this_ProjectCompiledSuccessfully(object sender, CompilerEventArgs args)
        {
            // Copy local references
            var results     = args.CompilerResults;
            var assemblyDir = Path.GetDirectoryName(results.PathToAssembly);

            foreach (var reference in References.Where((r) => !r.IsGlobal))
            {
                var srcFileInfo = new FileInfo(reference.AssemblyLocation);
                var dstFileName = assemblyDir.ConcatPath(Path.GetFileName(srcFileInfo.Name));
                var dstFileInfo = srcFileInfo.CopyTo(dstFileName, true);
                dstFileInfo.IsReadOnly = false;
            }
        }
Exemplo n.º 8
0
 protected virtual void OnCompileCompleted(CompilerEventArgs args)
 {
     try
     {
         if (!args.CompilerResults.Errors.HasErrors)
         {
             OnProjectCompiledSuccessfully(args);
         }
         if (CompileCompleted != null)
         {
             CompileCompleted(this, args);
         }
     }
     catch (Exception e)
     {
         Shell.Instance.Logger.Log(e);
     }
 }
Exemplo n.º 9
0
 void Project_Compiled(object sender, CompilerEventArgs args)
 {
     // Refire this event
     OnProjectCompiledSuccessfully(sender, args);
 }