public bool injectIntoProcess(Process process, bool x64, bool runtime40, Assembly assemblyToExecute)
		{
			if (assemblyToExecute.notNull())
			{				
				var className = "O2.Script.Test"; //"Snoop.SnoopUI";
				var methodName = "GoBabyGo";
				return injectIntoProcess(process, assemblyToExecute.Location, className, methodName, x64, runtime40);
			}
			return false;
		}
 /// <summary>
 /// Copies the provided assemblies into the provided AppDomain's bin folder
 /// 
 /// Returns the path to the assembly in the AppDomain bin folder
 /// 
 /// Note that this does NOT overide the assembly if it already existed
 /// </summary>
 /// <param name="appDomain"></param>
 /// <param name="assembly"></param>
 /// <returns></returns>
 public static string copy_To_Bin_Folder(this AppDomain appDomain, Assembly assembly)
 {
     if (appDomain.notNull() && assembly.notNull())
     {
         var assemblyLocation = assembly.location();
         if (assemblyLocation.fileExists())
         {
             var targetFile = appDomain.binFolder().mapPath(assemblyLocation.fileName());
             if(targetFile.file_Doesnt_Exist())
                 assemblyLocation.file_Copy(targetFile);
             if(targetFile.file_Exists())
                 return targetFile;
         }
     }
     return null;;
 }
		public void load_Wsdl_From_Assembly(Assembly wsdlAssembly)
		{
			if (wsdlAssembly.notNull())
			{
				Methods_TreeView.clear();
				"Loading Wsdl from Assembly: {0} at {1}".info(wsdlAssembly.str() , wsdlAssembly.Location);
				WsdlAssembly = wsdlAssembly;
				var soapMethods = WsdlAssembly.webService_SoapMethods();
				"Found {0} Web Service methods:{0}".info(soapMethods.size());					
				Methods_TreeView.add_Nodes(soapMethods, (method)=> ((this.ShowFullMethodSignatures) 
																		? method.str()
																		: method.Name));
				Methods_TreeView.selectFirst();
			}
			else
				"Provided Assembly was null".error();
			markGuiAs_OK();
		}	
Пример #4
0
 public static void setCachedCompiledAssembly(string key, Assembly compiledAssembly)
 {
     if (key.valid() && 
         compiledAssembly.notNull() && 
         compiledAssembly.Location.valid() &&
         compiledAssembly.Location.fileExists())
     {                                            
         CachedCompiledAssemblies.add(key, compiledAssembly.Location);
         saveCachedCompiledAssembliesMappings();                
     }
 }
Пример #5
0
 public static void setCachedCompiledAssembly(string key, Assembly compiledAssembly, bool triggerSave = false)
 {
     if (key.valid() &&
         compiledAssembly.notNull() &&
         compiledAssembly.Location.valid() &&
         compiledAssembly.Location.fileExists())
     {
         needCachedCompiledAssembliesSave = true;
         CachedCompiledAssemblies.add(key, compiledAssembly.Location);
         CachedCompiledAssemblies.add(compiledAssembly.GetName().Name, compiledAssembly.Location);
         CachedCompiledAssemblies.add(compiledAssembly.str(), compiledAssembly.Location);
         if (triggerSave)
             saveCachedCompiledAssembliesMappings();
     }
 }
        public Assembly compileCSSharpFile()
        {
            enableCodeComplete();
            compiledAssembly = null;
            var compileEngine = new CompileEngine();
            if (getSourceCode() != "")
            {
                saveSourceCode();
                // always save before compiling
                compileEngine.compileSourceFile(sPathToFileLoaded);
                compiledAssembly = compileEngine.compiledAssembly;
                if (compiledAssembly.notNull() && o2CodeCompletion.notNull() && compileEngine.cpCompilerParameters.notNull())
                    o2CodeCompletion.addReferences(compileEngine.cpCompilerParameters.ReferencedAssemblies.toList());
            }

            var state = compiledAssembly == null && compileEngine.sbErrorMessage != null;
            //btShowHideCompilationErrors.visible(state);
            //btShowHideCompilationErrors.prop("Visible",state);
            btShowHideCompilationErrors.visible(state);
            tvCompilationErrors.visible(state);
            lbCompilationErrors.visible(state);
            //lbCompilationErrors.prop("Visible", state);

            clearBookmarksAndMarkers();
            // if there isn't a compiledAssembly, show errors
            if (compiledAssembly == null)
            {
                CompileEngine_WinForms.addErrorsListToTreeView(tvCompilationErrors, compileEngine.sbErrorMessage);
                showErrorsInSourceCodeEditor(compileEngine.sbErrorMessage.str());
            }
             /*   else
            {
                if (compiledFileAstData.notNull())
                    compiledFileAstData.Dispose();
                compiledFileAstData = new O2MappedAstData(sPathToFileLoaded);
            }*/

            return compiledAssembly;
        }