private void AnalyzeReference(IPythonInterpreterWithProjectReferences interp) { if (interp != null) { _failedToAnalyze = false; var task = interp.AddReferenceAsync(new ProjectAssemblyReference(AssemblyName, Url)); // check if we get an exception, and if so mark ourselves as a dangling reference. task.ContinueWith(new TaskFailureHandler(TaskScheduler.FromCurrentSynchronizationContext(), this).HandleAddRefFailure); } }
private void RemoveAnalyzedAssembly(IPythonInterpreterWithProjectReferences interp) { if (interp != null) { if (_curReference != null) { interp.RemoveReference(_curReference); _curReference = null; } } }
internal void AnalyzeReference(IPythonInterpreterWithProjectReferences interp) { if (interp == null) { _failedToAnalyze = true; return; } _failedToAnalyze = false; var task = interp.AddReferenceAsync(new ProjectReference(_filename, ProjectReferenceKind.ExtensionModule)); // check if we get an exception, and if so mark ourselves as a dangling reference. task.ContinueWith(new TaskFailureHandler(TaskScheduler.FromCurrentSynchronizationContext(), this).HandleAddRefFailure); }
private void AnalyzeReference(IPythonInterpreterWithProjectReferences interp) { if (interp == null) { _failedToAnalyze = true; return; } _failedToAnalyze = false; var task = interp.AddReferenceAsync(new ProjectReference(_filename, ProjectReferenceKind.ExtensionModule)); // check if we get an exception, and if so mark ourselves as a dangling reference. task.ContinueWith(new TaskFailureHandler(TaskScheduler.FromCurrentSynchronizationContext(), this).HandleAddRefFailure); }
internal async Task AddAnalyzedAssembly(IPythonInterpreterWithProjectReferences interp) { if (interp != null) { var asmName = AssemblyName; string outFile; try { outFile = ReferencedProjectOutputPath; } catch (COMException) { _failedToAnalyze = true; return; } _failedToAnalyze = false; _curReference = null; if (!string.IsNullOrEmpty(asmName)) { _asmName = new AssemblyName(asmName); _curReference = new ProjectAssemblyReference(_asmName, ReferencedProjectOutputPath); } else if (File.Exists(outFile)) { _asmName = null; _curReference = new ProjectReference(outFile, ProjectReferenceKind.ExtensionModule); } else { if (ReferencedProjectObject == null || !Utilities.GuidEquals(PythonConstants.ProjectFactoryGuid, ReferencedProjectObject.Kind)) { // Only failed if the reference isn't to another Python // project. _failedToAnalyze = true; } } if (_curReference != null) { try { await interp.AddReferenceAsync(_curReference); } catch (Exception) { _failedToAnalyze = true; } } } }
internal async Task AddAnalyzedAssembly(IPythonInterpreterWithProjectReferences interp) { if (interp != null) { var asmName = AssemblyName; var outFile = ReferencedProjectOutputPath; _failedToAnalyze = false; _curReference = null; if (!string.IsNullOrEmpty(asmName)) { _asmName = new AssemblyName(asmName); _curReference = new ProjectAssemblyReference(_asmName, ReferencedProjectOutputPath); } else if (File.Exists(outFile)) { _asmName = null; _curReference = new ProjectReference(outFile, ProjectReferenceKind.ExtensionModule); } else { if (ReferencedProjectObject == null || !Utilities.GuidEquals(PythonConstants.ProjectFactoryGuid, ReferencedProjectObject.Kind)) { // Only failed if the reference isn't to another Python // project. _failedToAnalyze = true; } } if (_curReference != null) { try { await interp.AddReferenceAsync(_curReference); } catch (Exception) { _failedToAnalyze = true; } } } }