本文整理汇总了C#中System.Reflection.Assembly.notNull方法的典型用法代码示例。如果您正苦于以下问题:C# Assembly.notNull方法的具体用法?C# Assembly.notNull怎么用?C# Assembly.notNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Assembly
的用法示例。
在下文中一共展示了Assembly.notNull方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: injectIntoProcess
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;
}
示例2: copy_To_Bin_Folder
/// <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;;
}
示例3: load_Wsdl_From_Assembly
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: setCachedCompiledAssembly
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: setCachedCompiledAssembly
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();
}
}
示例6: compileCSSharpFile
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;
}