public static Saved_MethodStream Create(O2MappedAstData astData, IMethod iMethod, string methodStreams_CacheLocation, bool forceCreate) { if (methodStreams_CacheLocation.isNull()) { methodStreams_CacheLocation = "_methodStreams_CacheLocation".tempDir(); } var safeFileName = iMethod.fullName().safeFileName(); //240 - methodStreams_CacheLocation.size()); var pathToSaveSerializedObject = methodStreams_CacheLocation.pathCombine_MaxSize(safeFileName + ".methodStream.xml"); if (forceCreate.isFalse() && pathToSaveSerializedObject.fileExists()) { "Skipping iMethod '{0}' since serialized object already exists ".debug(iMethod.Name); var loaded_SavedMethodStream = pathToSaveSerializedObject.load <Saved_MethodStream>(); if (loaded_SavedMethodStream.notNull()) { return(loaded_SavedMethodStream); } } var savedMethodStream = new Saved_MethodStream(astData, iMethod); if (savedMethodStream.isNull()) { return(null); } else { savedMethodStream.Serialized_Saved_MethodStream_FileCache = pathToSaveSerializedObject; savedMethodStream.saveAs(pathToSaveSerializedObject); "Serialized method stream object saved to: {0}".debug(pathToSaveSerializedObject); return(savedMethodStream); } }
public void loadMethodStream(Saved_MethodStream _savedMethodStream) { if (_savedMethodStream.isNull()) { "provided savedMethodStream object is null".error(); } else { savedMethodStream = _savedMethodStream; codeViewer.set_Text(savedMethodStream.MethodStream); //codeViewer.open(savedMethodStream.MethodStream_FileCache ); refresh_AllCodeStreams_TreeView(); //codeStreams.selectFirst(); } }
public void loadMethodStream(Saved_MethodStream _savedMethodStream) { if (_savedMethodStream.isNull()) "provided savedMethodStream object is null".error(); else { savedMethodStream = _savedMethodStream; _codeEditor.set_Text(savedMethodStream.MethodStream , "_.cs"); //codeViewer.open(savedMethodStream.MethodStream_FileCache ); refresh_AllCodeStreams_TreeView(); //codeStreams.selectFirst(); } }
public static Saved_MethodStream Create(O2MappedAstData astData, IMethod iMethod, string methodStreams_CacheLocation, bool forceCreate) { if (methodStreams_CacheLocation.isNull()) methodStreams_CacheLocation = "_methodStreams_CacheLocation".tempDir(); var safeFileName = iMethod.fullName().safeFileName();//240 - methodStreams_CacheLocation.size()); var pathToSaveSerializedObject = methodStreams_CacheLocation.pathCombine_MaxSize(safeFileName + ".methodStream.xml"); if (forceCreate.isFalse() && pathToSaveSerializedObject.fileExists()) { "Skipping iMethod '{0}' since serialized object already exists ".debug(iMethod.Name); var loaded_SavedMethodStream = pathToSaveSerializedObject.load<Saved_MethodStream>(); if (loaded_SavedMethodStream.notNull()) return loaded_SavedMethodStream; } var savedMethodStream = new Saved_MethodStream(astData, iMethod); if (savedMethodStream.isNull()) return null; else { savedMethodStream.Serialized_Saved_MethodStream_FileCache = pathToSaveSerializedObject; savedMethodStream.saveAs(pathToSaveSerializedObject); "Serialized method stream object saved to: {0}".debug(pathToSaveSerializedObject); return savedMethodStream; } }