public static API_IKVMC_Java_Metadata javaMetadata(this string file) { API_IKVMC_Java_Metadata javaMetadata = null; try { javaMetadata = (API_IKVMC_Java_Metadata)O2LiveObjects.get(file); // try first to get a cached version of this file } catch {} if (javaMetadata.isNull() && file.fileExists()) { "Cached version not found, loading from disk".info(); if (file.extension(".xml")) { javaMetadata = file.load <API_IKVMC_Java_Metadata>(); } else { javaMetadata = new API_IKVMC().create_JavaMetadata(file); } O2LiveObjects.set(file, javaMetadata); } return(javaMetadata); }
public static T o2Cache <T>(this string key) { var value = O2LiveObjects.get(key); if (value is T) { return((T)value); } return(default(T)); }
public static O2_VS_AddIn create_FromO2LiveObjects() { var vsAddIn = new O2_VS_AddIn(); vsAddIn.VS_Dte = (DTE2)O2LiveObjects.get("VisualStudio_Dte"); vsAddIn.VS_AddIn = (AddIn)O2LiveObjects.get("VisualStudio_AddIn"); vsAddIn.VS_Type = (string)O2LiveObjects.get("VisualStudio_Type"); if (vsAddIn.notNull()) { "[O2_VS_AddIn] loaded DTE2 object from O2LiveObjects".info(); return(vsAddIn); } "[O2_VS_AddIn] failed to load DTE2 object from O2LiveObjects".error(); return(null); }
public FVDL loadFvdl_Raw(string fvdlFile) { "Loading fvdl file: {0}".info(fvdlFile); try { var chachedFvdl = (FVDL)O2LiveObjects.get(fvdlFile); if (chachedFvdl.notNull()) { return(chachedFvdl); } } catch { } var o2Timer = new O2Timer("loading {0} file".format(fvdlFile.fileName())).start(); var _fvdl = FVDL.Load(fvdlFile); O2LiveObjects.set(fvdlFile, _fvdl); o2Timer.stop(); return(_fvdl); }
public O2_VS_AddIn setup(DTE2 dte, AddIn addin, string vsType) { try { this.VS_Dte = dte; this.VS_AddIn = addin; this.VS_Type = vsType; O2LiveObjects.set("VisualStudio_Dte", dte); O2LiveObjects.set("VisualStudio_AddIn", addin); O2LiveObjects.set("VisualStudio_Type", vsType); //PublicDI.config.setLocalScriptsFolder(PublicDI.config.CurrentExecutableDirectory.pathCombine("O2.Platform.Scripts")); openO2LogViewer(); "****O2LiveObjects: Dte: {0}".info(O2LiveObjects.get("VisualStudio_Dte")); "****O2LiveObjects: AddIn: {0}".info(O2LiveObjects.get("VisualStudio_AddIn")); "****O2LiveObjects: Type: {0}".info(O2LiveObjects.get("VisualStudio_Type")); //syncO2Repositories(); "Testing Log viewer (from Dynamically compiled Script in O2)".info(); this.add_TopMenu("O2 Platform"); this.add_Command <O2_ScriptWithPanel>() .add_Command <O2_ScriptGui>() .add_Command <O2_LogViewer>(); } catch (Exception ex) { ex.log(); } return(this); }
public static object liveObject(this string key) { return(O2LiveObjects.get(key)); }