Beispiel #1
0
 protected virtual void OnProjectCompiledSuccessfully(object sender, CompilerEventArgs args)
 {
     if (ProjectCompiledSuccessfully != null)
     {
         ProjectCompiledSuccessfully(sender, args);
     }
 }
Beispiel #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);
        }
Beispiel #3
0
 protected virtual void OnProjectCompiledSuccessfully(CompilerEventArgs args)
 {
     try
     {
         if (ProjectCompiledSuccessfully != null)
         {
             ProjectCompiledSuccessfully(this, args);
         }
     }
     catch (Exception e)
     {
         Shell.Instance.Logger.Log(e);
     }
 }
Beispiel #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);
        }
Beispiel #5
0
 protected virtual void OnCompileCompleted(CompilerEventArgs args)
 {
     try
     {
         if (CompileCompleted != null)
         {
             CompileCompleted(this, args);
         }
     }
     catch (Exception e)
     {
         Shell.Instance.Logger.Log(e);
     }
 }
Beispiel #6
0
        public void Compile()
        {
            CompilerResults = DoCompile();

            var args = new CompilerEventArgs(CompilerResults);

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

            OnCompileCompleted(args);
        }
Beispiel #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;
            }
        }
Beispiel #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);
     }
 }
Beispiel #9
0
 void Project_Compiled(object sender, CompilerEventArgs args)
 {
     // Refire this event
     OnProjectCompiledSuccessfully(sender, args);
 }