Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 private void RemoveAnalyzedAssembly(IPythonInterpreterWithProjectReferences interp)
 {
     if (interp != null)
     {
         if (_curReference != null)
         {
             interp.RemoveReference(_curReference);
             _curReference = null;
         }
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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;
                    }
                }
            }
        }
Ejemplo n.º 7
0
 private void RemoveAnalyzedAssembly(IPythonInterpreterWithProjectReferences interp) {
     if (interp != null) {
         if (_curReference != null) {
             interp.RemoveReference(_curReference);
             _curReference = null;
         }
     }
 }
Ejemplo n.º 8
0
        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;
                    }
                }
            }
        }